Hi All,

 

In my MFC application I create an osgUtilSceneView (shown below) and
attach a simple scene graph with a Switch node as the root. Initially
all the children of the Switch node are set off. When I execute the
program, I get the following message displayed every frame until I
enable the Switch. The scene displays correctly.

 

_clampProjectionMatrix not applied, invalid depth range, znear =
3.40282e+038 zfar = -3.40282e+038

 

If I add the line 'm_SceneView -> setComputeNearFarMode(
osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR ) ;' the error message
dissappears but some parts of the scene are missing (e.g. Those bits of
the scene that lie outside the clip range 0.0 to -1.0).

 

Can anyone explain this behaviour?

How so I set the osgUtil::SceneView's near and far clip plane values and
prevent them from being auto-calculated for me?

 

Regards,

Andy.

 

----- Code section ----

 

osg::Matrix projection ;

projection.makeOrtho( -0.5, 0.5, -0.5, 0.5, -1.0, 1.0 ) ;

 

// create the view of the scene.

m_SceneView = new osgUtil::SceneView;

m_SceneView -> setDefaults();

m_SceneView -> setClearColor( clearColor ) ;

m_SceneView -> setProjectionMatrix( projection ) ;

m_SceneView -> setViewport( 0, 0, m_RenderSurface -> getWindowWidth(),
m_RenderSurface -> getWindowHeight() );

 

// All switches set off initially

// All geometry is simple textured Quads that cover the entire screen.

root -> addChild( noiseSwitch ) ;

root -> addChild( gridSwitch ) ;

root -> addChild( wedgeSwitch ) ;

root -> addChild( imageSwitch ) ;

root -> addChild( barSwitch ) ;

root -> addChild( colBarSwitch ) ;

 

////////////////////////////////////////////////////////////////////////
////

// Root switch to allow a switch between tracking and non tracking
rendering.

captureSwitch = new osg::Switch ;

 

captureSwitch -> addChild( root ) ;

m_SceneView -> setSceneData( captureSwitch );

captureSwitch -> setValue( 0, false ) ;

 

 


________________________________________________________________________
This e-mail has been scanned for all viruses by Star.The service is powered by 
MessageLabs. 
________________________________________________________________________
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to