Search code examples
quaternions

Rotate plane to be coplanar with another plane


How do you find the rotation to make a plane coplanar with another plane?

Seems like such a simple question, but it's killing me.

I have a brute force way of getting the job done, matching a plane to the rotation and spinning it till its forward vector is the min of 360 angles when compared to its original before trying to make it coplanar.


Solution

    1. take 2 normals to both planes.
    2. find rotation to fit one normal direction to another Finding quaternion representing the rotation from one vector to another

    3. found rotation is your rotation of one plane to be coplanar to other.