• Advertisement
Sign in to follow this  

Detecting Intersection Without D3DXIntersect

This topic is 4905 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
Advertisement
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
Quote:
Original post by ace_lovegrove
Where can i find the maths for this simple triangle/ray intersection


This is a great collision detection reference.

Share this post


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

  • Advertisement