n00b problem

Started by
7 comments, last by K_L 20 years, 2 months ago
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!
yes I am n00b!
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.
Thx m8 that solved the problem.
yes I am n00b!
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!
yes I am n00b!
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); ?

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
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!
yes I am n00b!
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]
THX again for the fast answer. Now I can play again for a while ;D

yes I am n00b!
yes I am n00b!

This topic is closed to new replies.

Advertisement