glColor3f(1.0f, 1.0f, 1.0f);
glBegin(GL_LINES);
glVertex3f(-2.0f, -3.0f, -1.0f);
glVertex3f(2.0f, 1.0f, 1.0f);
glEnd();
Texture mapping messes with colors
Hey. I'm trying to do some simple texture mapping (which I've done before). I can get the texture mapping to work, say, making a cube spin in the program with a texture on each face. However, if I load textures into the program, it messes with all the other colors. What it seems to be doing is coloring everything according to the colors in the texture. Its very odd.
Just as a test, I took the source from NeHe's lesson #6, and tried drawing a white line right after drawing the cube, by adding this code:
The line ended up being drawn correctly, but it is dark blue instead of white!
To test and see what the problem was, I started commenting things out. Commenting out the cube drawing procedure in DrawGLScene() didn't affect the line's color, but when I also commented out the call to LoadGLTextures(), the function that NeHe uses to load a bitmap texture, the line was drawn white.
Any thoughts on why this happens? Thanks.
[EDIT] maybe this should be moved to the NeHe forum? I don't know.
you need to disable texturing to stop that from happening, a glDisable(GL_TEXTURE2D); will do it
Hmm try adding glDisable(GL_TEXTURE_2D) before you render the line and glEnable(GL_TEXTURE_2D) after you finished rendering the line
[EDIT] posted to late [headshake]
[EDIT] posted to late [headshake]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement