Hi Dirk,
> > is it easy (if so, how?) to query for object
> > frustum culling in OpenSG? I would like to
> > know if a node is within my view frustum or
> > not. Are there already some convenience functions
> > in OpenSG?
>
> There are no convenience functions, but the regular way is pretty
> convenient already. ;)
aaaaahhh.... !
> // Get the viewing frustum from the camera
> FrustumVolume frust;
> mgr->getCamera()->getFrustum(frust, *mgr->getWindow()->getPort(0));
>
> // Get the world-space volume from the node
> DynamicVolume vol;
> testobject->getWorldVolume( vol );
>
> // Test
> if ( frust.intersect( vol ) )
> {
> std::cout << "testobject is visible" << std::endl;
> }
> else
> {
> std::cout << "testobject is not visible" << std::endl;
> }
That's exactly what I was looking for, and it works allright!
> Note that the test is conservative: if it tells you invisible it
> definitely is, if it tells you visible it might not be.
Yep, ok, guess it does not consider occlusion by other objects,
it's sufficient for me to know whether it's within the frustum
or not.
Thank you for your fast reply,
Toni
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users