Closest point triangle
To find the closest point on a triangle to a test point, we must first create a plane out of the triangle. Three points that are not in a straight line are coplanar. This means we can create a plane out of any triangle. Once we have a plane, we get the closest point on the plane to the test point. Next, we check if this new closest point is inside the triangle. If it is, we return it as the closest point on the triangle.
If the closest point was not contained within the triangle, it's going to be on one of the triangle edges. We must construct a line out of each triangle edge and find the closest point on each line to the test point. We then return the closest point to the test point of the three closest points from the last ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access