How to get mouse position on OGL Scene

Started by
2 comments, last by Toubou 21 years, 8 months ago
like 1.0f, 3.4f, 5.3f
I am a beginner
Advertisement
the mouse doesn''t have a z coord. you can''t move it into the screen. -PmanC
POINT current;
GetCursorPos(& current);

Then current.x/current.y is your position.

Luigi
(www.lp23.com)

[edited by - lp23 on July 29, 2002 2:15:23 AM]
If you want to get the world coords of the current mouse position, use gluUnProject(...). When you pass 0.0f for winz you get the world coordinate on the near plane and if you pass 1.0f you get the one on the far plane.

Hope this helps,
Gero Gerber

This topic is closed to new replies.

Advertisement