我有一个三角形和一个平面(在3D空间内),如何计算它们相交的线段,如果没有相交则需要检测出这种情况。
我希望的最终结果是两个三维向量,它们定义了线段的起点和终点。
为了帮助你们,我已经计算出了面的平面与平面之间的交点光线,我只需要找到端点来将该光线剪切成一个线段。
对于那些喜欢看代码的人:
我希望的最终结果是两个三维向量,它们定义了线段的起点和终点。
为了帮助你们,我已经计算出了面的平面与平面之间的交点光线,我只需要找到端点来将该光线剪切成一个线段。
对于那些喜欢看代码的人:
Face face; //a face, defined by 3 points
Plane plane; //a plane, defined by a normal vector and a distance
Ray intersection; //a ray, defined by a point and a direction, initialised to the intersection of the face plane and the face
Segment s = CalculateSegment(face, plane, intersection); //this method needs defining