Enrico Villani wrote on Friday, November 16, 2007 4:38 AM: > Hello, I have a osg::Node* that has applied a osg::StateSet* with > many Attribute, in particular an osg::Material*. When I try to > switch the stateset to another, no changes are visible. > > I tried with > > node->setStateSet(TheOtherStateSet); > > and > > osg::stateSet* tmp = node.getOrCreateStateSet(); > tmp = TheOtherStateSet; > > > but it doesn't work correctly. > > Thank you Davide
Are you using display lists? Your first try should work to change the state, but you won't see the effects unless you dirty the display list; simply find all the Drawables under the node and call dirtyDisplayList(), which will recompile the display list with the new state. If you are changing state more than once-in-a-while, you may want to disable display lists instead (see Drawable::setUseDisplayList()); recompiling them all the time will slow things down (and is wasteful anyway). -- Bryan Thrall FlightSafety International [EMAIL PROTECTED] _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

