# Get points of a 3d triangle relative to its own plane in 2d

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

## Recommended Posts

I need to convert a 3d triangle into a 2d triangle, as if it had been rotated so that all points lied on the same z and then ortho projected.

How can I do this?

(Code examples would be very helpful)

##### Share on other sites
Matrix planeMatrix = makeLookAtMatrix( triangleCenter /*eyePos*/, triangleCenter + triNormal /*aim point*/, pickASensibleUpVector /*make sure it isn't parallel to the aim direction*/ ); planeMatrix = invert(planeMatrix);

now transform the triangle with it..... (You may want to be more careful with the positioning of the origin in your new coordinate frame though....)

##### Share on other sites
It's easiest to arbitrarily declare one of the triangle's sides as being parallel to the X or Y axis. So if you have a triangle and say its first side is 4 units long. You can just start by saying its two endpoints are at {0,0} and at {4,0}. Then you just have to calculate the position of the remaining point. You know the lengths of the other two sides; it's exactly same in 3D as in 2D since the triangle lies along a plane, and you can easily find equations online for finding the point given that you know all lengths (and all angles, as a result).

1. 1
Rutin
26
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633312
• Total Posts
3011310
• ### Who's Online (See full list)

There are no registered users currently online

×