Jump to content
  • Advertisement
Sign in to follow this  

Cubemapping Views -- Camera Error

This topic is 3705 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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):
for i in xrange(0,6,1):
        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)
        #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...

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]

Share this post

Link to post
Share on other sites
Actually, it doesn't seem to work. The trouble is, when moving the camera, strange things happen. I got the impression it was working because it seems to work only when the camera doesn't move, i.e., the world is moved. However, when gluLookAt() is called, and the camera moved in a horizontal plane, it doesn't work:
Strangely, moving in a vertical plane works:
This is a truly bizaare error. Ideas?

Share this post

Link to post
Share on other sites
My mistake--the teapot threw me off--the reflections are still wrong except when the camera hasn't moved. The thread continues here: http://www.gamedev.net/community/forums/topic.asp?topic_id=511996

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!