Andrew Cunningham wrote:
I am struggling with the same/similar issue. I want to set the transparency level dynamically ( the user has a slider) of a "group" in my scene. My understanding is that apart from setting the state GL_BLEND etc it is required to traverse/visit all of the nodes of the sub-graph setting the alpha component of each color value encountered to the requested alpha value.
It just seems like such a common requirement I am surprised that there is not a 
NodeVisitor to do this? Or am I missing something here.

I don't think it's really that common. The easy way to do this is to organize your scene so that each object where you want to adjust transparency is contained in it's own subgraph. Then, you just put an osg::Material at the root of that subgraph and vary the Alpha component of that material. If you need to preserve the geometry colors, you can set the Material's color mode to DIFFUSE or AMBIENT_AND_DIFFUSE.

If I remember correctly, the original poster had a specific issue where he couldn't do this, or I would have given him the same advice.

--"J"
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to