PDA

View Full Version : depth, mouse clicks and x,y space



ajbiv
02-13-2009, 04:58 PM
In orthographic projection, i received a mouse click. Because my glOrtho() call used the width and height of my view, i knew exactly where to draw an object (ie the mouse click x,y and my z could be anything)

Now that I'm working with a frustum, I'm not sure where to draw an object based on the input of a mouse click. I don't seem to understand what my x/y coordinate space is at a given z.

Can someone help me understand or tell me where i'm thinking about it wrong?

dletozeun
02-13-2009, 05:05 PM
Look at the gluUnproject (http://www.opengl.org/sdk/docs/man/xhtml/gluUnProject.xml) function. It should help to start.