This is because quaternions are a subalgebra of geometric algebra in 3-space.
You can prove, for two rotors R1 and R2, that slerp(R1, R2, t) = R1 (R1^-1 R2)^t.
> all the weirdness in quaternions without resorting to 4-space
I have not seen a clean version of the code online but it is almost the same as for a quaternion.
Those bivectors just explain (incredibly, amazingly well) what quaternions are and why they have properties they have. It doesn't seem to change how you crunch the numbers to get what you want.
...
It's really great that you wrote that post. I feel like for the first time I truly understand rotations in 3D and know why I felt something fishy was going on with results of vector product and expressing rotations with them.
The real power of the GA version is that you can more clearly geometrically explain what is going on, and you can generalize everything to pseudo-Euclidean spaces or to lower or higher dimensions. GA gives you some more algebraic tools to work with, so when you are trying to write your proofs they are clearer and more concise.
I work in code all day. I have a lot of code that works. I’d love to see code that also works but is easier to understand.
If someone wants to remove something from every 3d engine then I’m going to need to see what the replacement looks like. In actual code.
I got a C- in Linear Algebra in college... I remember my Linear Algebra prof saying "maybe I'm being pedantic" when explaining a concept and I was like "wtf are you even talking about?"
I avoid all Math - and I think black boxes are great. The few times I've used functions with quaternions in game programming (I'm not a game programmer) they seemed really easy to use. I'm skeptical that a concept that is easy to understand for people with a Math background is easier to use in code for people like me.
So to "remove Quaternions from every 3D Engine" all we need to do is rename the "Quaternion" datatypes to "Rotor" and we're done?
Things like the ability to "generalize everything to pseudo-Euclidean spaces or to lower or higher dimensions", algebraic tools and writing proofs are not relevant to the needs that a 3D engine serves - 3D engines are written to fulfil requirements of engine users (not even engine writers), who won't be doing such things, that's below the abstraction level that's handled by the engine. So from that perspective we're comparing GA-filled black box with a quaternion-filled black box, and either (a) the GA box has better performance; or (b) the GA box has different results that are arguably more correct; or (c) the GA box has a substantially easier API; or (d) the GA box is useless.
It seems to me that you might be aiming at the (c) benefit with all the arguments that this math is easier to understand, but I'm not entirely convinced based on the article; perhaps an illustration of the expected code differences in using a non-quaternion GA-based engine (are there any?) would be helpful. If we can have an engine/API that's easier to understand for beginners and that makes all the basic tutorials simpler, then that would be a nice thing to have.
If it is going to be compiled down to the same binary code, what's the possible benefit of any higher level language?
On the other hand, if it's not exposed to the user, it doesn't particularly matter what structures and math that higher-level language uses behind the scenes to do what it does; most aspects of compiler theory are irrelevant for users of high-level languages.
> The change is simple and the code remains almost the same. Anything you can do with a Quaternion, such as Interpolation and avoiding Gimbal lock, you can do on a Rotor. But the understanding grows a lot.
Yes, the C++ library you're looking for is here http://versor.mat.ucsb.edu/
By the way Raph, I think you might be interested in this draft paper I have been working on (well, not working on for the past two months, but anyway...)
There are still a bunch of diagrams to make but I got a bit stalled on the project after going on a trip (and taking care of a toddler full time).
There are still a couple of research problems to figure out. In particular how to best set the tangent and curvature at the knots. Just fitting circles through triples of points isn’t the best method.
But I think this thing should compare favorably to Spiro curves for some use cases: in particular it is pretty local, a bit more robust to pathological inputs, and a lot simpler to compute (and explain). (But of course isn’t going to be globally optimizing for some smoothness metric, and isn’t extensional.)
Edit: sorry to bystanders for a completely off-topic conversation.
We're now pretty far afield from the subject of the superiority of Rust over C++^W^W^W tau over pi^W^W^W geometric algebra over quaternions. I'd be more than happy to continue the discussion somewhere else.
If you use a scalar + bivector “rotor” representation, that is only a 4-dimensional representation, which is easy to normalize to unit magnitude.
Just letting you know that I think it's valuable to bring up matrices into this discussion, even if they do have problems in practice with rounding errors and efficiency.
I didn't know the term "infinitesimal generator". Thanks!
Wilder still is the log of a 4x4 transformation matrix has the same tangent-vector properties, giving a coordinate-system-invariant rotation and translation.
Also, I've seen several articles trying to convince me that alternative transformation representations like these are better, but I haven't seen much code. Has anyone written a library using these concepts that could replace a traditional vector math library like https://glm.g-truc.net/ for games?