Skip to main content
gamedev.net
🔒 Locked

Text on a surface

Started by Lightness Jul 17, 2008 at 6:42 PM 1 replies 750+ views
Original Post
Lightness
Lightness
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?
Lord_Evil
Lord_Evil
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.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
Lightness
Lightness
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.