Archived

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

K_L

n00b problem

Recommended Posts

K_L    122
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
Tree Penguin    262
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
K_L    122
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
Enigma    1410
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
K_L    122
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
Deranged    668

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