Jump to content
  • Advertisement
Sign in to follow this  
dave

Detecting Intersection Without D3DXIntersect

This topic is 5196 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
yeah i guess, i hadnt really thought of that,

Im still not entirely sure of how to do that though.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!