Matrix
Extract orientation from primitive based on three point data
Very often, you’ll encounter tasks that require extracting the orientation
of a primitive in 3D space, moving it back to the origin, or replacing
it with a point that already has an @orient
value. You can then copy
this orientation onto the appropriate object.
To solve this problem, we can find the matrix orientation from three points that represent a triangle in 3D space. This is an importatn step! Once you have the matrix, you can convert it into a quaternion