Re: Correctly apply camera matrix
andyjk <[email protected]> Mon, 8 Apr 2019 03:07:03 -0700 (MST)
| Newsgroups | gmane.comp.lib.vtk.user |
|---|---|
| Message-ID | <[email protected]> |
Hi I would like to do something similar to the above - ie save the view of the camera (based on user manipulation) then be able to re-apply the 4x4 extrinsic camera matrix elsewhere. I know that I can save the View Up, ViewPlaneNormal, Position etc and that these correctly represent the current camera position. However, how can I then transform these into an R|T camera matrix, such that R|T [wx wy wz] brings the world coordinates (wx,wy,wz) into the camera coordinate frame ? It certainly seems that vtkCamera->GetModelTransformMatrix() is bugged and doesn't work, because the upper 3x3 is not orthogonal and so is not a rotation matrix. I could set up columns 2 and 3 of the R|T matrix using ViewUp and ViewPlaneNormal, but if I just calculate the cross-product for filling in column 1, I presumably risk 'x' facing the wrong way ? Also, I am fairly sure that T of R|T is not simply vtkCamera->GetPosition() (as it is the inverse transform?) so I'm not sure how to populate column 4 of R|T. Am I misunderstanding vtkCamera->GetModelTransformMatrix() ? I was hoping this is what it is for ? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://vtk.org/mailman/listinfo/vtkusers