5 ms·
Hmm, the word "interpolate" does not appear in the article. One of the main applications of quaternions in games is interpolating rotations. Does this represent
by modeless 8y ago
Hmm, the word "interpolate" does not appear in the article. One of the main applications of quaternions in games is interpolating rotations. Does this representation interpolate well?
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/ https://glm.g-truc.net/ for games?
- deleted 8y ago[deleted]
- marctenbosch 8y agoYes, anything you can do on quaternions you can do on rotors. (Updated the article) I have not seen a clean version of the code online but it is almost the same as for a quaternion.
- deleted 8y ago[deleted]
- scotty79 8y agoGreat post although it made me hungry for explanation what are the actual implementation differences between rotors and quaternions because I got the impression that we use exactly same real numbers to do exactly same things. We just imagine basis of this transformation space not as some 4 orthogonal vectors, just 3 orthogonal unit planes plus one real number for scaling. 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.
- marctenbosch 8y ago99% of the time this is true.
- forrestthewoods 8y agoI’d love to see a small GitHub repo that contains Rotators and Quaternions with compared results.
- jacobolus 8y agoThe 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.
- forrestthewoods 8y agoI believe you. 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.
- halfjoking 8y agoI don't believe him. 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.
- PeterisP 8y agoIf 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 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.
- nanofortnight 8y agoYes, it does, because it is an identical representation to quaternions. Except it actually explains all the weirdness in quaternions without resorting to 4-space. This is because quaternions are a subalgebra of geometric algebra in 3-space.
- MerryMage 8y agoYes. You can prove, for two rotors R1 and R2, that slerp(R1, R2, t) = R1 (R1^-1 R2)^t.
- enriquto 8y agothere is nothing weird about 4-space, what do you mean?
- glenneroo 8y agoRe-read what you are replying to - they didn't say 4D-space is weird but rather that quaternions are weird: > all the weirdness in quaternions without resorting to 4-space
- jayshua 8y agoDon't know if the article has been updated since your post, but Interpolation and Gimbal Lock are both called out as working with Rotors in the 5th paragraph. > 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.
- defen 8y agoYou can take the logarithm of a rotor in order to do interpolation. If you want a transformation represented by a rotor R to happen in N steps, you can apply R ^ (1/N) N times. The Nth root of R is exp(log(R)/N)
- BenFrantzDale 8y agoThe same is true (with lower performance, I suspect) with the 3x3 matrix representation.
- jacobolus 8y agoMatrices for rotation have the problem that you are using a 9-dimensional representation for a 3-dimensional quantity, so it is easy to make matrices that are not rotations (indeed the vast majority of the possible space of matrices consists of transformations that are not anywhere close to a pure rotation). Composing matrices leads to rounding errors. It is more complicated to invert matrices. As you say the matrix logarithm is more complicated. Etc. If you use a scalar + bivector “rotor” representation, that is only a 4-dimensional representation, which is easy to normalize to unit magnitude.
- jcagalawan 8y agoIsn’t the inversion a trivial transpose for rotations since they’re orthogonal?
- gugagore 8y agoIt's beautiful to see that the logarithm of a rotation matrix is a skew-symmetric matrix. The skew-symmetric matrices correspond to angular velocity, which behave like vectors. You can add and interpolate as you expect. Rotation matrices multiply. Skew-symmetric matrices add. The logarithmic and exponential map moves between the two spaces. 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.
- 8y ago
- boinkers 8y ago> Has anyone written a library using these concepts Yes, the C++ library you're looking for is here http://versor.mat.ucsb.edu/ http://versor.mat.ucsb.edu/
- modeless 8y agoNeat, thanks!