Sign in to follow this  

Detecting Intersection Without D3DXIntersect

This topic is 4831 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 all, Im writing a game in which i have a vertex buffer that contains vertices for 20 cubes. Each cube occupies 36 vertices as a triangle list. How do i test to see if the vector for the pick ray intersects with this cube. I assume i'd have to test each triangle for intersection? Where can i find the maths for this simple triangle/ray intersection. any help is appreciated, ace

Share this post


Link to post
Share on other sites
Are you sure it wouldn't be easier to do this outside of the graphics system? I mean, you must have non-graphics data for your cubes somewhere, right? (Position, rotation, etc - the data you use to generate the vertices).

You should just be able to pull your ray back through the projection/view matrices to get it in world coordinates, and then you can collide it against your cubes directly, which ought to be easier (20 tests instead of 20*12 tests).

Share this post


Link to post
Share on other sites

This topic is 4831 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.

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