[osg-users] Detecting if a node is within viewfrustum

Suraj Paul osgforum at tevs.eu
Sun Aug 28 01:08:42 PDT 2016


Hi Julien,

Thanx for reply. I would be better if there is a simpler way out. 
 
If i could just detect when a given node is not inside the viewfrustum, then i could adjust the camera view matrix, something like:-


osgGA::OrbitManipulator* orbit = dynamic_cast<osgGA::OrbitManipulator*>( view->
            getCameraManipulator() );
            if ( orbit)
        
            {
               
                osg::Matrix matrix = computeTargetToWorldMatrix(
                _target.get() );
                osg::Vec3d targetCenter = _target->getBound().center() *matrix;
                orbit->setCenter( targetCenter );


}

But i am not able to detect when does the "_target" node moves out of scene!
... 

Thank you!

Cheers,
Suraj

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68468#68468








More information about the osg-users mailing list