How to draw text on top of a 3D object?

Started by
0 comments, last by AverageJoeSSU 14 years, 11 months ago
Hello all, I use function auxSolidSphere to draw a sphere and would like to draw a text on top of the sphere. What should I do to implement this feature. glPushMatrix(); glTranslated(pos[0], pos[1], pos[2]); // pos is the location of sphere auxSolidSphere(1.5f); glPrint3D(pos[0], pos[1]+1.5f, pos[2], "100"); glPopMatrix(); void glPrint3D(float x, float y, float z, const char *string) { glPushMatrix (); glColor3f (1,1,1); glRasterPos3f(x, y, z); for (int i = 0; string != '\0'; ++i) glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, string); glPopMatrix (); } Thank you -Daniel
Advertisement
I dont know if there is a simpler way... but you could render the text to a render target and then apply that to the spheres texture using multi-textruing.

------------------------------

redwoodpixel.com

This topic is closed to new replies.

Advertisement