[osg-users] picking/selecting invisible objects

Michele Bosi michele.bosi at gmail.com
Mon Oct 15 02:38:26 PDT 2007


Ciao Alessandro,
I did something very similar to what you are saying activating
backface culling for both front and back faces this way the overhead
on the graphic card should be minimal, even less than activating the
alpha blending to zero:

osg::CullFace* cull= new osg::CullFace(osg::CullFace::FRONT_AND_BACK);

osg::Group* group = new osg::Group;

group ->getOrCreateStateSet()->setAttribute(cull,
osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);

group ->getOrCreateStateSet()->setMode( GL_CULL_FACE,
osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON );

This works fine for me using the standard
osgViewer::Viewer::computeIntersections(...)

Ciao,
Michele



More information about the osg-users mailing list