It is written in many places that the Z value of a point is transformed to the range 0 to 1 by the projection matrix. But when I do the math myself, I get -1 to 1. What’s up?

Originally posted by Jambolo:
the Z value of a point is transformed to the range 0 to 1 by the projection

This is correct. The window coordinates are different from world coordinates. 0.0 is the Z value at the near clipping plane and 1.0 at the far clipping plane.

It also states in the Red book that values outside that range are converted to that range I believe (someone correct me if I am wrong here, please). Which is why your -1 is being returned as a 1.