Original Post
Hi all, I'm looking for some help with my camera control :$ I can't get my sinus/cosinnus to work properly. I have an rotation (float) and the delta's for x (int) and y (int) current code:
void UpdateCamera()
{
int dx = mouse.last_left - mouse.left;
int dy = mouse.last_top - mouse.top;
if(mouse.button[1])
{
Camera.Lookat.x += float(dx) / sin( (Camera.RotAngle * 2 * M_PI) ) * mouse.sensitivity;
// Camera.Lookat.z += cos( (Camera.RotAngle * 2 * M_PI) ) * ( dy ) * mouse.sensitivity;
}
if(mouse.button[2])
{
Camera.RotAngle += float(dx) * mouse.sensitivity;
}
}
But nomatter what the rotation is, my camera always moves as if I would execute this: Camera.Lookat.x += dx; Camera.Lookat.z += dy; in other words, straight, and ignore the rotation factor.. What am I doing wrong? Also, I seem unable to get the mouse scroll wheel to work unless I define my program to run only on winXP. Is there no other way? [Edited by - Ruudje on December 26, 2004 8:53:48 AM]