Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

K_L

n00b problem

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

Ok i´ve been reading some NeHe´s damn fine tutorials, but I´m always trying to play with things that I learn to use them. Well the problem that I can´t understand is when i compine two tutorials the one about how to add texture to box and the one about fonts and text. I can´t get the text to be seen. And I can´t understand why? Yeah it´s a damn n00b problem but can ya help? yes I am n00b!

Share this post


Link to post
Share on other sites
Advertisement
After drawing the box and before drawing the text, place a glLoadIdentity(); call, this loads the identity matrix (which is that everything is scaled by 1, not translated and not rotated). If this still doesn''t help place glTranslatef(0.0,0.0,-1.0); after the glLoadIdentity call, this translates everything you draw after the call one unit away from the camera, as it might be clipped away now.

Share this post


Link to post
Share on other sites
I´ve been reading now another turotial about adding text, but I still have a problem. Maybe I´m slow learner or maybe it´s mi bad english skills. But I have add glLoadIdentity(); after drawing the box and now I try to add color for the font with glColor3f(0, 1, 0); this results that the texture in box goes green. And I just can´t understand why?

yes I am n00b!

Share this post


Link to post
Share on other sites
I know it sounds silly but do you set the glColor3f(1, 1, 1); before drawing the box then when you do the text set it to glColor3f(0, 1, 0); ?

Share this post


Link to post
Share on other sites
OpenGL is a state machine. This means when you enable a state or set a state it remains enabled or set until you disable or change it. So when you call glColor3f(0, 1, 0) the colour state is set to green and every object will be coloured green until you change the colour state. Simply add glColor3f(1, 1, 1) before you draw the box.

Enigma

Share this post


Link to post
Share on other sites
Now I got the box look like ok but the text still is black even tho I try change the color.

yes I am n00b!

Share this post


Link to post
Share on other sites

disale textureing before drawing the text(glDisable(GL_TEXTURE_2D) then enable textureing after drawing the text(glEnable(GL_TEXTURE_2D)

[Mercury Software] [Google!] [ Look I DONT Follow Trends ]

[edited by - DerAngeD on January 24, 2004 8:42:36 AM]

Share this post


Link to post
Share on other sites
THX again for the fast answer. Now I can play again for a while ;D

yes I am n00b!

Share this post


Link to post
Share on other sites

  • 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!