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 within 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.
model1.Camera.ProjectionMode = projectionType.Orthographic;
model1.SetView(viewType.Top);
model1.Rotate.Enabled = true;
model1.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);
}
}
Comments
Please sign in to leave a comment.