Dear All,
 I would like to turn a Drawable object into a Geometry counterpart in order to 
retrieve its texture coordinates. 
 I have tried to use both the asGeometry method of the Drawable class and the 
dynamic cast operator but both attempts ended up delivering a NULL pointer. I 
am not sure if there is another way of doing it. 
Here is a code snippet.
osg::Geode myGeode = new osg::Geode;
 myGeode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(),1,1,1)));
osg::Drawable* myDrawable = myGeode->getDrawable(0);
osg::Geometry* myGeom = myDrawable->asGeometry(); //This returns NULL!
osg::Geometry*  myGeom2 = dynamic_cast<osg::Geometry *>(myDrawable);
Unfortunately both  myGeom and myGeom3 are both NULL at this point. 
 What to do then, anyone to save me from embarrasment?
 Anxiously waiting for your reply.
 Franclin.
       
---------------------------------
 Envoyé avec Yahoo! Mail.
Une boite mail plus intelligente. 
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to