<div dir="ltr"><div><div><div><br>Are display lists active in your scene? if so, maybe a dirtyDisplayList() call might be required</div><div>on the affected drawables.<br></div><br></div><div>drawable->dirtyDisplayList()<br><div><br></div>As far as I know display lists are still the default in OSG, unless you explicitly disable them on<br></div>geometry objects (and possibly enable vertex buffer objects instead, for performance reasons)<br><br></div>the corresponding API calls on drawables would be<div><div><div><br></div><div>drawable->setUseDisplayList( false )<br></div><div><span class="gmail-st">drawable->setUseVertexBufferObjects( true )</span></div><div><br></div><div>you could use a visitor right after loading the scene to switch off display lists and enabling</div><div>vertex buffer objects instead.</div><div><br></div><div>Christian</div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-01-09 14:58 GMT+01:00 Werner Modenbach <span dir="ltr"><<a href="mailto:Werner.Modenbach@texion.eu" target="_blank">Werner.Modenbach@texion.eu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
Hi all,<br>
<br>
I'm loading 3ds scenes as subnodes into my scene. The 3ds
coordinates are in a different scale than my scene.<br>
Usually I would solve this by a transform. But because of internal
reasons I need the vertices being <br>
in MY coordinate measure.<br>
So I wrote a scaling visitor, that multiplies al vertices of
geometries by a given factor.<br>
That works perfectly fine when loading the 3ds scene:<br>
<span style="color:#c0c0c0"> </span><i>
osg::ref_ptr<osg::Node</i><i>></i><i> </i><i>node</i><i> </i><i>=</i><i>
</i><i>osgDB</i><i>::readRefNodeFile(</i><i>path</i><i>);
</i><i><br>
</i><i> </i><i> ScaleVisitor</i><i> </i><i>sv(</i><i>initialObjectScale</i><i>
</i><i>*</i><i> </i><i>correctiveObjectScale</i><i>);
</i><i><br>
</i><i> </i><i>node-></i><i>accept</i><i>(sv);
</i><i><br>
</i><i> </i><i>addChild</i><i>(node);
</i><i><br>
</i><br>
Unfortunately when rescaling the object after being added as a child
this doesn't work any more:<br>
<i> osg::ref_ptr<osg::Node> node</i><i> </i><i>=</i><i>
</i><i>getChild(0);</i><i>
</i><i><br>
</i><i> ScaleVisitor</i><i> </i><i>sv(scaleChange);</i><i>
<br>
</i><i>node->accept(sv);</i>
<br>
<br>
The 3ds scene doesn't change size on my screen.<br>
The visitor calls:<br>
<span style="color:#c0c0c0"> </span> vertices->dirty();
<br>
<span style="color:#c0c0c0"> </span> geom.dirtyBound();<br>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></pre>
But nothing happens. What am I missing? Deleting the 3ds scene and
recreating it from scratch works OK but is very inefficient.<br>
<br>
Thanks for any hint.<span class="HOEnZb"><font color="#888888"><br>
<br>
- Werner -<br>
</font></span></div>
<br>______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
<br></blockquote></div><br></div>