Hi,

Sorry for noob question, but I need to make an object totally transparent (as 
invisible) but I have to maintain your "presence" in the world (the object 
can't be masked). This means that the object isn't visible but all collisions 
and others interactions in the world have to work.

I can make the transparency using code like this, but the object isn't never 
really "invisible":


Code:
    
osg::Material* l_material = 
(osg::Material*)p_Object->getStateSet()>getAttribute(osg::StateAttribute::MATERIAL);
l_material->setTransparency(p_face_mode, 1-p_transparency);
p_Object->getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON);
p_Object->getOrCreateStateSet()->setAttributeAndModes(l_material, 
osg::StateAttribute::OVERRIDE);




Where p_face_mode is FRONT_AND_BACK for example.

Thank you!

Cheers,
Dario
Code:




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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to