Sign in to follow this  
JasonBaldwin

[SOLVED]Testing collision between mouse and 3D geometry

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this