Help with texture mapping
I am working on an OpenGL project using Visual C++. I need to glue a texture to only one of the polygons, but the problem I am having is I can''t disable texture mapping. If I use texture mapping for one polygon, all the coloring and lighting for other polygons are lost, all I get is some strange color look similar to the last pixel in the texture object. Tried disable GL_TEXTURE_2D and delete texture object. Didn''t work. Please help, thank you very much!!!!!!!!!!!
you need to set the color back to white.
glEnable(GL_TEXTURES_2D);
glBindTexture(GL_TEXTURE_2D, texture);
glPushMatrix();
glBegin(GL_QUADS);
glTex......... glVert....
glTex......... glVert....
glTex......... glVert....
glTex......... glVert....
glEnd();
glPopMatrix();
glDisable(GL_TEXTURES_2D);
glColor3f(1.0f,1.0f,1.0f);
glPushMatrix();
glBegin(GL_QUADS);
glVert....
glVert....
glVert....
glVert....
glEnd();
glPopMatrix();
glEnable(GL_TEXTURES_2D);
glBindTexture(GL_TEXTURE_2D, texture);
glPushMatrix();
glBegin(GL_QUADS);
glTex......... glVert....
glTex......... glVert....
glTex......... glVert....
glTex......... glVert....
glEnd();
glPopMatrix();
glDisable(GL_TEXTURES_2D);
glColor3f(1.0f,1.0f,1.0f);
glPushMatrix();
glBegin(GL_QUADS);
glVert....
glVert....
glVert....
glVert....
glEnd();
glPopMatrix();
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement