# sphere collision

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

## Recommended Posts

Hi guys, I have a kinda problem, it is sphere collision. i want to know the intersection point (or collision point) of two sphere after i check if they collide or not. can any body help? thx in advanced and, happy new year :D

##### Share on other sites
For spheres, the witness point (point of deepest penetration) is always on the axis between the two sphere centers.

For swept spheres with a time parameter (i e, where two moving spheres first touch), it's harder -- there's code on Dave Eberly's Site to do it.

##### Share on other sites
i know the point is somewhere on the line between the two sphere.

but i dont know how, and i didnt quite understand from magic software i had a look at it before, it had paramaters that i didnt understand.

i want somebody to explain it to me plz :d

##### Share on other sites
that article i read and its useful to explain the sphere collision, but i didnt find it useful for point of intersection

##### Share on other sites
1:If spheres intersect, there's not a single point of intersection but some volume of intersection.
2: If you need "some point" that you can use as point of intersection, if spheres have radiuses r1 and r2, and centers C1 and C2, point
P=(r1*C1+r2*C2)/(r1+r2)
can be used as point of intersection. If spheres intersect, it is placed inside both spheres.(proof is trivial)

Of course, if r1=r2,
P = (C1+C2)/2 = point on center of line between sphere centers.
There C1,C2,P is vectors.

And, Happy New Year :-)!

[Edited by - Dmytry on December 31, 2004 4:14:11 PM]

##### Share on other sites
ok Dmytry, i got ur reply, thx alot, it helped me understand but...

it is quite easy actually thx :d but will this work in 3d? cause i have different radiuses for each sphere :S as i recognized i think, and correct me if im wrong, this only works for spheres with same radiuses right?

##### Share on other sites
the different between 3d and 2d is simply 3d has another component. and it does work on 3d. the eq P = (C1+C2)/2 is to help you understand.

##### Share on other sites
i got it thx ;) but if i have different radiuses wat will happen? should i increase the small radius till it its the same as big radius and calculate that little thing? and then negate the difference?

##### Share on other sites
Quote:
 Original post by ramyi got it thx ;) but if i have different radiuses wat will happen? should i increase the small radius till it its the same as big radius and calculate that little thing? and then negate the difference?

Quote:
 2: If you need "some point" that you can use as point of intersection, if spheres have radiuses r1 and r2, and centers C1 and C2, pointP=(r1*C1+r2*C2)/(r1+r2)can be used as point of intersection. If spheres intersect, it is placed inside both spheres.(proof is trivial)

(of course works in 3D . In fact, works in any numbers of dimensions (what in my post could have suggested otherwise?))

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5

• 13
• 19
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
632933
• Total Posts
3009299
• ### Who's Online (See full list)

There are no registered users currently online

×