Thank you Paul. That does help me out a lot. I have one follow-up question, however. It is not clear to me how to fashion a manipulator so that it automatically modifies the projection matrix. I noticed that osgViewer::Viewer will automatically ask its camera manipulator for the model view matrix when appropriate (via the osgGA::MatrixManipulator::get*Matrix() functions). There doesn't seem to be a similar API for those two classes to pass information about the projection matrix, however. Do you have any advice as to how I should handle this?

Thank you so much!

Rob



*Paul Martz* pmartz at skew-matrix.com <mailto:osg-users%40lists.openscenegraph.org?Subject=Re%3A%20%5Bosg-users%5D%20TrackballManipulator%20Question&In-Reply-To=%3C0EB1FC78DFF641B88B4D49BBD70D473E%40Supreme%3E>
/Mon Oct 27 19:26:21 PDT 2008/

   * Previous message: [osg-users] TrackballManipulator Question
     <017960.html>
   * *Messages sorted by:* [ date ] <date.html#17961> [ thread ]
     <thread.html#17961> [ subject ] <subject.html#17961> [ author ]
     <author.html#17961>

------------------------------------------------------------------------

The TrackballManipulator does not support a zoom function. Rather, the right
mouse button pans the Camera along the view direction vector. This is a
different effect from zoom, which is a change to the field of view without
changing the Camera position. With an orthographic Projection matrix, moving
the Camera along the view direction vector obviously has no visual effect;
the Camera does not have a distance in an orthographic Projection.

So the short answer is that the TrackballManipulator doesn't support the
zoom function that you require.

Your options? Create a new Manipulator that supports zoom by changing the
field of view. To do this correctly, you need to support both changing the
field of view in a perspective Projection matrix, as well as changing the
left/right/bottom/top values for an orthographic Projection.

Hope that helps,
  -Paul



Rob Radtke wrote:
Hello Everyone,
I'm trying to use a TrackballManipulator in conjunction with an orthographic camera (i.e., I'm using osg::Camera::setProjectionMatrixAsOrtho()). The problem is that model scaling (with right mouse button) does not work. This is because TrackballManipulator achieves a scaling effect by changing the distance between the camera and the model. Unfortunately, this doesn't have the desired effect when using an orthographic camera. The model does not change size at all in the display window. Then, when I zoom far enough, I start to see parts disappear due to clipping issues.

Is there a way for me to use TrackballManipulator (with an ortho camera) more effectively such that I don't see this behavior? If not, is there another built-in manipulator that would work better for my purposes? If not, what are your other recommendations?

Thank you very much!
Rob

PS - I'm using OSG v 2.2 but, from a code inspection, (I think) I've determined that the behavior is the same in version 2.6.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to