Hi Eduardo,

I think the function the original poster is looking for is, e.g.: bool
DriveManipulator::calcMovement().

Well, that method and the equivalents in other manipulators do calculate some parts of the final camera view matrix, but the final calculations are done directly inside the get{Inverse}Matrix() methods. And I think the OP was specifically asking how the manipulator affected the camera, since no part of the camera manipulator code actually ever touches any part of the view or camera...

So the answer is that the view calls getInverseMatrix() at each frame to get an updated view matrix which it will then give to the camera.

That also has another implication. If you're making a camera manipulator that needs to modify the projection matrix, then you need to put in some other mechanism in your own code to get the projection matrix that the manipulator would calculate to the camera. Because the only thing that will happen automatically when using a camera manipulator is that getInverseMatrix() will be called to get an updated view matrix each frame, nothing will be done about the projection matrix at all. I've always found that weird... A more general camera manipulator should have a mechanism to alter any relevant property of the camera, not just the view matrix... It could even have a pointer to the camera, which IMHO would have been a more straightforward and clear design, at the cost of higher coupling.

One example of this would be implementing a camera manipulator for otho2D views which would implement zooming by altering the left,right,top,bottom values of the frustum (or even the same principle for perspective views which would zoom by altering the FOV). This alters the projection matrix, and you'll have to get that projection matrix from your manipulator to the camera each frame yourself.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to