Hi,

you can set the text position in 3D coords without worrying how they are projected to the screen. Text already has a mode to draw itself screen aligned and make the characters the same size no matter how far from the camera. e.g.

mTextLabel->setAxisAlignment(osgText::Text::SCREEN);
mTextLabel->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);

The same can be done for for e.g. icons using Autotransform.

jp

Adrien Joly wrote:
Hi,

I'm trying to put a text on the top of a node, a sort of caption. This caption 
can be added for mutliple objects without being stacked with other captions. My 
idea is to add those caption to the global scene by getting the coordinates of 
the top of the followed node and project the text on the screen from the given 
coordinates.

Here are my questions:
Have you got a better idea?
How can I get the top of the Node directly (I thought to use the LineSegment 
and BoundingSphere)? Is there an easier (and better for performances) way to 
get them?

Thank you for your answers!

Cheers,
Adrien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=16077#16077





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to