You can control colour either via glColor/glColorArray calls associated with Drawables or via osg::Material's attached to StateSet's. osg::Material wraps up glMaterial related functions, including whether OpenGL should use glColor values to override colours from the glMaterial settings. See docs on OpenGL's glMaterial for further info on this. The upshot for you is that an osg::Material will probably be sufficient - its can't override the glColor though.
Robert.
On 9/24/06, Willy P <[EMAIL PROTECTED]> wrote:
Hey,
Is there a way to set a primitive's color using osg::StateSets? Say I have an osg::Box inside an osg::ShapeDrawable. I know I can manually set the osg::ShapeDrawable's color using the setColor( ... ) function. But how would I do it using StateSets? What subclass of osg::StateAttribute would I use in the StateSet? I've done the tutorials involving statesets and textures but they don't explain how to do this.
-Willy
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
