gluUnProject

gluUnProject(winx, winy, winz, …
where is the winz???

Look at the topic called “Placing trees on Terrain with mouse?” in the Advanced forum.

Regards.

Eric