[vtkusers] synchronize model view transformations between opengl and vtk windows

Jana Sefcikova neollie at gmail.com
Tue Aug 7 18:00:51 EDT 2012


Hi Dan,
all matrices can be found in vtkCamera (vtkCamera ::GetModelViewMatrix;
vtkCamera::GetProjectionTransformMatrix). Also vtkOpenGLCamera::Render()
method could serve as good starting point, because also viewport is
preseted there.

For direction VTK -> Opengl , this could be inspiration
http://vtk.1045678.n5.nabble.com/How-to-forward-mouse-move-event-to-polydata-algorithm-and-get-there-direction-of-projection-td5714021.html#a5714029
.
In vtkCameraObserver there, you can implement code that update your OpenGL
state (instead of mine case, where I wanted update vtk algorithm) .

For oposite direction this thread could be inspiration
http://vtk.1045678.n5.nabble.com/Question-on-manual-configuration-of-VTK-camera-td5059478.html
.
There is no direct method to set model view matrix, it is necessary use
vtkCamera methods to preset camera (at least as I know )

Also I think that if you preset both contexts to same initial composition
(modelview matrix or perhaps only view matrix), than you could use only
vtkCamera::SetUserTransform and vtkCamera::GetUserTransform (for model
matrix) for synchronization.
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120808/0cb715f1/attachment.htm>


More information about the vtkusers mailing list