[osg-users] osgText: problem with SCREEN_COORDS mode

Robert Osfield robert.osfield at gmail.com
Fri May 18 03:27:04 PDT 2018


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180518/57acf42a/attachment.html>


More information about the osg-users mailing list