The following Picture entity always maintains the picture parallel to the screen:
public class MyPicture : devDept.Eyeshot.Entities.Picture
{
public MyPicture(Picture another) : base(another)
{
Lighted = false;
}
protected override void Draw(DrawParams data)
{
Point3D orig;
Vector3D xAxis, yAxis, zAxis;
data.Viewport.Camera.GetFrame(out orig, out xAxis, out yAxis, out zAxis);
Align3D al = new Align3D(Plane, new Plane((Point3D)Vertices[0].Clone(), xAxis, yAxis));
data.RenderContext.PushModelView();
data.RenderContext.MultMatrixModelView(al.MatrixAsVectorByColumn);
base.Draw(data);
data.RenderContext.PopModelView();
}
protected override void DrawEdges(DrawParams data)
{
Point3D orig;
Vector3D xAxis, yAxis, zAxis;
data.Viewport.Camera.GetFrame(out orig, out xAxis, out yAxis, out zAxis);
Align3D al = new Align3D(Plane, new Plane((Point3D)Vertices[0].Clone(), xAxis, yAxis));
data.RenderContext.PushModelView();
data.RenderContext.MultMatrixModelView(al.MatrixAsVectorByColumn);
base.DrawEdges(data);
data.RenderContext.PopModelView();
}
}
Comments
Hello.
Would it be possible to obtain the same behaviour also for a Block or a set of Entities like some Lines? If yes, how? Can Align3D work for a line too, given the plane on which it lies?
Thanks for your advice!
Please sign in to leave a comment.