What's the most efficient way to detect triangle-triangle intersections?

前端 未结 5 1185
广开言路
广开言路 2020-12-08 23:37

How can I tell whether two triangles intersect in 2D Euclidean space? (i.e. classic 2D geometry) given the (X,Y) coordinates of each vertex in each triangle.

5条回答
  •  余生分开走
    2020-12-08 23:42

    What you're really looking for is a "Point in Polygon" algorithm. If any of the points of one triangle are in the other, they are intersecting. Here is a good question to check out.

    How can I determine whether a 2D Point is within a Polygon?

提交回复
热议问题