I was working on an algorithm. Focal length is an crucial parameter in my algorithm.

At first, I think the near_plane parameter which is used in gluPerspective(fovy, aspect, near_plane, far_plane) is related to focal length. But I tried and failed

Could anyone who have ever used this help me please? Thank you

Here “frame size” refers to the dimension of the frame in the direction of the FOV, so for 35mm (which is 24mm x 36mm), frame size is 36mm for the horizontal FOV, 24mm for the vertical FOV and 43.25mm for the diagonal FOV

Focal length is the number of millimeters from the lens to the focal point, it’s a property of a lens so i don’t think you find it directly equal to any number in OpenGL.

If you know what focal length your imaginary lens should have and what imaginary camera you want to simulate then you just calculate the FOV and use gluperspective. the Far and Near plane has nothing to do with that property, they are only there to clip anything outside those values, and thats not happening in real life.

Thank you very much for your kindly instructions. But I am sorry because I think I confused focal length with the distance from viewpoint to projection plane. So I want to explain my question again.

I use OpenGL to realize my algorithm. I need to change the distance from the viewpoint to the projection plane. I believed it is same to the concept of focal length at first. But From your explanation, I think they are different.

So do you know how to change the distance from the viewpoint to the projection plane by using OpenGL? Thank you I hope you could help me