寻找两个全等三角形之间的旋转

发布于 2024-11-10 08:43:46 字数 389 浏览 0 评论 0原文

我正在开发 3D 网格解析工具。目前,我正在尝试确定 3D 空间中两个全等三角形之间的旋转 - 我们将它们称为 ABCDEF

我能够将点 AD 平移到同一位置,现在需要确定将 DEF 放置在同一平面上的旋转与 ABC 方向相同,但我对数学不够熟悉,无法做到这一点。谁能告诉我如何解决这个问题?

我一直在考虑使用 ABDE 的叉积来确定旋转轴,然后使用点积来找到角度,然后用它们制作一个四元数;但我不知道这是否总是能让它们正确对齐。

我上面的想法是不是有误?它总是对齐三角形吗?如果不能,有什么替代方法可以找到轮换?

I'm working on a 3D mesh parsing tool. Currently, I'm trying to determine the rotation between two congruent triangles in 3D space—we'll call them ABC and DEF.

I'm able to translate points A and D to the same location and now need to determine a rotation that would place DEF on the same plane and in the same orientation as ABC but I'm not familiar enough with the math to do it. Can anyone tell me how I can tackle this?

I've been thinking of using the cross product of AB and DE to determine a rotation axis, then the dot product to find an angle, then making a quaternion out of them; but I don't know if that will always properly align them.

Am I mistaken about the above idea? Will it always align the triangles? If it won't, what is an alternative way to find a rotation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

狼性发作 2024-11-17 08:43:46

你的第一部分将AB旋转到DE(或其他方式)。但这只能对齐一条边。要对齐其他两个,您仍然需要将 C 旋转到 F 上(第一次旋转后)。可以通过使用您提出的方法将三角形的两个面法线相互旋转来计算必要的角度和轴(从您的问题我想您知道如何计算三角形的面法线)。

编辑:因此按顺序执行以下步骤:

  1. 将A平移到D
  2. 上将AB旋转到DE上
  3. 通过将三角形的面法线相互旋转将C旋转到F上

您必须采用已经部分的面法线变换后的三角形(第 2 步之后),但它们可能与原始三角形相同(对此不确定)。然后,您可以将这些转换连接成一个。

Your right with your first part rotating AB onto DE (or the other way). But this only aligns one edge. To align the other two, you still need to rotate C onto F (after your first rotation). The neccessary angle and axis can be computed by just rotating the two face normals of the triangles onto each other using your proposed approach (from your question I suppose you know how to compute the face normal of a triangle).

EDIT: So take these steps in order:

  1. Translate A onto D
  2. Rotate AB onto DE
  3. Rotate C onto F by rotating the face normals of the triangles onto each other

You have to take the face normals of the already partly transformed triangles (after step 2), but it could be that they are the same as the original ones (not sure about that). You can then just concatenate those transformations into one.

你好,陌生人 2024-11-17 08:43:46
  1. 平移 ABC,使 ABC 在 A 处的曲面法线与底边的 D 点重合。
  2. 旋转 ABC,使 A 处的曲面法线与 D 处的曲面法线重合。
    这是唯一棘手的部分。幸运的是,这是很常见的事情。这与旋转 3D 相机方向相同。 Google 找到了此参考
  3. 现在以 A 为原点旋转三角形 ABC,使 B 和 C 与 D 和 E 重合。这是标准的 2D 旋转矩阵。
  1. Translate ABC so that the surface normal of ABC at A coincides with point D at the base.
  2. Rotate ABC so that the surface normal at A coincides with the surface normal at D.
    This is the only tricky part. Fortunately, this is a very common thing to do. It's identical to rotating the 3D camera direction. Google found this reference.
  3. Now rotate triangle ABC with A at the origin so that so B and C coincide with D and E. This is a standard 2D rotation matrix.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文