[osg-users] Text rendering

Bradford, Chase CHASE.BRADFORD at saic.com
Fri Jan 4 08:31:02 PST 2008


You might be able to accomplish what you want by setting text->setCharacterSizeMode( osgText::Text::SCREEN_COORDS ).  That applies a scale that warps the text into pixel coordinates, instead of object coordinates.

Chase


-----Original Message-----
From: osg-users-bounces at lists.openscenegraph.org on behalf of Michele Bosi
Sent: Fri 1/4/2008 8:25 AM
To: OpenSceneGraph Users
Subject: [osg-users] Text rendering
 
Hello,
in my programs I would like to show some text "following" the objects
that are in the scene.
Till now the solution that I found was to create an osgText::Text
object and do something like:

  text->setPosition( world space position );
  text->setAutoRotateToScreen(true);

the problem is that the text is draw very big, and is affected by
perspective projection which in this case I wouldn't like.
Basicly I need a text that behaves like if it was drawn on a HUD but
whose position on the screen is based on the objects they are
following
(that is, is the projection on the screen of some world space
coordinates). How can I accomplish this?
The only solution I have in mind is to put all the text objects on a
HUD (which complicates a lot the design of my program) and to compute
by hand, every frame, the projection of the objects they are
following, so that i can assign it to the text objects.
Isn't there a built in functionality to achieve the same result?

Thanks,
Michele
_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3347 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080104/af5097d5/attachment.bin 


More information about the osg-users mailing list