[osg-users] Text rendering

Michele Bosi michele.bosi at gmail.com
Fri Jan 4 08:25:42 PST 2008


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


More information about the osg-users mailing list