[vtkusers] vtkTextActor's

Randall Hand randall.hand at gmail.com
Fri Dec 29 10:12:30 EST 2006


Ok, with the Mesa thing out of the way I'm back to the other question.. how
do I get vtkTextActor's to work?

I'm using code like the following:

        vtkTextActor *textActor = vtkTextActor::New();
        textActor->SetInput(scene->title);
        textActor->ScaledTextOn();
        textActor->SetMinimumSize(15,15);
        textActor->SetMaximumLineHeight(0.1);
        textActor->SetDisplayPosition((scene->output_width * 0.25),
                                      (scene->output_height * 0.5));
        textActor->GetPosition2Coordinate()
                    ->SetCoordinateSystemToNormalizedViewport();
        textActor->GetPosition2Coordinate()->SetValue(0.1, 0.6);
        textActor->GetTextProperty()->SetFontFamilyToArial();
        textActor->GetTextProperty()->ShadowOn();
        textActor->GetTextProperty()->BoldOn();
        textActor->GetTextProperty()->SetJustificationToCentered();
        textActor->GetTextProperty()->SetVerticalJustificationToTop();
        textActor->GetTextProperty()->SetColor(scene->fontColor);

        ren1->AddActor2D(textActor);

And while I've verified that the code does in fact run just fine, I see no
text on my display.  I've tried adjusting colors and adjusting the
DisplayPosition & Position2Coordinate to no avail.  This code used to work
back in the 4.4 days, with the addition of the vtkTextMapper which used to
be required, but I haven't had any luck with the 5.0 versions of it.
-- 
----------------------------------------
Randall Hand
Visualization Scientist
ERDC MSRC-ITL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061229/c01122a3/attachment.htm>


More information about the vtkusers mailing list