
GL.Lookat mathematics
Posted Thursday, 5 July, 2012 - 19:18 by lid6j86 incould I please get a little help? I'm trying to figure out the math for GL.Lookat() function.
I'm having problems figuring out 'moving forward' from an arbitrary position and angle.
my preferred input is a gamepad (right now i'm using XNA for the gamepad).
I have the following variables:
UpVector (0,1,0)
CameraYaw
CameraCoordinates
CameraPitch
for CameraYaw i was inputting as degrees. Originally I was thinking it was something like using Sin and Cos of CameraYaw to figure out the correct viewing angle but it wasn't working correctly. Hope that makes sense :-/


Comments
Re: GL.Lookat mathematics
If I'm not mistaken i should turn the degrees to radians, then for x take sin(radian y rotation), z take cos(result radian y rotation) y take sin(radian x rotation), correct?
Re: GL.Lookat mathematics
got it, going to post it up for others if they want something simple