Angular issues regarding the gluLookAt function

Started by Richie551, September 10, 2012, 06:03:15

Previous topic - Next topic


I really hate to ask another question, but 3D is just killing me here.  And as well, I made another thread for this since it is a completely different question regarding gluLookAt.  I now have gluLookAt working, to some extent, but I am ending up with what seems like a angle-lock type deal, as well as another issue.  I am as usual absolutely stumped.  Here's a image I made demonstrating my problem.

Basically, what is going on, is I have gluLookAt code like so:
GLU.gluLookAt(width/2 + x, height/2, 80 + z, width/2 + x + rotx, height/2, 0, 0, 1f, 0);

And as you can see, I rotate the screen by adding rotx to the position the camera is looking at.  The issue is, after just about that red section I have marked out, rotx has already surpassed 360, which to what I'm attempting should mean it has done a full turn, but for some reason that is not the case, and as well, after rotx gets high enough, the camera stops turning completely.  I have no idea what is going on here, and help on this matter would be appriciated.  Thanks.

Fool Running

What is specified in that parameter is not the angle of the camera, but the location it is looking at. Basically, you are just moving the location that the camera is looking at along the x-axis. When the point is really far away, then it looks like the camera isn't moving because it doesn't have to move to keep that point in view.

You probably want to use glTranslatef() and glRotatef() to get your camera to work the way you want.
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D