[vtkusers] how can I scale a vtkActor2D?
Peter F Bradshaw
pfb at exadios.com
Tue Nov 25 11:15:04 EST 2008
Hi Liang Ma;
Are you calling this->pvtkRenderer->Render() anywhere?
On Mon, 24 Nov 2008, Liang Ma wrote:
> 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) ;
> ///////////////////////////////////////////////////////////////////////////
>
Cheers
--
Peter F Bradshaw: http://www.exadios.com (public keys avaliable there).
Personal site: http://personal.exadios.com
"I love truth, and the way the government still uses it occasionally to
keep us guessing." - Sam Kekovich.
More information about the vtkusers
mailing list