Hi guys,
I see a strange problem when I load OBJ files.  I use osg::readfilenode() to
load an .obj with a known number of vertices, and then inspect the resulting
node to see how many vertices was loaded, like so:

    //debug
    osg::Node* node = osgDB::readNodeFile(
"C:/Data/Meshes/Hand3DIS/Hand3.obj" );
    osg::Geode* g = dynamic_cast< osg::Geode*> (
node->asGroup()->getChild(0) );
    osg::Geometry * gm = g->getDrawable(0)->asGeometry();
    osg::Vec3Array * v = (osg::Vec3Array*) gm->getVertexArray();
    std::cout << "verts: " << v->size() << std::endl;

I know my model has 7570 vertices (I inspected the contents of the file, and
this is also reported by other obj loaders I tried).  but when osg loads
this file, it reports 'verts: 8369' in the code above.  I need a one to one
mapping between osg's vertices and the ones specified in the obj file.  Does
osg somehow try to automatically optimise the geometry when it is loaded,
i.e create triangle strips, etc.

Funny thing though, when I subsequently save the node to .obj using osg, it
saves it with the correct no of vertices.

Any ideas?

Thanks,
Morne
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to