Jump to content
  • Advertisement
Sign in to follow this  
jagguy2

3D collisions

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

I am still confused about how ray plane intersection works for 3D objects like a missile and building or walking into a solid object.
I am needed it for a computer game but i prefer to understand the mathmatics first.
I think the issue is that I need an example with real coodinates.

Share this post


Link to post
Share on other sites
Advertisement
Moving you to the Maths & Physics forum -- I think you'll get better/more responses to this there. smile.gif


...and this is not my strong point, so I won't try to actually answer myself, but a small effort to perhaps point you towards some resources...


Doing a quick [color="#0000FF"]Google for "ray plane interection example" turned up a couple of potentially useful results:
  1. [color="#0000FF"][color="#0000FF"]The Wikipedia page[color="#000000"] (first result) provides a good explanation of the theory but no worked examples -- I take it you have the theory and are looking for worked examples though?
  2. [color="#0000FF"][color="#0000FF"]This page (second result) has theoretical explanations, but provides some sample C++ code if you scroll down near the bottom.
  3. [color="#0000FF"]This page (third result) gives an example calculation.

Are you interested in sample code, or did you just want to see an example "on paper"?

Share this post


Link to post
Share on other sites

I am still confused about how ray plane intersection works for 3D objects like a missile and building or walking into a solid object.
I am needed it for a computer game but i prefer to understand the mathmatics first.
I think the issue is that I need an example with real coodinates.


Its actually pretty simple:

[attachment=2048:figure1.png]


Its all about finding the ratio of d0 to d1 in the diagram. That ratio tells you how much of d1 there is in d0 at the time of intersection, which also tells you the exact 'time' (from 0 to 1) of the intersection point I, along the ray A->B

ratio = d0 / d1

You can find d0 and d1 using the dot product of the ray against the plane :)

Cheers, Paul.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!