[vtkusers] vtkFollower as part of a vtkAssembly

Will Schroeder will.schroeder at kitware.com
Sat Sep 8 08:39:59 EDT 2001


Hi Ron-

Here are a couple of ideas:
+ if you are using vector text, plus an arrow, you can use 
vtkAppendPolyDataFilter to make them a single polydata. Then use the follower.
+ To use "raster text", use the classes vtkTextMapper and vtkActor2D.
+ If you want to try something tricky but powerful, look into the class 
vtkCoordinate. With this class, you can position the vtkActor2D at a 
different point in a particular coordinate system; for example, you could 
put the vtkActor2D/text at world point (x,y,z), and then as the camera 
moves, the location of the text on the screen automatically moves with it.

Good luck,
Will

At 02:18 PM 9/8/2001 +0200, Ron Inbar wrote:
>Hi all,
>
>In my application I want to place a labeled arrow in a dynamic scene.  The 
>label is a vtkFollower with a vtkVectorText as its source.  The arrow has 
>to be transformed according to some vtkTransform.  My problem is how to 
>correctly place the label without losing vtkFollower functionality.  I 
>tried two approaches; both failed:
>1. Uniting the arrow with the label as a vtkAssembly.  This approach 
>disabled the vtkFollower functionality (the label no longer turned to face 
>the camera).
>2. Transforming the label separately, using vtkProp::SetUserTransform with 
>the same vtkTransform as for the arrow.  In this case the vtkTranform was 
>concatenated with the transformation that was supposed to make the label 
>face the camera, but they were concatenated in the wrong order, sending 
>the label to some far-off location.
>I thought of a third approach, but I don't know how to implement 
>it.  Instead of using vector text, use raster text.  This eliminates the 
>need for a vtkFollower altogether.  I know under OpenGL it's a piece of 
>cake (using glRasterPos), but I don't know how to do it from VTK.
>
>If you know the solution, please tell me ASAP, because I have a very 
>pressing deadline (Sunday evening, GMT, to be precise).
>
>Many thanks in advance,
>
>Ron
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list