[osg-users] Geometry in world coordinates but with same screen size - how to do?

Robert Osfield robert.osfield at gmail.com
Wed Jan 18 02:10:32 PST 2017


Hi Roko,

Have a look at the osgautotransform example as this is both a unit
test and means of illustrating how to use it.

FYI, the coordinates of the subgraph of the AutoTransform are scaled
to screen coords, so a subgraph of 10 units across will be scaled to
10 pixels on screen.

Robert.

On 18 January 2017 at 08:44, Roko Talk <schirokotal at gmail.com> wrote:
> Hi guys,
>
> I'm now trying desperately for hours now and not able to achieve the following. : (
>
> I have a geometry, a 2D cross mark (everything is 2D), and I would like it to stick at specific world coordinates and in addition have always the same screen size, no matter what the zoom level is. I thought AutoTransform should do it, but somehow it doesn't the job : ( (And sadly osg::AutoTransform is more or less not documented at all what which feature does : (  )
>
> This is what I have tried and I thought it should work:
>
>
> Code:
>
> osg::ref_ptr<osg::AutoTransform> auto_transform = new osg::AutoTransform();
> auto_transform->addChild(cross_mark_geode);
> auto_transform->setAutoScaleToScreen(true);
> root->addChild(auto_transform);
>
>
>
>
> Any idea how I could make it work?
>
> Many many thanks in advance!
>
> Cheers,
> Roko
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69986#69986
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list