Jump to content
  • Advertisement
Sign in to follow this  
RSC_x

OpenGL full header of free font library for standard opengl.

This topic is 4169 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

hi. i need some ?. help. this is full header of free font library for standard opengl. i works wery well. but when i try to rotate the text is hiding or can't showing. can anyone found why. if you need a font library this is works fine but just on static mode. it uses glbitmap on its main. i think this bitmaps are not dynamic. can anyone help me . to conwert this fonts to dynamic style. thanks.. thats are my call commands beginRenderText( 100, 100 ); { //glRotatef (0.1, 0.0f, 0.0f, 1.0f); this is closed because breaks the process. glColor3f( 166.0f, 198.0f, 968.0f ); sprintf(c0,"%f ---%f",theta ,r); renderText( 0, 24, BITMAP_FONT_TYPE_TIMES_ROMAN_24 , c0 );} endRenderText(); [Edited by - RSC_x on May 26, 2007 2:36:05 AM]

Share this post


Link to post
Share on other sites
Advertisement
OK... I'm pretty sure that the code in the header there won't let you rotate any text it renders. Coordinates specified through glRasterPos2f (which the font library uses to position the text) are affected by the transformation pipeline (the projection and modelview matrices). However, calls to glBitmap aren't. It's a raster operation which occurs in screen space.

This means that you can rotate the position where the text begins rendering, but not the text itself. I'd guess that the text isn't appearing when you put in the call to glRotatef because you're invalidating the raster position (I think you're rotating it into a negative y position), and OpenGL is ignoring calls to glBitmap made by the font library as a result.

If you want to draw text that can be rotated, have a look at NeHe Lesson 17. It uses a font texture and display lists to render each character of a given string as two texture-mapped triangles. Being geometry, these triangles are affected by the modelview matrix, so you can translate, rotate and scale them with the appropriate OpenGL function.

One other thing: the parameters you specify to glColor3f are wrong. glColor3f takes parameters of type GLclampf, which must be in the range [0.0, 1.0].

EDIT: Come to think of it, this probably shouldn't be in the Lounge. Can someone shift it to OpenGL...?

Share this post


Link to post
Share on other sites
thanks "iNsAn1tY Member since: 12/18/2001 From: Birmingham, United Kingdom".
but i need more effort to understand samples.
and it uses glut.
and it is some different.

also your web pages are good referances thanks.

[Edited by - RSC_x on August 31, 2007 3:34:45 AM]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!