Archived

This topic is now archived and is closed to further replies.

How to get mouse position on OGL Scene

This topic is 5651 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

the mouse doesn''t have a z coord. you can''t move it into the screen. -PmanC

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites