The following Text entity, always maintains the text parallel to the screen. It can also be useful for dimension entities to facilitate reading during dynamic rotations.
public class MyText : Text
{
public MyText(double x, double y, string textString, double height)
: base(x, y, textString, height)
{
}
// In Eyeshot 7 since there is not the Viewport parameter in the "DrawParams", we must keep a reference to the viewport.
// Of course it will only work for ViewportLayouts with one viewport.
// In Eyeshot 8 there won't be this restriction anymore
public Viewport viewport;
protected override void Draw(DrawParams data)
{
Point3D orig;
Vector3D xAxis, yAxis, zAxis;
// data.Viewport.Camera.GetFrame(out orig, out xAxis, out yAxis, out zAxis); // EYESHOT 8
viewport.Camera.GetFrame(out orig, out xAxis, out yAxis, out zAxis); // EYESHOT 7
Align3D al = new Align3D(Plane, new Plane(this.InsertionPoint, xAxis, yAxis));
gl.PushMatrix();
gl.MultMatrixd(al.MatrixAsVectorByColumn);
DrawText(data);
gl.PopMatrix();
}
}
Comments
From the build 8.0.352 and higher, you can set the property Billboard = true to get the same result.
Please sign in to leave a comment.