- Home /
Rotation to normal vector for plane and back
I have an API in the Magic Leap which provides extracted rectangles detected in an image/environment. These are described as a transform by a Vector3 for center position, a Quaternion for the rotation of the rectangle and a width and length. Basically the API gives me rects of the walls in the detected physical environment
I now want to create Unity planes (not the primitive but the C# class). For this I need a point (which I have) and a normal vector. Is there a way to turn a Quaternion into a normal vector to the pose it is describing?
Also is there a way to do the reverse thing? I create a plane with a normal vector and point and would like to have this pose as a quaternion.
What I want to find is the closest of the extracted rectangles to a certain point in the world. So if there are other ideas about how to find the distance without constructing planes i'm happy too