Just thought I’d post something weird I ran into that I’ve never heard of before. I was messing around with the cubic environment mapping extensions a bit, and instead of creating my own model for the testing, I just used glutSolidTeapot.
Everything worked fine. I had a rotating teapot, with my simple cubic environment map. Next I decided to rotate the texture around instead of the teapot.
I switched the matrix mode to GL_TEXTURE, did my rotate, drew my teapot, then switched back to GL_MODELVIEW. You can imagine my surprise when, instead of rotating my texture, my teapot flipped onto it’s side!
I was playing with this on my new work computer, which has an embedded Intel chip. My first thought was that the OpenGL implementation for that was buggy in the area of the texture matrix. I messed around with it a bit more, though.
I finally narrowed down the problem, though. And it appears that it happens on my GeForce2 as well. What I found suggests that it’s a weirdness with the glutSolidTeapot call itself.
What I found is that if the GL_TEXTURE matrix is the current matrix when glutSolidTeapot is called, it gets drawn on its side. My guess is that this function uses matrix manipulations for drawing, and simply assumes that the current matrix is the GL_MODELVIEW.
In any case, it’s not a huge problem. I was simply using the teapot for a test model, in place of some other code I hadn’t completed yet. It was just something I found a bit interesting. I think I might just have a look at the code for that function.