Hi Kaiser,
 
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.
        }
    }
}Cheers,
Viggo
 



Date: Tue, 29 Jul 2008 09:56:59 +0200From: [EMAIL PROTECTED]: [EMAIL 
PROTECTED]: [osg-users] View Frustrum Culling

Hello everyone, 
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? 
Greetings? 
_________________________________________________________________
Windows Live Messenger - også på mobilen.
http://windowslivemobile.msn.com/Homepage.aspx?lang=nb-no&ocid=30032
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to