计算 3D 空间中三角形的垂直平面

发布于 2024-08-24 22:18:19 字数 228 浏览 4 评论 0原文

我在 3D 空间中有一个三角形,由其 3 个顶点 p0、p1 和 p2 定义。

我希望计算这个 3D 空间中的一个平面,该平面沿着 p0 和 p1 并面向第三个点 p2。

该平面由位置和标准化方向定义/

除了沿着 p0 和 p1 并面向 p2 之外,该平面还应该垂直于由 p0、p1 和 p2 创建的平面,

我一直在努力解决这个问题很长一段时间了,非常感谢任何人可以提供的帮助。

I have a triangle in 3D space defined by its 3 vertices, p0, p1, and p2.

I wish to calculate a plane in this 3D space which lies along both p0 and p1 and faces a third point, p2.

This plane is to be defined by a position and normalised direction/

In addition to lying along p0 and p1, and facing p2, the plane should also be perpendicular to the plane created by p0, p1, and p2

I've struggled with this for quite a while and any help anyone can offer is greatly appreciated.

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

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

发布评论

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

评论(2

对岸观火 2024-08-31 22:18:20

你的问题问得不恰当。对于位于 p0 和 p1 上的任何平面,该平面上都会有一些点“面向”点 p2。因此,剩下需要计算的就是沿 p0 和 p1 的某个平面。

normal = normalize(cross(p1-p0, pX-p0))  //pX is anything except p1
planePoint = p0

编辑:查看评论

的示例

这是我的评论解释octave:14> p0
p0 =

0 0 0

倍频程:15> p1
p1 =

0 0 5

倍频程:16> p2
p2=

5 0 0

倍频程:17>交叉(p1-p0,交叉(p1-p0,p2-p0))
ans =

-125 0 0

您会注意到符号是错误的,请调整叉积中参数的顺序,使其面向正确的方向。另外不要忘记标准化......但它不会影响方向。还要检查以确保每个叉积后的范数不接近 0,否则没有唯一的答案..(三角形形成一条线)

Your question is ill-posed. For any plane that lies on p0 and p1 there will be some point on that plane that "faces" point p2. So all that's left to compute is some plane along p0 and p1.

normal = normalize(cross(p1-p0, pX-p0))  //pX is anything except p1
planePoint = p0

EDIT: see comments

here is an example of my comment explanation

octave:14> p0
p0 =

0 0 0

octave:15> p1
p1 =

0 0 5

octave:16> p2
p2 =

5 0 0

octave:17> cross(p1-p0, cross(p1-p0,p2-p0))
ans =

-125 0 0

You'll notice that the sign is wrong, play with the order of parameters in the cross product to get it facing the right way. Also don't forget to normalize...but it wont affect the direction. Also check to make sure the norm after each cross product isn't near 0, otherwise there is no unique answer.. (triangle forms a line)

迷荒 2024-08-31 22:18:20

除非我误解了你的要求,否则从直线到 p2 的向量将是你试图定义的平面的法线。基本上,您可以构建一条与线 p0-p1 成直角并穿过 p2 的线。

Unless I'm misunderstanding what you're asking, a vector from the line to p2 will be the normal to the plane you're trying to define. Basically, you construct a line at right angles to the line p0-p1, running through p2.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文