Keep Picture entity always parallel to screen

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();
    }
}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.