"Zoom" is generally defined as changing the field of view, not scaling or
moving the eye forwards or backwards. To change the field of view in an
orthographic view, you must modify the left, right, top, and bottom values.
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
303 859 9466


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Tomas Hnilica
> Sent: Wednesday, March 21, 2007 6:56 AM
> To: osg users
> Subject: [osg-users] orthographic projection with trackball
> 
> Hello all,
> 
> I am using osgViewer/SimpleViewer with 
> osgGA/TrackballManipulator and when changing to orthographic 
> projection:
> 
>         double left,right,bottom,top,zNear,zFar;
>         
> simpleViewer->getCamera()->getProjectionMatrixAsFrustum(left,r
> ight,botto
> simpleViewer->m,top,zNear,zFar);
>         
> simpleViewer->getCamera()->setProjectionMatrixAsOrtho(left,rig
> ht,bottom,
> simpleViewer->top,zNear,zFar);
> 
> I am  not able to ZOOM the scene (mouse move with right button).
> It's clear that there is something wrong with matrix math. 
> Zoom is done by osg::Matrixd::translate(0.0,0.0,-_distance) 
> multiplication in TrackballManipulator::getInverseMatrix(). 
> When changing to
> osg::Matrixd::scale(-_distance,-_distance,-_distance) the 
> model is zoomed, but in other(wrong) way - I cannot zoom 
> "inside the model" and also lightning is changing by zoom of course.
> 
> Do you have any suggestions?
> 
> Actually I want to make viewer for CAD model - orthographic 
> projection, manipulator with simple pan/zoom/rotate and I am 
> wondering that such manipulator (easier than Trackball or UFO 
> manipulator) is not in OSG.
> 
> Many thanks in advance,
> Tomas
> 
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to