[vtkusers] how can I scale a vtkActor2D?

Liang Ma leo at esit.com
Mon Nov 24 16:43:23 EST 2008


Hi all,

I tried to scale a 2D actor but it doesn't work. I tried GetPosition2Coordinate() function but it doesn't work.  Also I tried to zoom the camera. It does not work either.

Whould you give me some advices? Thanks.

Regards

Liang Ma

Here is the code:

  vtkActor2D   *pvtkActor;
           ..........................
 this->pvtkActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
 this->pvtkActor->GetPositionCoordinate()->SetValue(0.5, 0.5);  //  works, could move the actor to the center
 this->pvtkActor->GetPosition2Coordinate()->SetValue(0.9, 0.9); // does not work, no effect
 this->pvtkActor->GetProperty()->SetColor(1, 0, 0);

the code for zoom:

////////////////////////////////////////////////////////////////////////
        this->pvtkCamera = this->pvtkRenderer->GetActiveCamera ();
        this->pvtkCamera->Zoom(5);    //     zoom doesn't work
        this->pvtkRenderer->SetActiveCamera (this->pvtkCamera) ;
///////////////////////////////////////////////////////////////////////////
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081124/bd38257e/attachment.htm>


More information about the vtkusers mailing list