http://www.opengl.or...depthbuffer.htm

EDIT: mathematical explanation.

gluPerspective constructs the projection matrix as such: (a = width / height)

e 0 0 0

0 ea 0 0

0 0 -(f+n)/(f-n) 2fn/(f-n)

0 0 -1 0

resulting in the depth value being computed as: (in HCC)

z' = x*0 + y*0 - z(600)/(600) + w*0/(600) =

**-z**

w' = x*0 + y*0 + z*-1 + w * 0 =

**-z**

During perspective division, the value for the depth to be stored in the depth buffer (in NDC) would be computed as:

Z = z / w = -z / -z =

**1**

which, in this case, since n was set to 0, would always be 1, and therefore outside the range of depth and never rendered, or never stored in the depth buffer. All calls to gluUnProject would then return 0.