PDA

View Full Version : Texture mapping doing funny things



Joe the Programmer
02-12-2006, 06:01 PM
I am trying to do texture mapping, (from NeHe tutorials) and NeHe basically builds on its previous tutorials.

So I had a spinning cube on the previous tutorial, and I wanted to texture map an image to it. The tutorial told me to change the line
glEnable(GL_DEPTH_TEST); to
glEnable(GL_TEXTURE_2D); so that it would enable texture mapping. But here's the weird thing: the cube sides that were solid before are now semi-transparent, so that you can see through to the other sides of the cube when it rotates. Did I miss something?

dorbie
02-12-2006, 06:53 PM
Enable both simultaneously.

You don't need to disable depth texting just because you enable texture.

You are seing the back of the cube through the front sometimes because depth testing is no longer discerning the nearest cube faces for you.

Joe the Programmer
02-13-2006, 07:13 AM
It works perfectly! You wouldn't believe how long I've been trying to get this tutorial working! :D