Jump to content
  • Advertisement
Sign in to follow this  
Lightness

OpenGL Text on a surface

This topic is 3627 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm looking for a way to render text on the surface of an object. In particular I'm just making a bunch of signs and they need to have text that give directions. First, a little about what my project is being made with: I'm using Visual Studio 2005, C++, OpenGL and GLUT... and I'm working on Vista *shudders* My first idea for this was to use glutStrokeCharacter, but I've determined this can't be the best solution. It's slow (although probably wouldn't be a problem) and it would be hard to get everything lined up nicely on multiple signs. As a result, I started looking around the internet for different solutions. I found an article by Mark Kilgard, which sounds like it's pertaining to what I want: http://www.opengl.org/resources/code/samples/mjktips/TexFont/TexFont.html Next I found FTGL, although I could never get it to compile. Simply due to my inexperience with that kind of thing. Lastly, I found glFont by Brad Fish. This seemed to be something good, he even mentioned Mark Kilgard's article on his website. However, I'm not convinced this is actually what I want to do. Every example program I have seen on it was using an orthographic projection and wasn't on the surface of a 3d object. I've finally decided to come to these forums in an attempt to find some help, perhaps just to get pointed in the right direction. What would be the easiest way to do what I'm trying to do?

Share this post


Link to post
Share on other sites
Advertisement
For 3D text I create a texture mapped font and draw the characters as sprites.
You also could render the text to a texture if it doesn't change that often and either draw a quad with that texture over the sign or draw directly to the sign's texture.

Share this post


Link to post
Share on other sites
Thanks, I think I'll end up going with rendering the text to a texture. I've found a NeHe lesson on it and that looks to be the best solution. I have a bunch of repeating words, so I will render each word separately and then put the multiple textures on the signs.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!