[vtkusers] Text orientation

David Gobbi dgobbi at irus.rri.on.ca
Mon Mar 12 17:09:44 EST 2001

Hi Nicolas,

There are questions that you might be asking, so I'll answer them

First, I don't think this is what you mean, but to write
vertical text like
you can just put a "\n" after each letter, e.g.
  text = vtkVectorText()

In order to take a piece of horizontal text and rotate it to any
orientation (I'm guessing that this is what you want to do) you
can use vtkTransformPolyDataFilter

  text = vtkVectorText()
  transform = vtkTransform()
  transform.Translate(x,y,z) # set coords for text
  transform.RotateX(90.0)    # change orientation
  transform.Scale(10,10,10)  # apply whatever scale you want to use
  transformFilter = vtkTransformPolyDataFilter()

You can also do the translation/rotation/scaling to the vtkActor 
instead of to the data.  Also, it can be useful to use vtkFollower
in place of vtkActor if you always want the text to face the

 - David

  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Mon, 12 Mar 2001, Nicolas Mangon wrote:

> Hello,
> What I mean is by Is it possible to change the
> orientation of 2D text annotations instead of being
> always horizontal, is can we rotate the text along any
> axis, not only vertical.
> Thanks

More information about the vtkusers mailing list