开发者

Normal of an equilateral triangle that has been arbitrarily transformed in 3D space

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 witho开发者_如何学Pythonut 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!


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).


I feel like I just answered this yesterday.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜