<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body 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="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; 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.<br>
<br>
- Werner -<br>
</body>
</html>