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

2018-08-09 Thread Werner Modenbach
Hi Mike, I suggest checking the results of "geom" and "coords" before using them. If they are nullptr it will crash your program. - Werner - Am 09.08.2018 um 12:39 schrieb michael kapelko: > Here's how I change texture coordinates: >

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

2018-08-09 Thread michael kapelko
Here's how I change texture coordinates: https://github.com/OGStudio/ogs-mahjong-components/blob/0308cd2ed97b001cf5aecea1b5aada839707c5cf/02.Theme/desktop/src/render.h#L184 Note that the function gets osg::Geode that has already been extracted from osg::Node. Here's a sample class to print whole

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

2018-08-08 Thread Werner Modenbach
Hi Mike, the loaded node isn't just a single node but a treelike structure where your actual geode(s) is/are located somewhere in the structure. What you mean by vertex Id? Each geode contains 1 or more drawables and each drawable contains a vertex array and eventually texCoordArray(s). So you

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

2018-08-08 Thread Mike Blakefiled
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