#### Archived

This topic is now archived and is closed to further replies.

# Rotating a triangle onto the X-Y plane

This topic is 6494 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

How do you rotate a triangle positioned anywhere in 3d space onto the X-Y plane? It really doesn''t matter where on the plane it ends up for my particular implementation. If I remember my geometry right, I could just pick a point on the triangle, and put that it''s image at (0,0). Then I could find the distace from that point to one of the other ones, and put it at (0,d). Then I''d find the angle between the 2 lines coming out of the first point and the distance to the third point, and put the last point at (cos(angle)*d, sin(angle)*d). This would result in a triangle that is on the X-Y plane with the same dimensions as the original, right? Is there a simpler way to do this?

##### Share on other sites
If you have the normal, the axis to rotate the triangle on is the normal to the triangle''s normal and the Z axis. The angle to rotate the triangle is the angle between the triangle''s normal and the Z axis.

But why do you want to rotate the triangle to the XY plane? If your reason is to solely reduce the problem to 2 dimensions, such as doing a point location test, then a better and simpler solution is this:
Find the largest component of the trinagle''s normal and drop this component from the triangle''s coords. In other words, if Y is the largest component of the triangle''s normal, then drop Y from all of the triangle''s vertices, giving you just X and Z. You have then projected the triangle to the XZ plane. This is sufficient for many tests.

On the other hand, if you truly need to rotate the triangle to the XY plane, then you can''t drop the Z component, because this is only projection.

1. 1
2. 2
Rutin
23
3. 3
JoeJ
20
4. 4
5. 5

• 22
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631732
• Total Posts
3001926
×