Joe Doob wrote on 2012-10-01: > This snippet produces a valid drawable, however the drawable returns a > NULL stateset and so I can't obtain the texture object. > > How can I obtain the osg::Image to get RGB in this case? Or, is there a > better method?
The texture for the Drawable must be set in a parent node (the Geode that contains it, or possibly some Node higher in the scene graph). You can use osg::Drawable::getParents() to work your way up the scene graph until you find the StateSet that sets the texture. Note that OSG combines StateSets, so even if you find a StateSet it might not specify the texture; it all depends on how the model is structured. Also, that part of the scene graph could occur multiple times in the scene graph if it is instanced (which is why getParents() returns a list: there could be more than one parent). Hope this helps, -- Bryan Thrall Principal Software Engineer FlightSafety International [email protected] _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

