View Full Version : MouseCoords

07-16-2001, 08:24 PM
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

07-17-2001, 03:05 AM
Check out gluUnProject.

Kilam Malik
07-17-2001, 03:43 AM
First get the z-value from the z-buffer with glReadPixels. Then use your (x/y/z-buffer) values as parameter for gluUnProject.