[vtkusers] Axis labels that are constantly facing the camera, not drawn on overlay, and have good quality fonts

Mande Leung mleung at lumerical.com
Tue Jan 20 18:38:25 EST 2015


I am using vtkCubeAxesActor to draw a 3D axis.

I see three options to draw the titles and labels: vtkAxisFollower, vtkTextActor, or vtkTextActor3D.

I need (1) the titles and labels to be constantly facing the camera, (2) not overlaid over the data, and (3) to have good quality fonts.

I'm not sure how to best achieve these things.

For vktTextActor, the fonts are rendered very nicely. However, since it is a 2D actor, it is always rendered as an overlay.
When the axis is supposed to be behind the data (say, in "FURTHEST_TRIAD" mode), the axis lines and ticks would be rendered behind the data while the titles and label are rendered at front/on top, which looks awkward to me.

Using vtkAxisFollower can avoid the above issue but the fonts are not rendered as nicely.
Also, the titles and labels stay parallel with the axis but I need them to be constantly facing the camera.

vtkTextActor3D also stays parallel to the axis, like vtkAxisFollower.
The font quality is better than vtkAxisFollower, but I still prefer that of vtkTextActor.

I considered creating a subclass of vtkAxisFollower with a different transform matrix (so that it will always be facing the camera).
It also uses a vtkTexture/vtkImageData pair for font rendering (so that the font quality is similar to vtkTextActor). This would achieve the three goals I listed above.

However: I am not sure how to incorporate this class within vtkCubeAxesActor (or vtkAxisActor).
The vtkAxisFollower is a private member of vtkAxisActor with no set mutator.

Any suggestions for how to proceed, either with this plan or perhaps a better one I am unaware of?

Many thanks!?

Mande

________________________
Mande Leung | Software Developer
Lumerical Solutions, Inc.
300 - 535 Thurlow Street, Vancouver, Canada
Tel: 1.604.733.9006 Ext. 312
www.lumerical.com<http://www.lumerical.com/>
mleung at lumerical.com<mailto:myemail at lumerical.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150120/66409cc0/attachment.html>


More information about the vtkusers mailing list