<div dir="ltr"><div>Hi Laurens,</div><div><br></div><div>thank you for clarification! My problem was that im using openscenegraph in combination with osgEarth. I figured out how to fix it, so in case other osg and osgEarth users might run into the same issue.<br></div><div><br></div><div>To fix the issue i had to include</div><div><br></div><div>#include <osgEarth/Registry><br></div><div><br></div><div>and after loading the model i had to run the shader generator on the model.<br></div><div><br></div><div><span style=" color:#800080;">osgEarth</span>::<span style=" color:#800080;">Registry</span>::<span style=" color:#00677c;">shaderGenerator</span>().<span style=" color:#00677c;">run</span>(<span style=" color:#c0c0c0;"> </span><span style=" color:#092e64;">model</span><span style=" color:#c0c0c0;"> </span>);</div><div><br></div><div>Now everything works fine.</div><div><br></div><div>Thank you very much for your super quick help @Laurens and @Robert !!!</div><div><br></div><div>Best,</div><div>Tom<br></div><br>Am Mittwoch, 15. Januar 2020 13:00:41 UTC+1 schrieb Voerman, L.:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr">Hi Tom,<div>Your model works with texture for me, in osg 3.4.0 as well as 3.6.5 with the following commands:</div><div>sed -E "s#(f [0-9]+/[0-9]+)/0 ([0-9]+/[0-9]+)/0 ([0-9]+/[0-9]+)/0#\1 \2 \3#" "Data2.obj" > noNormals.obj<br></div><div>osgviewer -O noRotation
noNormals.obj
<br></div><div>Laurens.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 15, 2020 at 12:24 PM 'Tom Pollok' via OpenSceneGraph Users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="iVCiN3qsCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">osg-...@googlegroups.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello Robert,</div><div><br></div><div>to test it with my old osg version, i fixed the obj file such it does not contain any indices to normals anymore, as there are no normals.</div><div>This indeed helped loading the model, but no textures appear at all. Should it load the textures automatically due to the first line in the obj file being mtllib Data.mtl and the use of usemtl material_0 before the faces or do i need to take extra care when loading a textured model?</div><div><br></div><div>For loading, im using only:</div><div><br></div><div><pre lang="cpp"><span lang="cpp"><span>osgDB</span><span>::</span><span>Options</span><span>*</span> <span>opt</span> <span>=</span> <span>new</span> <span>osgDB</span><span>::</span><span>Options</span><span>;</span></span>
<span lang="cpp"><span>opt</span><span>-></span><span>setOptionString</span><span>(</span><span>"<wbr>noRotation"</span><span>);</span></span>
<span lang="cpp"></span>
<span lang="cpp"><span>osg</span><span>::</span><span>ref_ptr</span><span><</span><span>osg</span><span>::</span><span>Node</span><span>></span> <span>node</span> <span>=</span> <span>osgDB</span><span>::</span><span>readNodeFile</span><span>(<wbr>pathToObjFile</span><span>,</span> <span>opt</span><span>);</span></span></pre></div><div><br></div><div>Best,</div><div>Tom<br></div><div><br></div><div><img src="https://groups.google.com/group/osg-users/attach/8ac7a37a25089/Auto%20Generated%20Inline%20Image%201?part=0.1&view=1&authuser=0" alt="" width="320" height="148"></div><br>Am Dienstag, 14. Januar 2020 17:25:27 UTC+1 schrieb Robert Osfield:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Tue, 14 Jan 2020 at 15:26, 'Tom Pollok' via OpenSceneGraph Users <<a rel="nofollow">osg-...@googlegroups.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thank you for the workaround.</div><div><br></div><div>So as far as i understand you only add the texture coordinate and normal, if there exists one with a index greater than 0 and less then the number of normals or texture coordinates.</div><div>So that means that openscenegraph now will be able to display the textured mesh, even if the normals are missing, right?<br></div></div></blockquote><div><br></div><div>Yes, that's correct, you'll get a textured mesh with no normals assigned.</div><div><br></div><div>Robert.<br></div><div> </div></div></div>
</blockquote></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="iVCiN3qsCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">osg-...@<wbr>googlegroups.com</a>.<br>
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/b55a82c5-4801-49da-b1c4-149d868bd6fa%40googlegroups.com?utm_medium=email&utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/msgid/osg-users/b55a82c5-4801-49da-b1c4-149d868bd6fa%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter';return true;" onclick="this.href='https://groups.google.com/d/msgid/osg-users/b55a82c5-4801-49da-b1c4-149d868bd6fa%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter';return true;">https://groups.google.com/d/<wbr>msgid/osg-users/b55a82c5-4801-<wbr>49da-b1c4-149d868bd6fa%<wbr>40googlegroups.com</a>.<br>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="iVCiN3qsCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">osg-...@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Flists.openscenegraph.org%2Flistinfo.cgi%2Fosg-users-openscenegraph.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEhxcobqaKtkSCnaCeBWJ1fFl93mw';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Flists.openscenegraph.org%2Flistinfo.cgi%2Fosg-users-openscenegraph.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEhxcobqaKtkSCnaCeBWJ1fFl93mw';return true;">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
</blockquote></div>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/79d8878f-0123-4a3a-8d70-1e2e3eb9e20c%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/79d8878f-0123-4a3a-8d70-1e2e3eb9e20c%40googlegroups.com</a>.<br />