projection - frustum to a NDC cube mapping

stagger

New member
Joined
Jul 19, 2020
Messages
4
This particular resource about projection matrices tells us:
that while projection, the points within the view frustum are mapped to the range [-1,1](later converted to [0,1]). But, also the z coordinates are mapped to [0,1], hence the view frustum is converted to a unit view volume.

But, when we project the z coordinates onto a plane at z' , shouldn't all the z coordinates be z', therefore resulting in a plane? What am I not understanding in this projection mechanism?
 
Normally the z coord would not actually undergo the projection process because, as you say, you'd just obtain the same result for all the points in your 3d scene. This would not be very useful. So the z value immediatly prior to projection is used to obtain the projection of x & y, and then z is just mapped to be a number [0,1] within the clipping planes that you've specified (or if the point is outside the clipping range then it's discarded). This value can then be used to determine which features are visible using a "z-buffer" (that is, working out if the point is hidden by something that is closer to the camera)
 
Thank you so very much for replying. But, I have a confusion. When x & y are projection, they are projection by the projection matrix and then converted to NDC by 'w' division.But, if z is not projection, how is it converted within the range [0,1]?
 
The following link has a good explanation of how the projection matrix is formed within OpenGL:- http://www.songho.ca/opengl/gl_projectionmatrix.html. Look part way down the page for the variables "A"and "B" calculated from "n" (near) and "f" (far clipping plane). It seems z is actually mapped to the range [-1,1].

NOTE: the link that you provided in your first post seems to contain less detail, is it from a course that you are currently studying? They may perform the "projection process" in a different way to OpenGL, so it might not be appropriate for you to study the above link (and likewise my post #2 was based on my understanding of OpenGL, which is a very common rendering library).
 
Top