Recommended Posts

I am implementing collision detection for a moving sphere and a given plane. I am using the RealTime Collision-Detection book as my reference and came across this part in the equation which I don't quite understand fully.
Assuming, Sphere, S(C, r) and Plane, PL(n, d) are defined, with S displaced by vector v. I want to find the time and point of contact of Sphere with plane PL.
PS: n is the unit normal vector
1. I understand that the Plane needs to be displaced towards the Sphere by r, but why??
(If S is on +ve side of PL) => Plane eq then becomes (after displacing):

(n.Q) = (d + r)

where Q = first point of Contact of S with PL
2. Also, Q is then defined as:

Q = ( C(t) - rn)

I understand C(t) part of it, but why do we subtract "rn" from it ?
[ . represents the DOT product ]
I have tried this on paper, but I still can't understand why

0

Share this post

Link to post

Share on other sites

1. I understand that the Plane needs to be displaced towards the Sphere by r, but why??

Do you know how to classify a point to a plane? In the general form of a plane P.N + D (Or more commonly Ax+By+Cz+D), D is the distance of the plane from the origin.When you have a sphere of radius R, you can subtract R from D to move the plane closer to the origin.

Once you do this, the sphere can be treated as a mere point as you pretty much negated it's radius. You would then take the sphere's position P and plug it into the plane equation to test if it's on or behind the plane. It's really just a trick to avoid more complex math than necessary.

This is off topic, but I'll share another scenario where you want to perform similar trickery. If you were using ellipsoidal volumes to encompass your objects, it would be expensive to test each ellipsoid against scene geometry due to their asymmetrical radii. What you would do is scale all points of the geometry to test by the reciprocal of the ellipsoid's radii. All those points can now be tested against the ellipsoid as a sphere, which eliminates the need for a whole bunch of extra divisions. This is good, because there were a lot to begin with!