在 3D 空间中任意变换的等边三角形的法线

发布于 2024-08-17 23:10:57 字数 683 浏览 10 评论 0原文

我有一个问题,我似乎无法找到起点;我什至不确定我是否可以很好地描述它以获得答案。

我需要在 3D 空间中找到等边三角形的法线,而无需事先知道三角形的点。考虑从任何角度拍摄三角形“让行”街道标志的照片,并从该照片确定标志的外向法线。 (确切地说,我没有这样做,但类似 ​​- 所以从这里开始我将使用标志/照片隐喻)。

**更新**:在我询问我的版本的前一天出现了同样的问题,您可以查看这里。感谢 BlueRaja 给我指点。我认为那里的讨论会回答这个问题。然而,下面介绍的计算方法也非常有趣。

我知道在代码中创建三角形时如何找到三角形的法线,但不确定如何将点映射到 3D 照片中的三角形。我知道每条边的长度,所以我知道这些点在任何方向上应该相距多远。我可以构建一个交互式工具,可以覆盖一个三角形并将其旋转到位并从中获取点,但我需要在没有交互的情况下执行此操作。这样做也无助于我弄清楚所涉及的数学。

我什至不确定是否需要确定这些点,而只是找到正确的旋转矩阵。

我只是不知道从哪里开始......搜索这个概念是空的,或者只是不是我想要做的(例如:它们是 2D 变换而不是 3D)

也有可能我过于复杂事情,有一个简单的变换方程可以在睡眠中做到这一点。

想法?提前致谢!

I have an issue that I can't quite seem to find a starting point on; I'm not even sure I can describe it well enough to get an answer.

I need to find the normal of an equilateral triangle in 3D space without knowing the points of the triangle beforehand. Think about taking a photo of a triangular "yield" street sign from any angle, and determining the out-facing normal of the sign from that photo. (I'm not doing that, exactly, but similar - so I'll use the sign/photo metaphor from here on).

** UPDATE **: This same question came up the day before I asked my version, which you can view here. Thanks to BlueRaja for pointing me there. I think the discussion there will answer the question. However, a computational approach is presented below which is also very interesting.

I know how to find the normal of a triangle when I create the triangle in code, but am unsure of how to map points to the triangle in the photo in 3D. I know the length of each side, so I know how far apart the points should be in any orientation. I can build an interactive tool that I can overlay a triangle and rotate it into location and get the points from that, but I need to do this without interaction. Doing that also doesn't help me figure out the math involved.

I'm not even sure I need to determine the points as much as just finding the correct rotation matrix.

I'm just not able to figure out where to start... Searches for the concept come up empty or just not what I'm looking to do (e.g.: they are 2D transforms not 3D)

It's also possible I'm overly complicating things and there is a simple transform equation that would do this in its sleep.

Thoughts? Thanks in advance!

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

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

发布评论

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

评论(2

再浓的妆也掩不了殇 2024-08-24 23:10:57

这可以通过数学或计算来解决(除了内置的四重模糊性之外)。既然如此,我将描述一种计算方法。

总而言之,该方法是查看投影角度,并且由于您知道真实角度,因此可以计算方向。具体来说,从以下可视化开始:想象三角形在 xy 平面上平坦,并且沿 z 轴法线,并在此处放置一个接触三角形所有角的球体,所有内容均以原点为中心。现在旋转球体所有点的法线并记下投影角度。这里的关键点是,现在对于每个可能的投影角度,您可以在球体上绘制等角路径(即法线路径,指示您观察到相同投影角度的所有位置 - 这可能是一个圆,但在没有计算出数学的情况下我不确定)。因此,为了解决原始问题,取两个观察到的角度,绘制等角路径,可能的解决方案将是这些路径的交集。

通过计算,通过在球体上以 1 度增量移动法线来构建等角路径,并记下每个位置的三个角度,然后通过按角度排序,将这些数据重新排列为等角路径。然后,对于观察到的投影中的两个角度,找到两条等角路径相交的位置。请注意,路径将有两个交叉点,这对应于特定角是否远离观察者的内置模糊性,而且,根据您选择处理法线反射的方式,路径可能会断开连接(尽管除了反射之外,我认为等角路径不会断开)。

This can be solved (aside from the built-in quadruple ambiguities) either mathematically or computationally. Since this is SO, I'll describe a computational approach.

In overview, the approach is to look at the projected angles, and since you know the true angles you can calculate the orientation. To get specific, start with the following visualization: imagine the triangle flat in the x-y plane and it's normal along the z-axis, and put a sphere here that touches all corners of the triangle, with everything centered at the origin. Now rotate the normal to all points of the sphere and note the projected angles. The key point here is that now for each possible projected angle you can draw an iso-angle path on the sphere (i.e. the path of the normal that indicates all the positions for which you observe the same projected angle -- which is probably a circle, but I'm not certain without working out the math). So to solve the original problem, take two of the observed angles, draw the iso-angle paths, and the possible solutions will be the intersection of these paths.

Computationally, construct your iso-angle paths by moving the normal in, say, 1 degree increments over the sphere, and note the three angles for each position, and then rearrange this data into iso-angle paths, by sorting it by angle. Then for two of the angles in an observed projection, find where the two iso-angle paths intersect. Note that the paths will have two intersections which corresponds to the built-in ambiguity of whether a particular corner is near or far from the observer, and also, depending on how you choose deal with reflections of the normal, the paths my be disconnected (though other than reflections I think the iso-angle paths will not be disconnected).

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