sphere collision

Started by
13 comments, last by Dmytry 19 years, 3 months ago
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
Advertisement
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.
enum Bool { True, False, FileNotFound };
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
Something that might be useful,
Pool Hall Lessons: Fast, Accurate Collision Detection between Circles or Spheres

(may require a gamasutra.com login, but registration is free [and worth it])

John B
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
that article i read and its useful to explain the sphere collision, but i didnt find it useful for point of intersection
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]
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?
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.
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?
Quote:Original post by ramy
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?


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, 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 works in 3D . In fact, works in any numbers of dimensions (what in my post could have suggested otherwise?))

This topic is closed to new replies.

Advertisement