Jump to content
  • Advertisement
Sign in to follow this  
JasonBaldwin

[SOLVED]Testing collision between mouse and 3D geometry

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

Im not sure how i can use a 2d point (ie the mouse position) to test if it intersects with 3D geometry. Any links to tutorials or information on how to do this would be appreciated. Thanks [Edited by - JasonBaldwin on October 12, 2008 2:05:44 PM]

Share this post


Link to post
Share on other sites
Advertisement
You can get the direction into the 3D-world for each point on your screen. So you end up with a line from your camera position, in some direction, and you can intersect-test that line with your geometry. Also, if you have already drawn your geometry, you can use the z-value in the depth-buffer to directly un-transform a 2D-point to the 3D-point visible at that point on the screen.
If you tell us which API you use, and how you store your matrices, it will be easier to tell you more exactly.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!