[osg-users] osgText: problem with SCREEN_COORDS mode

Glenn Waldron gwaldron at gmail.com
Fri May 18 10:01:55 PDT 2018


Robert,
Thank you for look into this. Indeed, my use case is an earth graticule
with labels in the grid cells.

As the labels become more rotated away from the camera, things begin to
break down:

[image: 2018-05-18_125340.jpg]

Removing the rotational elements yields a better result:

[image: 2018-05-18_125144.jpg]

I understand that just removing rotations might cause other side effects so
maybe there's a better approach.

Even if this is not a bug, it is a regression relative to OSG 3.4.1. Let me
know if you want me to do any further testing.

Glenn Waldron


On Fri, May 18, 2018 at 6:27 AM Robert Osfield <robert.osfield at gmail.com>
wrote:

> Hi Glenn,
>
> I have now looked at your test program and can reproduce the stretched
> text.
>
> The example is a bit unusual in that you have text size set to
> SCREEN_COORDS but the orientation of the text is free to move with the
> scene as it gets rotated by the viewer's camera,
>
> What I'd normally expect is that if you are using:
>
>     text->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
>
> Then it would be normal to also us:
>
>     text->setAxisAlignment(osgText::Text::SCREEN);
>
> Adding this to your test example fixes the issue.  So I'm curious, do you
> have an instance where the character size should be scaled to SCREEN_COORDS
> but with the AxisAlignment set to SCREEN.
>
> As a general comment, if you are scaling the text to screen coords the
> rotation of the text will be important to take into account as the aspect
> ratio of the window can be altered so required the horizontal and vertical
> scaling can be different, which will be affected by the rotation of the
> text.
>
> At this point I don't think we are looking at a bug, rather just an odd
> behaviour when using text is an odd way.
>
> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180518/68be95bc/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2018-05-18_125340.jpg
Type: image/jpeg
Size: 306838 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180518/68be95bc/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2018-05-18_125144.jpg
Type: image/jpeg
Size: 291374 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180518/68be95bc/attachment-0003.jpg>


More information about the osg-users mailing list