If you want to recreate the features of a 2D viewer (for example, only on the XY plane) you can do it with Eyeshot by means of the tips reported in this article.
The following code allows simulating the basic features of a 2D viewer: enables the orthographic projection mode, disables the rotation on the 3D space, leaving only the one on the XY plane enabled.
design1.ActiveViewport.Camera.ProjectionMode = projectionType.Orthographic;
design1.SetView(viewType.Top);
design1.ActiveViewport.Rotate.Enabled = true;
design1.ActiveViewport.Rotate.RotationMode = rotationType.Turntable;
With the override of the RotateCamera() method, only the rotation in the XY plane is enabled:
public class MyViewport : Viewport
{
public MyViewport(Viewport another) : base(another)
{
}
public override void RotateCamera(Vector3D axis, double rotAngleInDegrees, bool trackBall, bool animate)
{
base.RotateCamera(Vector3D.AxisZ, rotAngleInDegrees, trackBall, animate);
}
}
Usage:
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
design1.Viewports[0] = new MyViewport(design1.Viewports[0]);
}
...
}
}
Comments
Please sign in to leave a comment.