www.hesicong.net wrote on Monday, March 05, 2007 9:14 AM: > Hello, > I load some data from a 3ds file using osgDB::readNodeFile() function, > and store the Node to osg::Node* machineNode. > Then I want to get all the vertex data from this Node. I tried to > convert the point directly to osg::Geometry*, but I get wrong data. > Here is my code: > osg::Node* machineNode=NULL; > machineNode=osgDB::readNodeFile("F:/machine.3DS"); > > osg::Geometry* geo=(osg::Geometry*)machineNode; > osg::Array* ar=geo->getVertexArray(); > int size=ar->getDataSize(); > size variant is a negative number, so I say the data should be wrong. > Please tell me how to get the vertex data from this node, thanks very > much!
osgDB::readNodeFile() returns an osg::Node, but osg::Geometry is not a Node, it is a osg::Drawable. So, at the very least, readNodeFile in this case will return an osg::Geode (which is a Node, and will contain Drawables which might be Geometry), but I don't know any thing about the OSG 3DS reader, so it might return a more complicated structure of Nodes than that. -- Bryan Thrall FlightSafety International [EMAIL PROTECTED] _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/