Reputation: 1053
With the function
void gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
I am able to set the perspective projection matrix according to a certain field of view angle. Given a projection matrix, how can I get the field of view angle in OpenGL?
Upvotes: 2
Views: 1244
Reputation: 7198
Look at gluPersperctive
In the matrix you see M[1][1] = f
and f=cotang(fov/2) = 1 / tan(fov/2)
So just pick the element at [1][1] and then fov = 2·acotan(1/f)
Upvotes: 2