28 ms·
Let's remove Quaternions from every 3D Engine
- eigenspace 8y agoI do love Geometric Albegra and hope it gets further adoption. In my field (physics), the project of moving to geometric algebra currently looks hopeless due to the inertia of other formalisms and lack of interest from established physicists. The real shame is that the best opportunity to introduce physicists to geometric algebra was a hundred years ago when we were first discovering spinors. First the Pauli algebra and then the Dirac algebra. If physicsts at the time had been made aware of the geometric algebra approach to these things, I think it could have been an appropriate motivation to switch to geometric algebra. Instead, people came up with matrix representations of the Pauli and Dirac algebras and the field is stuck using those and saying "meh. Good enough."
- qubex 8y agoNot “meh, good enough” but rather “eh, computationally equivalent, why bother reformulating something that looks like a black box but is actually a gimmick we can rely upon to give equivalent results and that is understood by everybody in the field?”
- klodolph 8y agoTwo ways of approaching a problem can be computationally equivalent and yet one can be a clear winner. For example, take a look at Maxwell’s equations—as originally formulated there were 20 different equations, with many equations duplicated for x, y, and z. Heaviside, Gibbs, and Hertz reformulated these using vectors and reduced the number of equations to four. Computationally equivalent, but nobody uses the 20-equation version of Maxwell’s equations any more. Now consider relativity, which was originally motivated by Maxwell’s equations. We can describe flat spacetime as a 4D space with the Minkowski metric, which we can extend into a geometric algebra Cl_1,3(R). We can then describe field and current as multivectors, and we end up with the equation (singular!) ∇ F = µ_0 c J This has the additional property that it captures how observations of electromagnetism change under Lorentz transforms. If you think of a Lorentz transform as just a change of basis in spacetime algebra, and if you think of electricity and magnetism as together being the basis for electromagnetism, then it’s obvious that (for example) a moving observer would see a magnetic field generated by a stationary charge. This is obvious because the basis change from a stationary to moving observer will directly correspond to a basis change from an electric field to a magnetic field. This is simplifying a bit but I find it easier to remember and reason about the geometric algebra version of many of these formulas.
- deleted 8y ago[deleted]
- petermcneeley 8y agoDo you think nature requires such an exotic representation?
- eigenspace 8y agoI would argue that there is nothing exotic about geometric algebra and that its a much more natural representation of nature than our current hodge-podge of traditional vectors, tensors, complex numbers, differential forms and spinors.
- keldaris 8y agoIn my personal experience physicists are usually rather pragmatic about these things. Not many will support a "project of moving to geometric algebra" for its own sake, or the sake of perceived mathematical elegance - I know I wouldn't, even though I spent some time studying it just for fun. On the other hand, find a problem where geometric algebra gets you to a useful insight in a quicker or more natural way and few will object to treating it in that language. For most of the usecases associated with the examples you mention - Pauli and Dirac algebras - I don't think it matters very much. For instance, I haven't seen a decent QM course that doesn't devote at least a lecture or two to discussing the origin of Pauli matrices and the associated abstract algebra and group theory - as they should - but I don't think the course would be any more concise or useful (in terms of the physical content) if it then proceeded to treat QM in the language of geometric algebra. There's nothing wrong with the matrix representations (especially in a more computational context), though obviously one should know where the representation comes from and how to derive it.
- eigenspace 8y ago> On the other hand, find a problem where geometric algebra gets you to a useful insight in a quicker or more natural way and few will object to treating it in that language. I would argue that E&M and anything involving rotations (or Lorenzt boosts!) are two great examples where GA is miles ahead of anything other than differential forms but still has modest advantages of differential forms as well. The main advantage I see in geometric algebra is that its a unifying framework. The same langauge used to understand E&M in GA is also useful in quantum mechanics, general relativity, complex analysis, linear algebra, etc. I'd argue that physicists don't mind this mish-mash of notations because they've already put in the work to learn them all separtely but I think there are real advantages (especially pedagogical) to unifying them into one framework.
- keldaris 8y agoI think that last point really needs to start with a thorough reform of basic mathematical education (starting from undergrad calculus) to have any chance of real success. The present mish-mash of notations, however disjointed, lends itself very well to teaching people who don't know much beyond basic real analysis and differential equations. You can't just throw them in a GA-based E&M class without completely changing the entire curriculum first. Your first point got me curious, though. I found E&M in differential forms quite satisfying from an intellectual point of view (although of little practical benefit to the problems I was interested in compared to the classical approach, which I was plenty familiar with already). What advantages do you see for GA vs. differential forms in this context? This might make for a few interesting seminars with our math folks...
- impendia 8y agoCan I ask you (and keldaris) what precisely you mean by geometric algebra, and how you would propose to teach it? I'm a math professor. To me "geometric algebra" refers to any use of geometry in mathematics to illuminate algebraic principles. There are very very many of these -- this article illustrates one good example. I try to incorporate intuition from geometry into my teaching whenever possible. It seems that the two of you are referring to some particular unifying framework, and/or set of definitions and notation. Could I ask you to elaborate on what you mean? Thanks.
- cartep 8y agoI'm not any of the two you asked, but given that @eigenspace is a physicist, what you are looking for (notations used, etc) is possibly here: http://geocalc.clas.asu.edu/html/Evolution.html#References http://geocalc.clas.asu.edu/html/Evolution.html#References under "Recent Books". Notably "Clifford Algebra to Geometric Calculus" and "New Foundations for Classical Mechanics" by Hestenes. PD: if you ever attempt to read any of those two, I'd advise to go to the latest (corrected) reprint.
- nanofortnight 8y agohttps://en.wikipedia.org/wiki/Geometric_algebra https://en.wikipedia.org/wiki/Geometric_algebra Less ambiguously called "Clifford algebras", though Clifford himself prefered the term geometric algebra.
- deleted 8y ago[deleted]
- dahart 8y agoGeometric algebra has a definition that is more specific than any use of geometry to teach Elementary Algebra on real numbers. https://en.m.wikipedia.org/wiki/Geometric_algebra https://en.m.wikipedia.org/wiki/Geometric_algebra https://en.m.wikipedia.org/wiki/Clifford_algebra https://en.m.wikipedia.org/wiki/Clifford_algebra For teaching geometric algebra, there are curricula and textbooks available... http://geometry.mrao.cam.ac.uk/home/introduction-to-ga/ http://geometry.mrao.cam.ac.uk/home/introduction-to-ga/ https://arxiv.org/abs/1205.5935v1 https://arxiv.org/abs/1205.5935v1 http://www.faculty.luther.edu/~macdonal/GA&GC.pdf http://www.faculty.luther.edu/~macdonal/GA&GC.pdf http://assets.cambridge.org/052148/0221/sample/0521480221WS.pdf http://assets.cambridge.org/052148/0221/sample/0521480221WS.... http://geometricalgebra.org/downloads/ga4cs_toc.pdf http://geometricalgebra.org/downloads/ga4cs_toc.pdf https://www.amazon.com/dp/0792355148/ https://www.amazon.com/dp/0792355148/
- 19870213 8y agoIs this the same Marc Ten Bosch as from Miegakure [1]? Considering the content, probably the same person. [1] http://miegakure.com/ http://miegakure.com/
- vanderZwan 8y agoYes. He also made 4D Toys https://www.youtube.com/watch?v=0t4aKJuKP0Q https://www.youtube.com/watch?v=0t4aKJuKP0Q
- deleted 8y ago[deleted]
- outworlder 8y agoThis article will take more than than I have to digest right now, but it's definitely saved. I have never really understood quaternions. All I knew is that I could use that instead of euler angles, avoid gimbal lock, and would blindly use them.
- kevindqc 8y agoIt's also great for interpolation
- deleted 8y ago[deleted]
- WhitneyLand 8y agoI think you just described 90% of people who use them. Normally I like having a better grasp of the underlying theory I'm applying, but somehow quaternions seem more likely to make me think, yeah I'll eventually get around to that... instead of diving right in as this article I believe better motivates.
- outworlder 8y ago> but somehow quaternions seem more likely to make me think, yeah I'll eventually get around to that Exactly. And then you forget about them because...well, it's not like this stuff requires maintenance. Once you abstract all rotations and interpolations away, you just use them and forget you don't really grasp why they work.
- eigenspace 8y agoI'd argue that this geoemtric algebra presented in the article is much more comprehensible than quaternions and also more useful!
- TheRealPomax 8y agoBut if the argument is "let's replace quaternions in 3D engines!" then the question is really more "Okay, so do they outperform quaternions, then??" because if you're writing the 3D engine, the underlying code only matters insofar as that it has to do what it's supposed to do. You don't need to understand why it works, just that known operations will lead to known intended results. And if you're _using_ a 3D engine, you shouldn't even care. You just want rotation to work in the least amount of time, with the fewest function calls. What happens at the engine level, hidden by those functions, is entirely irrelevant. And I don't see a case being made that demonstrates that for the purpose of a 3D engine, this actually "makes more sense". It's just a different way to compute the exact same results. If I'm writing a game, or simulation, or 3D visualisation, I literally don't are how the engine does what I tell it to do, as long as it does it.
- adamnemecek 8y agoDual quaternions are even better for dealing with dynamic 3D space http://www.chinedufn.com/dual-quaternion-shader-explained/ http://www.chinedufn.com/dual-quaternion-shader-explained/
- vanderZwan 8y agoI kind of expect someone better versed in Geometric Algebra to come along and explain how it somehow also supersedes that.
- adamnemecek 8y agoGA is more general, however my claim is that the DQ space is the most useful one. E.g. sedenion have little use right now. Also I believe that technically they call under Clifford algebra.
- eigenspace 8y agoClifford himself called it the geometric algebra, so many prefer to call it that, at least when applied to geometric problems. I think that there is a lot of useful structure in the geometric algebra that gets thrown out when one moves to talking about its subalgebras (ie. quaternions, dual quaternions, vectors, etc.). Its ultimately up to taste but I often find that I prefer to use the full GA instead of its subalgebras. Often some unexpected beauty or useful result drops out!
- eigenspace 8y agoThis can be better expressed in the geometric algebra by just considering a geometric algebra with a degenerate metric (ie. you use basis elements x̂, ŷ, ẑ and ϵ̂ where x̂² = ŷ² = ẑ² = 1 and ϵ̂² = 0). Including factors of ϵ̂ in your rotors now is equivalent to a dual quaternion. This way, one gets the wonderful properties of geometric algebra and the useful properties of dual quaternions together.
- adamnemecek 8y ago
- chombier 8y agoI don't quite understand why the author opposes quaternions and geometric algebra: the geometric product is almost exactly the formula for multiplying pure imaginary quaternions (up to the real part sign). These are just two constructions of isomorphic Clifford algebras which really are the same thing.
- eigenspace 8y agoThat's not true. The quaternions are the even subalgebra of the 3D geometric algebra. They are not isomorphic. Quaternions are isomorphic to the set of scalars and bivectors in the 3D geometric algebra but the 3D GA also has vectors and a volume form. This is just like how the complex numbers are isomorphic to the even subalgebra of the 2D geometric algebra. The geometric algebra is richer, more powerful, more generalizable and more coherent than the quaternion algebra, all while being easier to understand because its so physical.
- chombier 8y agoI stand corrected, thanks a lot! It seems the article mostly deals with the scalar/bivector aspect of it though.
- modeless 8y agoHmm, 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.
- vertline3 8y agoSo I have a layman's question: 3blue1brown and Ben Eater did a quaternion visualization set of videos. And they said it was good because it avoided an an axis lock thing that happens when x y z rotate. He said there were maybe some errors with other models as well. So I guess the question is "does this also not have the locking axis problem?" I think it's called gimbal lock?
- WhitneyLand 8y agoJust in case it's not obvious to all, this "axis lock thing" you speak of is so important it could cause a plane to crash! :) (it has implications beyond computer graphics).
- aaaaaaaaaab 8y agoUnit quaternions are isomorphic to rotors, so there’s no practical difference between the two. The difference is how you introduce the concept of 3d rotation: the “traditional” way is to introduce quaternions with i^2 = j^2 = k^2 = -1, and then do some handwaving to convince the reader that they are good for 3d rotations. The bivector formalism is more natural and needs no handwaving.
- vertline3 8y agoThank you! I am really starting webgl, opengl study, and so I am hoping to start on the right footing. I was beginning those quaternion videos, but I think it will benefit me to look closely here too!
- amluto 8y agoI read through a bunch of this, and one part seems poorly explained. There’s a clear definition of the product of two vectors, but the result isn’t a vector — it’s a scalar plus a bivector. Then, by magic, three vectors get multiplied! But what does that even mean? Somehow a vector gets multiplied by a bivector, and the result is somehow still a vector. What’s going on?
- marctenbosch 8y agoThe [Aside] section of "The Reflection Formula (Geometric Product Version) "http://marctenbosch.com/quaternions/#h_13 http://marctenbosch.com/quaternions/#h_13 has the answer you seek ;)
- amluto 8y agoI read that a couple times. I found it unsatisfying because you are dropping terms that happen to have a coefficient of zero without a clear explanation of how those terms are even well formed in the first place. I suppose this could be answered if you explicitly stated what set the geometric product acted on. As a guess, and from skimming Wikipedia, it’s the direct sum of scalars, vectors, bivectors, etc, up through n-vectors. So 2 + x∧y + 3x∧y∧z is a valid output. And it’s probably straightforward to show that the geometric product is actually defined on this space. (Hi Marc!)
- marctenbosch 8y agoOk I understand your question better, might update the article. Like the other commenter said, you can keep applying the geometric product more than once. To find what happens you can just work with the basis vectors. So, you basically have three case: x (xx) = x (1) = x -> a vector x (xy) = x (x.y + x^y) = x (x.y) + xxy = x (x.y) + y -> a vector x (yz) = x (y.z + x^y) = x (y.z) + xyz -> a vector + a trivector. This only happens if the three vectors are independent, which can never be the case for -ava
- pfedak 8y agoAs pointed out in that aside, the general vector-bivector multiplication isn't needed to evaluate the reflection case, but I agree it's a little unsatisfying to sweep that under the rug. You can work everything out by breaking it down to the unit basis vectors, for which the products are explicit. One way of writing it, which feels more comfortable to me possibly at the expense of being the "wrong" sort of intuition, is u(v^w) = (u.v)w - v(u.w) + u^v^w (using . for inner product and ^ for outer product). I guess you can also think of the first two terms as the rule for taking the inner product of a vector and a wedge product, though I haven't thought through this completely. Because of the repeated vector in the reflection formula, that last trivector vanishes, so the result is just a vector, as it will be whenever the vector is coplanar with the bivector.
- aaaaaaaaaab 8y agoAlso: stop conflating bivectors and vectors. E.g. the inverse-transpose rule for transforming normal vectors needs no explanation when you treat them correctly as bivectors, and not vectors. Same goes for torque, etc.
- rafael859 8y agoI've played around a bit with geometric algebra in the past year, and I have to say that by far the best resource (albeit a bit short) was Ben Lynn's implementation in Haskell [0]. Unfortunately there isn't a well-written source that explains the methods well. There are multiple ways to do things, and I had trouble finding elegant solutions to practical problems. [0] https://crypto.stanford.edu/~blynn/haskell/ga.html https://crypto.stanford.edu/~blynn/haskell/ga.html
- ru999gol 8y agoWhen just implementing a first person type control/viewport I found it way easier to just use euler angles and the gimbal lock didn't really feel unnatural to me. So I think there is something to the idea that maybe you don't even need the complexity of quaternions at all dependent on the usecase.
- outworlder 8y agoBut once you are in gimbal lock, what do you do?
- deleted 8y ago[deleted]
- slavik81 8y agoAny rotation around the unaligned axis will free you. The problem with gimbal lock for 1st person controls is mostly avoided because roll is limited and you don't need to smoothly rotate over the poles anyways. But, I find that I often need smooth, arbitrary rotations for other things, so I just use quaternions everywhere. When using Euler angles as input, I immediately convert them to quaternions.
- Diggsey 8y agoFirst person views typically only use two axes of rotation, so of course gimbal lock will not be a problem. You are not dealing with general 3D rotations. However, as soon as you want a 3D rotation (eg. in a flight sim) then you really need a way to represent them that doesn't suffer from gimbal lock or have any singularities. Note: even with an FPS, you do typically want some more complex camera movement (for certain actions or animations that tilt the camera) or need to orient something relative to the camera (like the gun). Euler angles do not allow you to compose rotations, and so for this you'll need to go via an intermediate representation such as quaternions or matrices. Probably this is handled by whatever engine you are using though.
- ajkjk 8y agoTexts on GA seem to start out saying "we're going to replace vector analysis with something intuitive and natural and eloquent and..." and then immediately introduce the "geometric product", which is neither intuitive, eloquent, or, as far as I can tell, natural. Its properties are found via formula-wrangling, and the results you get from it seem to just magically work, rather than being intuitive. Bivectors in general are conceptually great; it's just the geometric product which I think is conceptually flimsy. And it's surprisingly hard to compute or make sense of the geometric product in general which is why the writer of the first book cited on the OP wrote "I do not think it possible to give a quick definition of the general geometric product."[1] As far as I can tell 95% of the usefulness of geometric algebra is the usefulness of the wedge product ∧, which is absolutely under-appreciated and appears in loads of places in disguise (for instance, the determinant of a matrix is the wedge product of all of its rows or columns together). The last 5% of the usefulness of GA comes from using the geometric product in vector-rotation via -ava^-1, which is admittedly very useful (it's why physics and computer graphics represent rotation this way, albeit in disguised forms like Pauli matrices and quaternions.) You can express that form without the geometric product, but I haven't found a way that strikes me as very elegant. I don't mean to condemn GA - I think what it's doing is massively important. The mathematical language for vector analysis deficient compared to what we could be using, and a lot of things are more intuitive and natural in better language. I just suspect that the, uh, ideal form of this stuff will look slightly different than GA, and might not include the geometric product at all, but will definitely include the wedge product absolutely everywhere. (I've spent a lot of free time trying to figure this out but I don't really have a compelling result yet. I've been meaning to try blogging about it, though, since it's basically my favorite thing to study.) [1] https://math.stackexchange.com/questions/444988/looking-for-a-clear-definition-of-the-geometric-product https://math.stackexchange.com/questions/444988/looking-for-...
- marctenbosch 8y agoYeah, I spent a long time trying to find a very clean path to the geometric product and failed so far, but I feel I am getting closer, ahah.
- tomjakubowski 8y ago
- enriquto 8y agogeometric algebra proponents are the rust strike force of mathematics
- dragonwriter 8y agoRust seems to have better (free, at least) documentation, though.
- pzone 8y agoIt also offers more in the way of concrete benefits.
- enriquto 8y agoNot sure if you are ironic and what are you referring to by "it", but in any case I was mocking both rust and GA. 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.
- boxcardavin 8y agoI use quaternions at work (AVs) and used them in physics and astronomy in school. The math he's talking about is darned close to the math done behind the scences with quaternions, it's just easier to grasp because it has visual references. Thing is, you only need to understand the math once to be able to use any of this stuff, and there's nothing wrong with taking it for granted after that. Either method is good enough. Basicallt, quaternions are hard to understand but easy to use.
- vanderZwan 8y agoI take easy to understand and easy to use over that any day. But hey, I also was a teacher once so I'm probably biased here.
- united893 8y agoHow do rotors map to euler angles?
- marctenbosch 8y agoThe same way quaternions do.
- andbberger 8y agoThis article reads like 'I don't understand quaternions therefore they're bad.' Like what - they are the objectively best representation of rotations...
- eigenspace 8y agoThat's not at all what the author is saying. The author actually has a much deeper understanding of quaternions than most of their users and realizes that they are part of a much more general and useful structure known as the 3D geometric algebra and he advocates using that instead of quaternions. GA(3) use objects that are isomorphic to quaternions to represent rotations but is much more comprehensible and generalizable than quaternions.
- andbberger 8y agoOK sorry, that was rash of me to say.
- moron4hire 8y agoIt's completely unnecessary to understand what the individual components of quaternions represent. All that is necessary is to build an understanding of what the operations do for you. Do you need to understand Russell's proof that 1+1=2 to compute the tip on your bar bill, or do you just need to know what to expect when you apply the addition operation to two numbers? Treat quaternions as indivisible whole values as you would floating point numbers.
- vanderZwan 8y agoRussell's proof that 1+1=2 is more complicated than the existing intuition of adding up numbers. GA is less complicated and more intuitive than the maths of quaternions. So your comparison does not really hold up.
- yiyus 8y agoI will give you an example (from my recent work) where actually knowing what the components mean was useful. I had to calculate misorientations between many pairs of orientations. If I treated quaternions as a whole, I would find their quotient and then get the angle. But since I know what the components mean, and I know I can get the misorientation angle from just the cosine (the scalar component), and I know that I can get this value from a simple dot product, I can easily save a few operations to calculate every misorientation. And since I have to calculate many of them, this change supposed a big speedup. Black boxes are nice when learning or thinking at a high level, but if you frequently use a black box, knowing what is inside will probably become useful at some point.
- platz 8y agoI thought Quaternions solved discontinuities in rotations.
- antpls 8y agoFor the most brightest mathematicians of HN : could you relate this to tensors?
- marctenbosch 8y agoThe outer product is the antisymmetric part of the tensor product.
- eigenspace 8y agoTensor algebra is fully expressible in terms of geometric algebra. If you're itnerested, I'd reccomend Geometric Algebra for Physicists by Doran and Lasenby.
- choonway 8y agoWhy not use Screw Theory?
- jacobolus 8y agohttp://geocalc.clas.asu.edu/pdf/New_Tools_for_Comp_Geom.pdf http://geocalc.clas.asu.edu/pdf/New_Tools_for_Comp_Geom.pdf
- eggy 8y agoCheck out this gem of a book on screw theory, geometric algebra and robotics. I keep it on my desk it's so useful. Geometric Fundamentals of Robotics - by J.M. Selig 1996, 2005 2nd Edition
- corysama 8y agoTangential: 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-physics/do-we-really-need-quaternions-r1199/ 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 to derive it.
- lmitchell 8y agoThank 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 https://news.ycombinator.com/item?id=18310788 , I feel like that complaint is less valid now than it ever has been, but it's kind of interesting to think about why quaternions in particular draw so much fire when, honestly, I found matrices to be equally challenging at first. Is it just an education thing, since matrices are generally taught much earlier? Or is there some intuition in matrices that isn't present in quaternions? Both of them seem to be just 'do this math, then magic happens' unless you think about them a fair bit, and that was pretty challenging for both the first time round imo.
- marctenbosch 8y agoI think matrices are easier for people to visualize because they can think about them as a vector frame and coordinate transformations. Quaternions are seen as this abstract 4D space somehow containing 3D space transformations, and people have a much harder time visualizing 4D space. I do not think spending a lot of time trying to visualize this 4D space, like this video does, is the right way to go. Rotors make that method obsolete.
- jacobolus 8y agoTo be honest the hardest part is not understanding single rotations, but understanding how rotations compose. Thinking about a scalar + bivector as the quotient of two vectors or as the composition of two reflections is easy enough. But that still doesn’t yield a solid understanding of how rotation works – 3D rotation is subtle and tricky, even for people who have pretty good spatial reasoning and a lot of experience working with solid geometry / 3D design. I have been thinking about the best interactive diagram(s) for giving people a good intuition about that for a long time, and I have some ideas but I still haven’t implemented anything and I’m not sure how well it will work.
- Improvotter 8y agoI'm no game developer. But wouldn't it be important for game engines to use the most performant approach. Is there a difference in performance when using rotors instead of quaternions?
- naikrovek 8y agoNo difference in the actual math used, just differences in how you approach understanding of the problem.
- palisade 8y agoQuats can be represented with (x, y, z, w). Rotors require a vector, bivector and angle (vec_x, vec_y, vec_z, bivec_x, bivec_y, bivec_z, theta). If you are storing or transmitting a quaternion it consumes less space and in 3D simulations or games a quaternion is therefore advantageous. 3D file formats would explode in size if rotors were used. And, more network packet fragments would be needed to encapsulate a world state update of moving objects, npc and players. That would waste bandwidth (therefore $), cause "rubberbanding" and increase latency.
- Rusky 8y agoNo. 3D rotors are represented exactly the same way as quaternions- 4 scalars. The operations are the same as well, only the explanation is different.
- palisade 8y agoPartially true, internally libraries represent the rotor as just four scalars and can convert these to a quaternion. However, to actually make use of the rotor to do anything useful, e.g. interpolate, which is a power quaternion math has innately, you need to provide a lot more external information; plane origin vector, bivector, angle. A 3D file format storing the transformations between joints of the skeleton of a character for example would have to provide these extra bits of information in order to store the frames to perform inverse kinematics. Likewise, if you needed to store or transmit spherical camera interpolations or non-player or player character transitions over a network this information would also have to be provided. You could perhaps do some optimization, e.g. only sometimes transmitting the origin once and then only sending the bivectors and angles in some cases which still would waste bytes and increase complexity. And, sometimes you couldn't so you'd have to send the whole thing. But, with a quaternion you get this for free without any logical gymnastics via the previous four scalars to the next four scalars between delta frames. And, in the case of slerp only the lambda of time. Now you can argue that a rotor could be used locally and then when storage/transmission is required you could convert to and use quaternion math to perform the necessary interpolations and thereby get the space savings. However, this article is specifically asking for the complete removal of quaternions from the field of computer science. Unless I'm misunderstanding. Though I haven't seen a code example where rotors don't require this extra information. For example, in libvsr they have examples that require all these pieces for each frame. However, maybe that is an inefficient or naive implementation. I did find this: http://geometry.mrao.cam.ac.uk/wp-content/uploads/2015/02/01ApplicationsI.pdf http://geometry.mrao.cam.ac.uk/wp-content/uploads/2015/02/01... Which provided a formula for rotor slerp: R(lambda) = (1.0 / sin(theta)) * (sin((1 - lambda) * theta) * R0 + sin(lambda * theta) * R1) If that is the case, then the bare minimum information required is still more than a quaternion. We'd require the lambda, theta, and R0 (4 scalars), R1 (4 scalars).
- tobr 8y agoIt’s certainly been an intense week in the department of “explorable explanations of how to rotate stuff in 3D”, with both this and the 3blue1brown/Ben Eater collab. https://news.ycombinator.com/item?id=18310788 https://news.ycombinator.com/item?id=18310788
- beeforpork 8y agoI am not sure if I understand how to apply this to every 3D engine. A 3D engine uses 4D matrices so that it can concatenate rotations, scaling, translations, and perspective correction into one matrix operation using matrix multiplication, i.e., it can represent any sequence of 3D operations in a single matrix. So what is the equivalent structure I'd use with trivectors to combine arbitrary 3D transformatinos into a single operation, like every 3D engine needs? The linked Versor library was also not very helpful -- it has the rotate operation on a vector, but I found no 'make rotation' and 'make translation' and 'make frustrum' and 'apply transformation' and 'concatenate transformation' operations.
- grondilu 8y agoIsn't it, in the end, just a notational issue? Quaternions are unit bivectors. Up to a slightly annoying sign change, quaternions which are noted as i, j and k correspond to bivectors jk, ki and ij, don't they? There should be a way to write a library that translates geometric algebra notations into their corresponding quaternion ones, and reciprocally.
- onhn 8y agoI don't understand the title at all: given that there is an isomorphism, any method of distinguishing an implementation of quaternions from the proposed alternative is necessarily an arbitrary one.
- peter_d_sherman 8y agoExcerpt: "It is strange because multiplying two vectors together gives the sum of two different things: a scalar and a bivector. However this is similar to how a complex number is the sum of a scalar and an "imaginary" number, so you might be used to it already. Here the bivector part corresponds to the "imaginary" part of the complex number. Except it is not "imaginary," it’s just a bivector, which we have a concrete picture of!"