PDA

View Full Version : Upside down cube map?



dalangalma
02-12-2004, 02:31 AM
I'm trying to use my skybox textures as a cube environment map (still). I've got them looking nice and shiny on my teapot, but with one problem - they reflect the world upside down! Why would it do that? The images I sent to it were right side up...

Also, if I want to walk around the teapot, the cube map seems to "follow" me. How can I make it fixed?

mikael_aronsson
02-12-2004, 03:26 AM
Depends on your texture coordinates, maybe you have swapped the direction of the textures ?

Mikael

Relic
02-12-2004, 04:25 AM
Reflection texture lookup in cubemaps is a little strange. Just download the 2D texture to the cubemap faces upside down, use PixelZoom(1, -1) and exchange top and bottom. I stopped thinking about it at one time, means maybe I'm wrong. http://www.opengl.org/discussion_boards/ubb/wink.gif
To manipulate the texture's orientation on the object you need to change the cubemap texture unit's texture matrix (glMatrixMode(GL_TEXTURE)) to contain a rotation.
This is either the same as the object's rotation or the inverse of the viewer's. depends on what you're doing.