How to draw and rotate 2d text in 3d space?


Please help do draw a street name on a street in 3d view.
The street name is 2d text.
How to do it?
My specific questions are
1.Should the text be drawn in 2d or 3d projection?
2.I calculated the direction vector of a street line and then transfered it to the angle in which z axis should be rotated in order to put the text on the street, but I dont know how to draw and then rotate it correctly.

No suggestions? :frowning: :frowning:
I forgot to mention that street names are dynamic (I can’t prepare them ahead and use texture fonts).

P.S. Should I post this in the advanced forum?


2d text are drawn as quads using a texture containing the characters of the font. So 2d text are actually 3d. All your normal transformations should work the same for your text as it should with your models.

  1. I think it should be used with a 3d projection, but should be scaled accordingly.

  2. Well this depends on what you actually want the end result to look like, which is still unclear to me. Maybe some screenshots, or reference pics will help us get a better picture of what you trying.

Why can’t you create dynamic names using a font texture? It’s not like you changing the font, you changing the order your quads are drawn, and to what character their co-ordinates are aligned to on the font texture. Also can you please post some code?


I can’t post source code since I didn’t implement it yet…
What I want to do is like in this attached screen shot from Google Earth.If you can see street names there displayed on the streets. (Please click on the image to see it bigger)

I don’t expect to get here ready source code, since I think I know how to do each thing separately.I just don’t know how to put things together to create such an effect:
1.Which type of font to use? (it’s bitmap or texture font?other?)
2.How to draw it(in which projection)?
3.How to render and rotate in z axis?
All examples I saw so far - text is always drawn assuming there is no depth.


It sounds as if you not experienced with graphics programming, or have a very small picture of what it’s about. So it’s not a matter of giving you a simple answer since you need help in more than one area. Maybe you could ask someone that has the experience to do it for you.

Solved it myself. Thanks anyway.

^Ummmm,that was a bit harsh. But it motivated me even more,so thanks. Actually my all questions could be answered in 2 short sentences…

hey MicroBotox,

Glad you were able to solve it. Do you mind sharing any pointers or suggestions on how to accomplish what you were doing?


Of course.So in 2 sentences…:

1.Draw your text into texture and then put it on quads and render it as usual 3D geometry.
2.I used FTGL(, it shortens a work significantly

Hey MicroBotox,

Thanks for the reply. I did look into FTGL since I read that was one of the easiest ways to do fonts/text for OpenGL. However I am currently having trouble getting the library to work. What language are you using to do this? I’m working with VB.NET in VS2010. Any pointers to lead me in the right direction would be greatly appreciated.

I’m using plain Win32 C/C++ with Borland Developer Studio and I’m not familiar with VB.NET

Maybe repost your question as a new topic with subject something like “FTGL and VB.NET” so it will take attention of people who are familiar with it and they’ll help you.

Thanks! Will do.