Jump to content
  • Advertisement
Sign in to follow this  
ramy

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.

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

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
that article i read and its useful to explain the sphere collision, but i didnt find it useful for point of intersection

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
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 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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!