<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Mike,<br>
<br>
I suggest checking the results of "geom" and "coords" before using
them.<br>
If they are nullptr it will crash your program.<br>
<br>
- Werner -<br>
<br>
<div class="moz-cite-prefix">Am 09.08.2018 um 12:39 schrieb michael
kapelko:<br>
</div>
<blockquote type="cite"
cite="mid:CAEt8o9hRf6R_pW8uupEKzBsxd-z9hW2ECnsff6dJp+W2a0U5Qw@mail.gmail.com">
<pre wrap="">Here's how I change texture coordinates:
<a class="moz-txt-link-freetext" href="https://github.com/OGStudio/ogs-mahjong-components/blob/0308cd2ed97b001cf5aecea1b5aada839707c5cf/02.Theme/desktop/src/render.h#L184">https://github.com/OGStudio/ogs-mahjong-components/blob/0308cd2ed97b001cf5aecea1b5aada839707c5cf/02.Theme/desktop/src/render.h#L184</a>
Note that the function gets osg::Geode that has already been extracted
from osg::Node.
Here's a sample class to print whole osg::Node structure (replace
log::logprintf with printf):
<a class="moz-txt-link-freetext" href="https://github.com/OGStudio/openscenegraph-cross-platform-examples/blob/f692fd8b0886dbdba1d4e99087998e87827056db/features/scene/PrintGraphVisitor.cpp">https://github.com/OGStudio/openscenegraph-cross-platform-examples/blob/f692fd8b0886dbdba1d4e99087998e87827056db/features/scene/PrintGraphVisitor.cpp</a>
You need to create this class instance and call
'yourNode.accept(instance);' to have the structure printed.
On Wed, 8 Aug 2018 at 15:43, Werner Modenbach
<a class="moz-txt-link-rfc2396E" href="mailto:Werner.Modenbach@texion.eu"><Werner.Modenbach@texion.eu></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">
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 have to identify the geode your vertex is in. Then you can try to
dynamic_cast. Anyway you need to check if your cast returned 0.
The next problem is the osg::Array. I didn't find a solution for that so
far. If you kno
Am 06.08.2018 um 16:27 schrieb Mike Blakefiled:
</pre>
<blockquote type="cite">
<pre wrap="">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:
<a class="moz-txt-link-freetext" href="http://forum.openscenegraph.org/viewtopic.php?p=74473#74473">http://forum.openscenegraph.org/viewtopic.php?p=74473#74473</a>
_______________________________________________
osg-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
</blockquote>
<pre wrap="">
_______________________________________________
osg-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
</blockquote>
<pre wrap="">_______________________________________________
osg-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<b>TE<span style="color:red;">X</span>ION Software Solutions,
Rotter Bruch 26a, D-52068 Aachen</b><br>
Phone: +49 241 475757-0<br>
Fax: +49 241 475757-29<br>
Web: <a class="moz-txt-link-freetext" href="http://texion.eu">http://texion.eu</a><br>
eMail: <a class="moz-txt-link-abbreviated" href="mailto:info@texion.eu">info@texion.eu</a><br>
</div>
</body>
</html>