March 2017
Intermediate to advanced
480 pages
11h 3m
English
To test if a sphere and a triangle intersect, we must first find the point on the triangle that is closest to the center of the sphere. If the distance between the center of the sphere and the closest point is less than the radius of the sphere, we have an intersection:

We are about to implement a function that tests if a triangle and sphere intersect. This function will return a Boolean result. We avoid the expensive square root operation involved in finding distance by checking squared distance against squared radius.
Follow these steps to implement a test for checking if a triangle and sphere intersect: ...
Read now
Unlock full access