From aa0d5fc52efe3bc93cdc4d06e02d86b29abac7cd Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 7 May 2003 09:35:43 +0000 Subject: [PATCH] Changed the CullVisitor::popProjection() so that it doesn't adjust orthorgraphic projection matrices. --- examples/osghud/osghud.cpp | 10 --------- src/osgUtil/CullVisitor.cpp | 42 +++++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/examples/osghud/osghud.cpp b/examples/osghud/osghud.cpp index f6683ab1c..c0c548fe6 100644 --- a/examples/osghud/osghud.cpp +++ b/examples/osghud/osghud.cpp @@ -208,16 +208,6 @@ int main( int argc, char **argv ) // create the windows and run the threads. viewer.realize(); - // set all the sceneview's up so that their left and right add cull masks are set up. - for(osgProducer::OsgCameraGroup::SceneHandlerList::iterator itr=viewer.getSceneHandlerList().begin(); - itr!=viewer.getSceneHandlerList().end(); - ++itr) - { - osgUtil::SceneView* sceneview = itr->get(); - sceneview->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR); - } - - while( !viewer.done() ) { // wait for all cull and draw threads to complete. diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index 5f2e5a48a..ca12efa34 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -177,26 +177,36 @@ void CullVisitor::popProjectionMatrix() // so it doesn't cull them out. osg::Matrix& projection = *_projectionStack.back(); - double desired_znear = _computed_znear*0.98f; - double desired_zfar = _computed_zfar*1.02f; + if (projection(0,3)==0.0f && projection(1,3)==0.0f && projection(2,3)==0.0f) + { + //cout << "Orthographic projection "<