Tangential: Back in 2000 there was some debate about dropping quaternions in favor of a set of equivalent operations on plain matrices. https://www.gamedev.net/articles/programming/math-and-physic... The debate petered out when the proponents finished optimizing their implementation and found they had produced exactly the same code as the existing quaternion implementations. The only difference was the approach used…
Let's remove Quaternions from every 3D Engine
141–150 of 184 posts
Re: Let's remove Quaternions from every 3D Engine
#142Tangential: Back in 2000 there was some debate about dropping quaternions in favor of a set of equivalent operations on plain matrices. https://www.gamedev.net/articles/programming/math-and-physic... The debate petered out when the proponents finished optimizing their implementation and found they had produced exactly the same code as the existing quaternion implementations. The only difference was the approach used…
Thank you for posting this, I found it both very enlightening and a pretty fun internet-drama read :D Interesting that the original complaint of that article/thread and this one are both the same - ie. quaternions are 'too hard to understand', and people 'use them without knowing how they work'. With this being posted so soon after https://news.ycombinator.com/item?id=18310788 , I feel like that complaint is less val…
The matrix:
adg
beh
cfj
maps the vector (1,0,0) to the vector (a,b,c), (0,1,0) to (d,e,f), etc... so if you write any other vector as a weighted sum of (1,0,0), (0,1,0), etc... the weights get mapped to the new vectors.As someone with a background in physics and geometry, it seems bizarre to me to use quaternions to reason about geometry. It's really unnatural. It's basically just a coincidence that the algebraic structure of rotations in 3d happens to look like this. It doesn't generalize to higher dimensions. There is no equivalent to quaternions for 4, 5, 6d [1].
Bivectors discussed in the article, on the other hand, easily generalize to higher dimensions, and are a completely natural geometric concept. (Of course if your thesis is about constructing 4d objects you care about that a whole lot more than if you build a 3d engine...)
Now that doesn't mean it's easier or harder to manipulate one or the other. As they all reference the same mathematical structure it's also not surprising that the code ends up being the same. And given that algebra is more natural for computers, I can see why quaternions might be useful here. But geometric they are not.
Re: Let's remove Quaternions from every 3D Engine
#143Earlier quoted context omitted.
If the results are going to be the same, then what's the possible benefit for any user of a 3D engine? 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 t…
> If the results are going to be the same, then what's the possible benefit for any user of a 3D engine? 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.
Re: Let's remove Quaternions from every 3D Engine
#144Earlier quoted context omitted.
To be clear, I don't think the wedge product is sufficient either; I just think it's the real reason most people end up finding GA to be appealing. I think there's work to do to clean the whole space up. Particularly, the wedge product is a 'join' or 'union' operator (amusingly, it has the wrong symbol). The 'meet' operator is not widely known but should probably be equally prominent. I haven't figured out for myself…
You might enjoy https://arxiv.org/abs/1205.5935
Re: Let's remove Quaternions from every 3D Engine
#145Re: Let's remove Quaternions from every 3D Engine
#146Earlier quoted context omitted.
To be clear, I don't think the wedge product is sufficient either; I just think it's the real reason most people end up finding GA to be appealing. I think there's work to do to clean the whole space up. Particularly, the wedge product is a 'join' or 'union' operator (amusingly, it has the wrong symbol). The 'meet' operator is not widely known but should probably be equally prominent. I haven't figured out for myself…
You might enjoy https://arxiv.org/abs/1205.5935
Re: Let's remove Quaternions from every 3D Engine
#147Earlier quoted context omitted.
Thank you for posting this, I found it both very enlightening and a pretty fun internet-drama read :D Interesting that the original complaint of that article/thread and this one are both the same - ie. quaternions are 'too hard to understand', and people 'use them without knowing how they work'. With this being posted so soon after https://news.ycombinator.com/item?id=18310788 , I feel like that complaint is less val…
Matrices are linear transformations. Take a bunch of vectors, map them to another bunch of vectors. It's all inherently geometric. The matrix: adg beh cfj maps the vector (1,0,0) to the vector (a,b,c), (0,1,0) to (d,e,f), etc... so if you write any other vector as a weighted sum of (1,0,0), (0,1,0), etc... the weights get mapped to the new vectors. As someone with a background in physics and geometry, it seems bizarr…
Re: Let's remove Quaternions from every 3D Engine
#148Earlier quoted context omitted.
I’d love to see a small GitHub repo that contains Rotators and Quaternions with compared results.
The results are going to be the same. The arithmetic involved is literally identical. 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.
So to "remove Quaternions from every 3D Engine" all we need to do is rename the "Quaternion" datatypes to "Rotor" and we're done?
Re: Let's remove Quaternions from every 3D Engine
#149Earlier quoted context omitted.
Rust seems to have better (free, at least) documentation, though.
It also offers more in the way of concrete benefits.
In all seriousness, both rust and geometric algebra are really very cool; but their proponents are so ridiculously over-enthusiastic that it is easy to get tired of them before taking them seriously.
Re: Let's remove Quaternions from every 3D Engine
#150Earlier quoted context omitted.
Matrices are linear transformations. Take a bunch of vectors, map them to another bunch of vectors. It's all inherently geometric. The matrix: adg beh cfj maps the vector (1,0,0) to the vector (a,b,c), (0,1,0) to (d,e,f), etc... so if you write any other vector as a weighted sum of (1,0,0), (0,1,0), etc... the weights get mapped to the new vectors. As someone with a background in physics and geometry, it seems bizarr…
There is an N-dimensional generalisation for complex numbers, quaternions and hypercomplex numbers called Clifford algebra. I'm not an expert in that field (coming from physics and optics) but apparently it's not by chance that quaternions are connected with the rotation group SO(3) and complex numbers with SO(2). You can generalize to SO(n) with Clifford algebra.