Hi Tomas,

I would not recommend ever trying to make an orthographic view
"behave" like a normal 3D projection, in particular w.r.t zooming in
and out.  This is not an OSG issue but an issue with pretending that
orthographic views can be tweaked to  behave like a 3D view.  You can
mimic it by adjusting the left, right and bottom top values of the
projection matrix but in the end you'll end up with lots of problems
with near and far plane clipping.  The clipping issue is serious and
can't be solved, using orthographic projection in this way is just
plain wrong, its like using a water to hamer in a nail.

Robert.

On 3/21/07, Tomas Hnilica <[EMAIL PROTECTED]> wrote:
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,right,bottom,top,zNear,zFar);

simpleViewer->getCamera()->setProjectionMatrixAsOrtho(left,right,bottom,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