by modeless · 8y ago · 0 comments
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?
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.
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.
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.
> 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...)
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.
Wilder still is the log of a 4x4 transformation matrix has the same tangent-vector properties, giving a coordinate-system-invariant rotation and translation.