MouseCoords

ok, when i get x,y coords from glutMouseFunc
how can i convert it to 3d space coords, and how can i get z coord?

trying to do this:
i have many GL_QUADS(only x,z changes,y is the height of gl_quad,currently always 0.0f)

when i get the x,y coords from glut i need to search for the right GL_QUAD and change that’s y coord

gl_quads are stored in mutated binary tree

from my last post someone sayd to use gluUnProject but it doesn’t return right values

Check out gluUnProject.

First get the z-value from the z-buffer with glReadPixels. Then use your (x/y/z-buffer) values as parameter for gluUnProject.

Kilam.