Jump to content
  • Advertisement


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


Mouse coords in OGL

This topic is 6105 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

Hi, I have been working in OpenGL for a while now but i''ve only been making demos, nothing much interactive, now i''m working on a game and I need to know how to use the mouse coordinates in OpenGl, this is difficult because of the layout of the world being 3d and the mouse coords being 2d, I remember I saw an article a few weeks back somewhere, but for the life of me I can''t find it again, if anyone knows the article i''m talking about or another article of the same type, please post it, thanks a lot.

Share this post

Link to post
Share on other sites
I don't know the article you are talking about, but I can tell sth. basic. You can't exactly know where the mouse is, because you have projected a 3D space on a 2D plane, so every point on the plane corresponds to an infinite number of points in the 3D Space. But there are some ways to implement e.g. object picking. There you can pick the object with the mouse from the screen, OpenGL even offers support for this. Look at NeHes OpenGL and game programming Tuts, somewhere there is one about this topic.

Greetings Ben

Edited by - Ben_ on November 3, 2001 5:14:17 AM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!