Texture mapping doing funny things

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




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?

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.

It works perfectly! You wouldn’t believe how long I’ve been trying to get this tutorial working! :smiley: