shoke

11-11-2010, 02:21 PM

I have a (hopefully) simple questions. I'm trying to get the pitch and yaw angles for a camera from the (x,y) mouse position so I can update my LookAt vector (for gluLookAt). I know to update the vector to use:

lookat.x = radius*cos(phi)*cos(theta);

lookat.y = radius*sin(phi);

lookat.z = radius*cos(phi)*cos(90.0-theta);

But I can't seem to compute a phi and theta that work correctly. I'm pretty new to opengl.

lookat.x = radius*cos(phi)*cos(theta);

lookat.y = radius*sin(phi);

lookat.z = radius*cos(phi)*cos(90.0-theta);

But I can't seem to compute a phi and theta that work correctly. I'm pretty new to opengl.