# What are “view frustum”, “focal length” and near plane distance?

I've been reading through "Mathematics for 3D game programming and Computer Graphics" lately. Specifically definition of the view frustum and how the APIs generally process it, author introduces the concept of a length e which he classifies as the focal length. And it makes absolutely no sense, isn't the whole notion of focal length incompatible with the pinhole camera concept (inf. small) which is at the heart of 3D APIs as Direct3D and OpenGL? I thought all I need is the aspect ratio, the distance from the near plane and the FoV which can be established from the distance from the near plane.

And then he simply drops it and speaks of near plane distance n, which I thought was the actual value of e. What gives? Isn't the distance from the near plane the same as the "focal length" since we're talking about a pinhole camera? How do they differentiate?

The focal length controls the field of view. That is, they're mathematical transforms of each other: changing one changes the other. The longer the focal length, the smaller your field of view.

So your FOV parameter is merely a re-stated form of the focal length.

The "common projection matrix" doesn't really use a focal length. The actual focal length is always the same. These matrices implement FOV as a scale applied to the X and Y camera-space coordinates. This is just to make the math easier; being able to keep the eye point at a fixed location makes the math simpler. But in terms of the results, either produces the same results.

Isn't the distance from the near plane the same as the "focal length" since we're talking about a pinhole camera?

No. The near plane is irrelevant; the near/far planes exist solely for near/far culling of rasterized triangles. They're important mathematically for computing the depth value (which ties into depth buffers), but they have no effect on the visuals of the scene (outside of depth buffer artifacts from having a close near plane).

• this seems wrong, if you make your own projection matrix and alter nothing but the near plane distance, the view zooms in and out... right? – user36169 Jun 17 '14 at 2:52
• I had the same issue as user36169. Problem was my projection matrix was transposed! Literature always says OpenGL is column-major but it's actually row-major in memory. – Hugo Maxwell Dec 6 '17 at 13:48
• @HugoMaxwell: No, it's column-major. Generally speaking, if you look at what "literature always says" (and I mean real literature, not random tutorials on the Internet), and you feel that it's wrong, that's more likely that your understanding of things is what's wrong. – Nicol Bolas Dec 6 '17 at 15:24
• Yeah it depends what you mean by major. I thought major stands for the dimension which is incremented when incrementing the array index. But turns out it's a visual major and not a programmatic major. – Hugo Maxwell Mar 6 '18 at 13:14