PDA

View Full Version : Getting the angle of FOV



nckchan
11-01-2001, 07:59 AM
Hi,

I want to implement the zoom function of a camera so I intend to change the parameter of glPerspective(). Before calling this function, how can I get the current angle of FOV of OpenGL setting?? Thx!

William

jabe
11-01-2001, 08:42 AM
you need the near plane and whether the left and button or right and top values.

fovx = arctan(right/near);
fovy = arctan(top/near);

=> fovx = aspect_ratio*fovy
mostly aspect_ratio = 4/3.

regards,
jan