[osg-users] Wrapping Text around object as texture

Dan johansson johansson_dan at hotmail.com
Tue Oct 15 00:45:42 PDT 2019

Hello again !

Today i am attempting to create a label on my meshes. The image below shows how i set it up with the osgText::Text class but i would like to extend it to be able to set the texture on the actual mesh itself.


The goal is to make the text unstretched between the poles of the sphere simply wrapping around the spherical "belt" and similar for a cylinder ring surface.

As can be seen in the image, the cylinder ring displays the text decently but the sphere drags out it towards the pole which is undesired. I can probably solve the issue by skewing the texture coordinates so that the text wraps like a belt around the sphere, but this is not what i want to do as it messes up the other textures.

Instead, i was thinking of creating the texture itself with a transparent background and a text with certain margins width and margin heights that can be adjusted based on the size of the mesh and mesh type. Is this doable and is this a good approach to solving the problem? Any recommendations on how to go about the issue differently?

Does OSG have any built in magic to solve this?

All inputs are welcome.  

Best regards Dan

Read this topic online here:

More information about the osg-users mailing list