Many of us has struggled with them, and it just keeps haunting us - Planes which doesn’t really know which way to orient itself. But wasn’t it exactly this that Quaternions was good for, avoiding singularities and all that stuff?
LookAt Focus Point
Any way, I’m defining Quaternions based on a Plane which “LookAt” a focus point in 3D space. The direction from the
Plane.Origin to the focal
Point defines a vector. And based on that vector I create a new perpendicular Plane. This new Plane is then used to define a Quaternion rotation between the original Plane and the new plane in the “LookAt” direction. My quaternions, which I create in different ways for different use, are doing just fine, and so they can rotate whatever I want to rotate. Problem is , the “LookAt” plane created based on the focus point is flipping hysterically in the way GH Planes seems to prefer to do.
Q1: So my first question is - is there a systemic error in the GH Plane class? If so, are there any plans to fix it?
Q2: Is there a consistent way of defining Planes - based on direction vectors in 3d space - so that they don’t start flip like shown in the clip.
Q3: Is there an alternate way - a workaround - to define a deterministic oriented (“non-flipping”) Plane based on a direction derived from a point in 3d space as demonstrated in the clip and in my code snippet?
Fig 1. The Plane axes flips hysterically. Shown to the far right in the clip is the Quaternion scalars (but they probably doesn’t explain anything, and besides, the blue Plane in the clip is not rotated by the Quat, but for debug-purposes it was created “directly as is” with code, in order to rule ot the Quats as the cause, see code far below) :
The blue rotated Plane was created from “raw” component inport values like so, so nothing strange is expected to have happened to the Plane itself.:
var new_normal = focusPt - start_plane.Origin; var new_plane = new Plane(start_plane.Origin, new_normal);
Rotating this Plane using the Quaternion I produced from the two Planes gives the exact same result.
Now what? This isn’t very funny anymore.