<div dir="ltr"><div><div><div><div><div><div><div>Dear OSG community,<br><br></div>I am trying to set auto scale property of osg::AutoTransform variable. I would like to achieve such an effect that whatever the viewing camera position and its distance from a certain geometry, the geometry's size would not change.<br><br></div>As an example geometry, I have this pyramid:<br><br><img alt="Inline image 1" src="cid:ii_15385af6ce5b7f6b" height="125" width="114"><br><br></div>I found an example "osgautotransform" <br><a href="http://trac.openscenegraph.org/projects/osg//browser/OpenSceneGraph/trunk/examples/osgautotransform/osgautotransform.cpp">http://trac.openscenegraph.org/projects/osg//browser/OpenSceneGraph/trunk/examples/osgautotransform/osgautotransform.cpp</a><br><br>that seem to have an element of what I need. I tried to use the same commands, for example:<br><b><span class=""><br>osg</span></b>::AutoTransform* at = <b><span class="">new</span></b> osg::AutoTransform;<br>at->addChild(geode); // geode constains my pyramid geometry and color <br>at->setAutoScaleToScreen(true);<br>at->setMinimumScale(1); // some test values<br>at->setMaximumScale(2);<br><br></div><div>// to render the scene:<br></div><div>root->addChild(at); // root is osg::Group<br></div><div>viewer->setSceneData(root);<br></div><div><br></div>However, it did not produce any changes in how the scene is rendered when I change the camera view (i.e., the pyramid becomes smaller when camera zooms out and bigger when zooms in). I tried the command that sets up auto rotate mode and it works to fix the rotation. So how come I cannot control the scale? <br><br></div>Could anyone point out what am I doing wrong or what is missing here? Thank you!<br><br></div>Regards,<br></div>Victoria<br></div>