OpenGL Maths - Angle between 2 Vectors

Hi,
I want the camera to have a 360 degree view, if i take a constant facing north and then a second value of where the player is looking, calculating the angle between the two for moving in the correct direction.
I am using gluLookAt, that is why i need to do it this way, i would be most grateful for any help. Thanks

Paul

Are you asking for the formula for the angle between two vectors?

gav

Since v1 dot v2 = |v1|*|v2|cos(theta)

you can solve for theta with

theta = acos((v1 dot v2)/(|v1|*|v2|))

P.S. |v| is the magnitude of a vector and dot refers to the dot product.

Hi,
Thanks, it was the formula for calculating the angle between two vectors that i was looking for. Thnaks again.

Paul