<div dir="ltr">Hi Laurens,<div><br></div><div>The answer is so great. I am getting the texture applied. But it is in the osgviewer.exe only. </div><div>Problematically I tried to add the option. Its not working.<div class="prettyprint" style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: break-word;"><code class="prettyprint"><div class="subprettyprint"><pre><span style=" color:#800080;"><span style="color: #000;" class="styled-by-prettify">osgDB</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style=" color:#800080;"><span style="color: #606;" class="styled-by-prettify">Options</span></span><span style="color: #660;" class="styled-by-prettify">*</span><span style=" color:#c0c0c0;"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: #000;" class="styled-by-prettify">opt</span><span style=" color:#c0c0c0;"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: #660;" class="styled-by-prettify">=</span><span style=" color:#c0c0c0;"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style=" color:#808000;"><span style="color: #008;" class="styled-by-prettify">new</span></span><span style=" color:#c0c0c0;"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style=" color:#800080;"><span style="color: #000;" class="styled-by-prettify">osgDB</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style=" color:#800080;"><span style="color: #606;" class="styled-by-prettify">Options</span></span><span style="color: #660;" class="styled-by-prettify">;</span></pre><span style="color: #000;" class="styled-by-prettify"><br></span><pre><span style="color: #000;" class="styled-by-prettify">opt</span><span style="color: #660;" class="styled-by-prettify">-></span><span style="color: #000;" class="styled-by-prettify">setOptionString</span><span style="color: #660;" class="styled-by-prettify">(</span><span style=" color:#008000;"><span style="color: #080;" class="styled-by-prettify">"DIFFUSE=0"</span></span><span style="color: #660;" class="styled-by-prettify">);</span></pre><span style="color: #000;" class="styled-by-prettify"><br></span><pre><span style=" color:#800080;"><span style="color: #000;" class="styled-by-prettify">osg</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style=" color:#800080;"><span style="color: #000;" class="styled-by-prettify">ref_ptr</span></span><span style="color: #660;" class="styled-by-prettify"><</span><span style=" color:#800080;"><span style="color: #000;" class="styled-by-prettify">osg</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style=" color:#800080;"><span style="color: #606;" class="styled-by-prettify">Node</span></span><span style="color: #660;" class="styled-by-prettify">></span><span style=" color:#c0c0c0;"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: #000;" class="styled-by-prettify">model1</span><span style="color: #660;" class="styled-by-prettify">=</span><span style=" color:#c0c0c0;"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style=" color:#800080;"><span style="color: #000;" class="styled-by-prettify">osgDB</span></span><span style="color: #660;" class="styled-by-prettify">::</span><span style="color: #000;" class="styled-by-prettify">readNodeFile</span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: #000;" class="styled-by-prettify">path</span><span style="color: #660;" class="styled-by-prettify">.</span><span style="color: #000;" class="styled-by-prettify">toStdString</span><span style="color: #660;" class="styled-by-prettify">(),</span><span style=" color:#c0c0c0;"><span style="color: #000;" class="styled-by-prettify"> </span></span><span style="color: #000;" class="styled-by-prettify">opt</span><span style="color: #660;" class="styled-by-prettify">);</span></pre></div></code></div><br><br><br>On Tuesday, January 14, 2020 at 6:39:07 PM UTC+5:30, L. Voerman wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr"><div><div>repost in google group; It seems like my reply to the mailing list does not show up in google groups.</div><div><br></div></div><div><br></div><div>Hi Jiljith,</div><div><br></div><div>The material has both an ambient and a diffuse texture (both refer to the same file)</div><div>while this can be made to work with a shader, using the fixed function pipeline means you'll have to choose one:</div><div><br></div>osgviewer -O DIFFUSE=0 12228_Dog_v1_L2.obj<br><div>Laurens.</div></div><br>On Tuesday, January 14, 2020 at 10:52:54 AM UTC+1, JILJITH JOHN wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="text-align:center;clear:both"><br></p>Hi,<div><br></div><div>I am developing a tool for editing 3D models using openscenegraph. When I tried to load an .obj file, the texture is not applied. I am getting only black shade.</div><div>The model is imported using the below code. </div><div style="background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px"><code><div><span style="color:#000"><br><br> osg</span><span style="color:#660">::</span><span style="color:#000">ref_ptr</span><span style="color:#660"><</span><span style="color:#000">osg</span><span style="color:#660">::</span><span style="color:#606">Node</span><span style="color:#660">></span><span style="color:#000"> model1</span><span style="color:#660">=</span><span style="color:#000"> osgDB</span><span style="color:#660">::</span><span style="color:#000">readNodeFile</span><span style="color:#660">(</span><span style="color:#000">path</span><span style="color:#660">.</span><span style="color:#000">toStd<wbr>String</span><span style="color:#660">());</span><span style="color:#000"><br> model1</span><span style="color:#660">-></span><span style="color:#000">setDataVariance</span><span style="color:#660">(</span><span style="color:#000">osg</span><span style="color:#660">::</span><span style="color:#606"><wbr>Object</span><span style="color:#660">::</span><span style="color:#000">DYNAMIC</span><span style="color:#660">);</span><span style="color:#000"><br></span></div></code></div><div><pre><br></pre>
<pre><br></pre></div></div></blockquote></blockquote></div></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/424783f2-415d-4351-8bf7-83bc25d30936%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/424783f2-415d-4351-8bf7-83bc25d30936%40googlegroups.com</a>.<br />