[vtkusers] How can I reset the carmera

David Doria daviddoria at gmail.com
Mon Dec 12 07:31:00 EST 2011


2011/12/12 455535440 <455535440 at qq.com>:
> hello everyone:
>   I got an actor rendered on the vtkRenderer, Then I use the Interactor move
> and rotate the actor, but after that I want to make the actor undo all the
> action so that the actor should look like it first display.
>   I call the method vtkRenderer::ResetCamera ,The camera  reposition itself
> to view the center point of the actors,but actually it just undo the
> "move",the actor didn't rotate, anyone can help me reset the carmera to the
> original place?
> thx~~~

You could use vtkCamera * vtkRenderer::GetActiveCamera () before the
interaction to get the camera and then SetActiveCamera(vtkCamera*) to
set it back when you want to reset. You could also get the matrix of
the camera (GetModelTransformMatrix) and then set the matrix of the
camera when you want to reset (SetModelTransformMatrix (vtkMatrix4x4
*matrix)).

(Actually I'm not sure the difference between the
vtkCamera::Get*Matrix functions - the documentation should be improved
here).

David



More information about the vtkusers mailing list