Sign in to follow this  

sphere collision

This topic is 4730 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 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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
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?))

Share this post


Link to post
Share on other sites
Quote:
Original post by ramy
again perfect, but wat about different radiuses?

spheres have radiuses r1 and r2
in
P=(r1*C1+r2*C2)/(r1+r2)

That's is, obviously spheres can have different radiuses in my formula.
P=(r1*C1+r2*C2)/(r1+r2)
is for general case (r1 may be equal or not equal to r2) and
P = (C1+C2)/2
is for special case when r1=r2

Share this post


Link to post
Share on other sites

This topic is 4730 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this