The problem is the parameters you pass to glReadPixels.
Try
glReadPixels(1, 1, x, y, ...)
assuming x and y are higher than 1. I already answered this exact question in the gl ng. Are you that same person?
Besides, why not do
glReadPixels(0, 0, x, y, ....)
V-man



glReadPixels always return 1 in my Z variable.
I try this but my program crash.. :0 But the parameter of the glReadPixels is not glReadPixels(mouse.x, mouse.y, width of a pixels, height of a pixels, format, type, return value)??