I have two coplaner triangles in a 3D world, and I need to find a polygon, which is the the intersection between them. However, the triangles are not always along the axes, but they will always be coplanar. What algorithm can I use to find that polygon? I am struggling to find a resource that gets this. C++ preferred.

没有正确的解决方案

其他提示

If they are coplanar, they are all on a plane in 3d, like this:

p = p0 + p1*s + p2*t

All the triangle vertices on this plane can be expressed as just s and t. You can pick p0 as one of the triangle vertices and p1 and p2 as edges of one triangle. Then solve for s and t for every p that is a triangle vertex. Then do the problem in 2d with s,t coordinates. Once you are done, you can just use the result s and t coordinate to go back to 3d.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top