[vtkusers] How to get current view vector and model view matrix of the scene

Jochen K. jochen.kling at email.de
Tue Jun 19 22:01:07 EDT 2012


Hi Neollie,

the ViewMatrix you can get from the camera object:
 
renWin->GetRenderers()->GetFirstRenderer()->GetActiveCamera()->GetViewTransformMatrix()


Just as an additional information: the projection matrix you can get with
GetProjectionTransformMatrix() and the combination of view and projection
matrix via GetCompositeProjectionTransformMatrix().


Don't know exactly what you mean by view vector, but you may think of the
vector between camera's position and the focal point.

This vector can be retrieved like this:

 
renWin->GetRenderers()->GetFirstRenderer()->GetActiveCamera()->GetDirectionOfProjection()


In case you mean camera's orientation (the pitch, yaw- and roll angle) you
can get this three angles like so:
 
renWin->GetRenderers()->GetFirstRenderer()->GetActiveCamera()->GetOrientation()


Hopefully this information is useful.

with best regards

Jochen


--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-current-view-vector-and-model-view-matrix-of-the-scene-tp5714015p5714018.html
Sent from the VTK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120619/d015a213/attachment.htm>


More information about the vtkusers mailing list