# 3D collisions

This topic is 2782 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
Moving you to the Maths & Physics forum -- I think you'll get better/more responses to this there.

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

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

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

1. 1
2. 2
Rutin
29
3. 3
4. 4
5. 5
khawk
14

• 11
• 11
• 23
• 10
• 9
• ### Forum Statistics

• Total Topics
633647
• Total Posts
3013108
×