lid6j86's picture

GL.Lookat mathematics

could 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)


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 :-/


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
lid6j86's picture

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?

lid6j86's picture

got it, going to post it up for others if they want something simple