View Full Version : gluUnProject, mouse cords?
02-26-2001, 04:07 PM
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.
02-27-2001, 02:37 AM
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.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.