[osg-users] View Frustrum Culling
vigigio at hotmail.com
Tue Jul 29 03:28:50 PDT 2008
I have just done parts of what you need.
Make yourself a group node which you place as the root of the scene-graph that you need to list objects from.
Override it's traverse function and post process the cull-visitor:
void yourGroupClass::traverse( osg::NodeVisitor& nv )
osg::Group::traverse( nv );
if( nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR )
osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>( &nv );
if( cv )
// Do your stuff here
// You should be able to find what you need inside cv->RenderStage->RenderBinList...
// The cull-traverse is done, so everything that is visible must be stored in the render-bins.
// I am pretty sure you should be able to find some information in these structures which points you to your objects.
Date: Tue, 29 Jul 2008 09:56:59 +0200From: hagen.kaiser at siemens.comTo: osg-users at lists.openscenegraph.orgSubject: [osg-users] View Frustrum Culling
Maybe it sounds basic. I have camera that will never change place. I have a database with one Object/onFile-Mapping. So next time I load my Scene id like to load only relevant Objects to shorten Loading time.
Simple Task: I need to get a list of all VISIBLE Objects in the ViewFrustrum. Can this be done with the cull-Traverser. The docs say it collects all the objects in a special order. Are these objects all objects in the end or only the visible? How can I get the visbile Nodes? What things are to be taken care of?
Windows Live Messenger - også på mobilen.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the osg-users