picking and z-value

Hi,
I have draw 2 squares; one with z-value -1, other
0. I implemented picking. But when I pick on
overlapping area, hits number is 2. Why?
Red book seems to say that use different z-values
if right to obtain the selection of object not
closest (hits=1)…
Thanks

The Z value returned in picking is scaled a little different from what you use as a Z coordinate so you can not use the values as it is, if you have a peek at the OpenGL spec it explains how it works.

gluUnPrject?

Thanks