需要确定一个矩阵来对齐两个三角形
我需要确定一个矩阵,表示在 3D 中对齐两个已知全等三角形所需的变换。我之前曾尝试询问是否采取不同的方法,但我一直遇到了很多障碍,所以我现在正在考虑尝试不同的想法。
有谁能够指导我如何创建一个矩阵来表示将三角形 (DEF
) 移动到与另一个三角形 (ABC
ABC) 相同的位置和方向所需的平移和旋转code>) 其中 A
位于原点?
I need to determine a matrix representing the transform required to align two known-to-be-congruent triangles in 3D. I've previously tried asking about taking a different approach but I've been hitting a lot of snags with it so I'm now looking at trying different ideas.
Is anyone able to direct me to how I can just create a matrix to represent the translation and rotation required to move a triangle (DEF
) into the same position and orientation as another (ABC
) where A
is at the origin?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
第一。想一个“基本”三角形。 XYZ,当 X = (0,0,0)、Y = (1,0,0) 和 Z 时,取决于角度。
第二。对于每个三角形,找到将其移动到“基本”的方法。
对于 DEF 来说,使用基本移动动作将 D 移动到 A。绕 z 旋转直至 E 位于 xz 平面内,绕 x 旋转直至 F 位于 xy 平面内 x+ 侧。
如果这很清楚,那么您就知道如何创建一个矩阵来将每个三角形移动到同一个基本三角形。
现在..如果你采用一个识别矩阵,并且对于你在矩阵右侧(第二个)上执行的每个操作,你将在识别矩阵的左侧执行相反的操作,你最终将得到一个可以从矩阵移动的矩阵基本三角形到你的三角形。
我希望它能成为降神会,用英语解释对我来说有点困难......
1st. think of a "basic" triangle. XYZ when X = (0,0,0), Y = (1,0,0) and Z where ever, depending on the angles.
2nd. for each triangle find the way to move it to this "basic".
for DEF it's, move D to A using basic move action. rotate around z until E is in xz plan, rotate around x until F is in xy plan in the x+ side.
if that's clear then you know how to create a matrix to move each triangle to the same basic triangle.
now.. if you take an Identify matrix, and for every action you do on (2nd) on the right side of the matrix you will do the opposite action on the left of Identify matrix, you will end up with a matrix to move from the basic triangle to your triangle.
I hope it make seance, explaining in English is a bit difficult to me...
我想到的一个想法(这可能既不是最简单也不是最有效的做事方式)是首先计算 三角形的圆心。然后,可以使用穿过它们的唯一线来构建翻译矩阵,让您可以拖动一个三角形到另一个三角形(可能使它们相交)。
由于有了三角形,您还可以计算包含它们的各个平面的方程、这些平面之间的角度,以及 旋转矩阵,以便两个三角形最终位于同一平面上。最后,您需要应用最后一次旋转来匹配现在位于同一平面上的三角形。
One idea that comes to my mind (and this may be neither the simplest nor the most efficient way to do things) is to begin by computing the circumcenters of your triangles. The unique line passing through them can then be used to build the translation matrix that will let you drag one triangle onto the other (possibly making them intersect).
Since you have the triangles, you can also compute the equations of the respective planes that contain them, the angle between those planes, and therefore also the rotation matrix that you need to apply so that both triangles end up in the same plane. Finally, you need to apply one final rotation to match your triangles that now lie in the same plane.