Hi everyone,

The setProjectionMatrixAsOrtho2D-function is not really clear to me.
I have tried a lot of different variables to give to this funtion.

But they all result in a sceen with a blue background. Not even a small part of 
the object I am trying to see.

What I have is a 3D-model (like cow.osg of cessna.osg) and I want a side view 
in Ortho 2D.

Can anyone help me with calculating suitable values?

I found and tried the example below, but no luck... :( 


Code:

osg::ref_ptr<osg::Node> node;
Viewer->setSceneData(node);

osg::BoundingBox bb;
bb.expandBy(node->getBound());

double xMid = (bb.xMin() + bb.xMax())/2;
double yMid = (bb.yMin() + bb.yMax())/2;
double zMid = (bb.zMin() + bb.zMax())/2;
double radius = bb.radius();
        
Viewer->getCamera()->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
        
Viewer->getCamera()->setProjectionMatrixAsOrtho(bb.xMin(),bb.xMax(),bb.yMin(),bb.yMax(),1,100+abs(bb.zMax()
 - bb.zMin()));
        
        Viewer->setUpViewInWindow(x, y, width, height);




Thank you!

Cheers,
Marco

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=59637#59637





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

Reply via email to