Writing text vertically

Hi,
I want to write text vertically on an Open GL window. I tried making fonts with vertical orientation and adding to the DC and selecting it for glCalllists
For Horizontal orienntation its working fine but vertical no text is displayed.
Could you guys helpme out? Is there a simple way we can display text with different fonts (I want vertical display)
Thanks
Jowins

You can render text to texture in pbuffer and then rotate it as you want, but that’s quick guess.

Thanks for the reply,
but its not the only thing, I have 3D axes, showing some graph in that, which we can rotate. In the X and Z axes I write the Axes names horizontaly and in the Y axes i want to write vertically. I can do that in some way… but is there any simple method thru which we can accompolish this. I have the rotation for the entire window also
Thanks

How about glRotate? It should work at least on outline fonts.

-Ilkka

Hi,
As I mentioned earlier i have so many objects in the window. I have a rotation functionality for the entire window, So is it possible to rotate a text alone within a window. I am drawing all the objects all together based on some data
Thanks
jowins

Yeah, sure you can. Use push/popMatrix to limit the rotation to the text. Like this:

glPushMatrix
glRotate(90, 0, 0, 1);
draw text
glPopMatrix

-Ilkka

If you will use textures you can take a look at some billboarding tutorials, that shoud solve all your text problems in 3D space.

I am sorry! its not working. when I use Push matrix nothing happens with respect to rotation. just draws the text horizontally

Originally posted by M/\dm/
:
If you will use textures you can take a look at some billboarding tutorials, that shoud solve all your text problems in 3D space.

Can you please tell me where I can find such tutorials

How do you generate the display lists that contain the fonts?

-Ilkka

Originally posted by JustHanging:
[b]How do you generate the display lists that contain the fonts?

-Ilkka[/b]

void COpenGLWnd::MakeFont(BOOL bVert)
{
// create a font
SelectObject (m_pCDC-GetSafeHdc(), m_VertFont);
m_bHorzGotFont=wglUseFontBitmaps (m_pCDC->GetSafeHdc(), 0, 255, fontlist);

}

and for printing i use the function
void PrintString (LPCTSTR str)
{
glPushAttrib(GL_LIST_BIT);
glListBase(fontlist);
glCallLists(strlen(str), GL_UNSIGNED_BYTE, (GLubyte*)str);
glPopAttrib();
}

Ok, well that’s the problem. You use bitmap fonts, and bitmaps aren’t affected by matrix transformations. Replace wglUseFontBitmaps with wglUseFontOutlines, and something should happen. If your texts are rotated, but not facing the viewer, go for the billboard stuff.

-Ilkka

Thanks for you reply. It worked but how can I adjust the size of the fonts, say small size and bigger size. IS it possible? Could you please tell me where I can get that Bill board samples

Of course you can adjust the size of the text, just use glScale the way you use glRotate to rotate it.

There’s a very good billboarding tutorial at http://www.lighthouse3d.com/opengl/billboarding/ .

-Ilkka

Thank you very much Mr Justhanging.
Thank you all for your replies. All helped me a lot.
Thanks