Original Post
I've used a camera tutorial that I found on Flipcode. I'm having trouble with the rotations but the translations seem fine. I'm using GLUT and my mouse callback looks like this: If you try the compiled exe from here and hold down a mouse button and rotate the pointer in circles you will see how it goes wrong. The teapot starts to rotate around the Z axis. If you do circles in the other direction then it goes back. Use W, A, S and D for FPS-like movement. Any ideas how I can stop this from happening?
void Mouse(int pX, int pY)
{
static int lastX, lastY;
if(pX > lastX)
gCamera.RotateLocal(-1.0, 0.0, 1.0, 0.0);
else
if(pX < lastX)
gCamera.RotateLocal(1.0, 0.0, 1.0, 0.0);
if(pY > lastY)
gCamera.RotateLocal(-1.0, 1.0, 0.0, 0.0);
else
if(pY < lastY)
gCamera.RotateLocal(1.0, 1.0, 0.0, 0.0);
lastX = pX;
lastY = pY;
}