3D Transformation of Rectangle to a Plane

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
DukeLuke
Messages
92
Reaction score
0
Let's say you have four points that define a rectangle in the xy plane centered at the origin (with the x,y axes bisecting the sides). How can you transform these points so that the rectangle lies in an arbitrary plane (defined by a point p and a normal vector n) so it is centered about point p. I realize some orientation of the four points in this plane is needed for a unique transformation, but I'm stuck even getting an arbitrary orientation of these four points in the plane.

I'm thinking the correct approach may be to rotate the four points about the origin until the plane they create is normal to n, and then move them to the correct position. At this point I'm not even sure how to rotate the points until the plane they create is normal to n.
 
on Phys.org
First you need to rotate the rectangle so that
It's on the arbitrary plane. This can be done
Using a rotation matrix whose rows or cols
Are the components of the orthonormal basis
Vectors: normal, binormal and their cross product.
Next is to translate so that its center is the point p.
This is easily done by translating using a vector equal
to (p - rectangle origin). The details are an exercise for u :D
Try it yourself first :)