Coming from Let's continue 3d II, where the central concept of 3d projection got explained (hopefully successfully ;-) - ie division by Z in order to make objects in the distance be projected closer to the center of the finished projection - we now improve the mechanism a little:
In order to really project all points onto the plane z=0, we change the formula from:
Xscreen = X3dspace/Z and
Yscreen = Y3dspace/Z
-to-
Xscreen = X3dspace / (Z+1) and
Yscreen = Y3dspace / (Z+1)
we still need to prevent the algorithm from encountering a division by zero - which would occur now when Z=-1 - that is (in distance of the unit 1) on the other side of the screen plane. That comes in handy, since we also need to clip away all geometry thats on that side of the screen (Like, in reality, a painter would not paint objects behind him and a camera does not take pictures behind the camera man)
(In the left picture you see that only objects in front of the screen become drawn. The objects in the red area (behind the screen) will not be drawn onto the screen then. In the right picture, you see two points, one of it becomes clipped - the other projected)
continue reading on the next page: lets continue 3d IV: "Camera Space"