
The four values produced are X, Y, Z and W. These are called homogeneous

coordinates and they're used for projection. What we do next with these

coordinate values is divide each value by the W of the coordinate. This is

called the prospective divide or homogeneous divide. So for our three test

points we had a value such as 0, 0, negative 1, 1. Dividing by 1 is simple

enough. That gives us 0, 0, negative 1. We don't need to bother writing out the

W value in the results, since W divided by W will always equal 1. For our next

point, W is 11. Dividing all these coordinates by 11 gives 0, 1, 1. Our last

point is a little more interesting. Dividing through by W gives us 0, 0.67,

0.83. Here are plots of the original points and view space and their

corresponding new locations. Notice that the negative Z axis is pointing to the

right for the frustum, and the resulting axis is plus Z to the right. Look at

what's happened with these points and where they're transformed. They started

inside or on the edge of our frustum. After the projection matrix is applied

and division by W is performed the resulting points are in normalized device

coordinates, anything in the range negative 1 to 1 for X, Y and Z is in the

visible view volume. Let's take another example to show what happens to three

objects that are the same size in world space but at different distances. When

we transform to normalized device coordinates the relative area of coverage of

the near plane stays the same. That is, the close object was half as high as

the screen in our frustum view and transforms to half the height in NDC space.

The second object is farther away and shows up as smaller. The third object on

the back of the frustum is indeed much smaller than the others in normalized

device coordinates. You might have noticed an interesting thing has happened to

the depth of the second object. It started in the middle but it's moved

backwards. We'll talk more about that in a bit as it's important.