[osg-users] Load an obj file and mapping a given vertex to its Texture coordinates

Mike Blakefiled pabarezo at hurify1.com
Mon Aug 6 07:27:39 PDT 2018


Hi everyone, I'm new here.

I load an obj file with osgDB::readNodeFile("my.obj") and add it to my scene.
now, given a vertex Id, I'd like to be able to get its UV/Texture coordinate.

I can see that osg::Geometry has a getTexCoordArray() method, but dynamically casting my node to org::Geometry crashes the program. 
moreover, according to the docs,  getTexCoordArray() simply returns a pointer to osg::Array, and it's unclear what type the elements of that array is (osg::Vec2?)
... 

Thank you!

Cheers,
mike

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74473#74473







More information about the osg-users mailing list