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 "<