Sphere - Polygon collision detection

Started by
3 comments, last by Xeno 21 years, 6 months ago
how do i check for an intersection between a polygon and a sphere?

------------------------------- Goblineye Entertainment------------------------------

Advertisement
You need to find the closest point from the center of the sphere to the plane that the triangle lies on, and then check to see if it inside the triangle. If so, then you check the distance between that point and the center of the sphere. If that passes, then you definitely have a collision. If not, then you have to check to see whether the sphere has collided with an edge. The algorithm is pretty simple, if you need more specific math, I can post the actual equations for you.
how can i know which point on the sphere is the closest to the triangle?

------------------------------- Goblineye Entertainment------------------------------

The closest point on the sphere isn''t what you need. The closest point on the plane that the triangle is on to the center of the sphere is what you need. You should be able to do a simple google search to find code to do it, or I can post some.
post some if you can
thanks

------------------------------- Goblineye Entertainment------------------------------

This topic is closed to new replies.

Advertisement