Original Post
Hi, Well I finally got most of cubemapping figured out. One problem left though. The problem arises in that the reflections I'm seeing look completely wrong--i.e., they aren't in the right place on the reflecting object. When rendering to the texture, I set the view using gluLookAt(). I assume this is where the problem is. Here's the code (Python):This may not be where the problem lies--if not just say so. Ideas why this isn't working? Thanks, Geometrian [Edited by - Geometrian on October 12, 2008 9:31:26 PM]
cubefaces = [GL_TEXTURE_CUBE_MAP_POSITIVE_X,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z]
for i in xrange(0,6,1):
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
if i == 0: gluLookAt(x,y,z, 1, 0, 0,0,1,0)
elif i == 1: gluLookAt(x,y,z,-1, 0, 0,0,1,0)
elif i == 2: gluLookAt(x,y,z, 0, 1, 0,1,0,0)
elif i == 3: gluLookAt(x,y,z, 0,-1, 0,1,0,0)
elif i == 4: gluLookAt(x,y,z, 0, 0, 1,0,1,0)
elif i == 5: gluLookAt(x,y,z, 0, 0,-1,0,1,0)
#Draw objects that will be reflected. (Turning off cubemapping first, then reenabling it after)
glTexImage2D(cubefaces,0,GL_RGB,ReflectionMapSize,ReflectionMapSize,0,GL_RGB,GL_UNSIGNED_BYTE,RenderToTextureData())
#The last function as an argument to glTexImage2D() renders the view (it simply grabs what's in the framebuffer)
#And so on finalising texture here...

