1
$\begingroup$

The part confusing about opengl during studying the projection was that the focal length, top, left, bottom, right, wasn't declared, and it magically did it with FOV and image aspect ration. I found the wonderful maths in this amazing site, and found out how it is calculated based on FOV and focal length.
Two points I noted for my confusion was:

  • near clipping plane is the plane which limits the projected coordinates, and
  • focal length is the distance from the point of projection to the optical center( (0,0,0) in our case )

Now, the question is, is the focal length always equal to the distance of the near clipping plane from the optical center, i.e. in other words, is the image always projected on the near clipping plane (or at least in openGL)? Yet in other words, is the near clipping plane and the plane of projection the same thing just with different terms.

$\endgroup$
1
  • $\begingroup$ but focal length is calculated for a simulated camera with some imaginary film size. So No. $\endgroup$
    – joojaa
    Commented Jan 25, 2021 at 17:30

1 Answer 1

2
$\begingroup$

For some reason most sites choose to leave the projection plane out of the visualization of the view frustum. The focal length often labeled "g" is the distance from the camera to the projection plane. The projection plane (which is blue in the attached image) is almost always placed at a distance from the camera such that the distance from the center to the top and bottom is 1. This image from the fged website shows it well: enter image description here This choice is a matter of convenience since it makes the math all work out nice and neat. As you can see the near plane can, and often is, behind the projection plane. (the green plane in the image is the near plane)

For your second confusion: One goal of the projection matrix is to force coordinates with a z value less then that of the near plane to fall outside of the near clipping region which is -1 in OpenGL. So any coordinate that has a z value less then near value will result in a z value below -1 after projection.

$\endgroup$
2
  • 1
    $\begingroup$ There is no ideal focal length, it is perfectly reasonable to choose a near plane and a projection plane that coincide. The near plane acts to clip geometry. The focal length acts like a lens that scales geometry. Increasing the focal length zooms in on distant geometry because the projection plane is closer to it, or beyond it. This is exactly how most games implement a zoom effect, they simply move the projection plane farther from the camera by increasing the focal length. $\endgroup$
    – pmw1234
    Commented Oct 23, 2021 at 13:18
  • 1
    $\begingroup$ Thank you for those clarifications. I actually realized that my comment didn't make much sense because I got confused. : ) $\endgroup$
    – KeyC0de
    Commented Oct 23, 2021 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.