[vtkusers] 3D Text with accents and other caracters.

Christophe Franco cfranco at amsatec.fr
Thu Oct 9 04:40:36 EDT 2003


Kai Ludwig wrote:

> Am Donnerstag, 9. Oktober 2003 09:46 schrieb Christophe Franco:
> 
>>Is there any other way to display text on a 3D view ? I don't really
>>need 3D models of the caracters, as I said I want them to be always in
>>front of the user, so 2D is enough. But I want to be able to put them at
>>any X, Y, Z coordinate.

> Another way is to use vtkTextMapper with a vtkActor2D .The
> you can specify the coordinate sytem through
> 
> vtkCoordinate* coord = _actor->GetPositionCoordinate();
> coord->SetCoordinateSystemToWorld();
> coord->SetValue( _x, _y, _z );


Thank you for this advise, it works well. Except for a detail...


The color of the text always stays black. With the other method, with 
the vtkVectorText, I used this :

(textActor->GetProperty())->SetColor(R, G, B);

And I could have text on any color I want. Now, the same think applied 
to the vtkActor2D (I also tried vtkScaledTextActor) does not work.

...
...
...
...
...
...

In fact, I just found the answer : it seems the SetColor(R, G, B) does 
not behave the same way in 2D and 3D actors ! In 3D, SetColor(0, 0, 255) 
  corresponds to blue. In 2D, it is SetColor(0, 0, 1). What a trap...




More information about the vtkusers mailing list