gluUnProject, mouse cords?

I’ve read all the messages on the board but I don’t really understand how I can get all the cords of the mouse when its clicked in 3d space. I just have a flat floor and I want to make it so when I click on the floor I can tell how deep the click is. I have a demo that someone wrote up but the z axis does not change. Any suggestions or source code would be appreciated.

If you use gluUnproject(winx,winy,winz,…)
winz=0 is the near clippingplane and winz=1 the far clipping plane.
You can use this to get a projectionline and look where it intersects with your floor plane.
The hard thing will be to get your plane equation for the floor after doing some viewingtransformations.