Live data from Hacker News

Let's remove Quaternions from every 3D Engine

marctenbosch.com

121–130 of 184 posts

Re: Let's remove Quaternions from every 3D Engine

#121

Earlier quoted context omitted.

By the way, the determinant of a matrix is just the outermorphism of the associated linear transformation applied to a unit pseudoscalar. The outermorphism of a linear transformation is a useful and convenient (but sometimes tricky) concept. It gives you not only determinants, but also the application of your linear transformation to arbitrary multivectors.

No the determinant is the isomorphism of the third latent moment of the orthonorm. Duh.

https://en.wikipedia.org/wiki/Outermorphism

Re: Let's remove Quaternions from every 3D Engine

#122

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…

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…

I 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.

Re: Let's remove Quaternions from every 3D Engine

#123
post #117

Earlier quoted context omitted.

The [Aside] section of "The Reflection Formula (Geometric Product Version) " http://marctenbosch.com/quaternions/#h_13 has the answer you seek ;)

I 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…

Ok 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

Re: Let's remove Quaternions from every 3D Engine

#124

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 tradition…

> Has anyone written a library using these concepts

Yes, the C++ library you're looking for is here http://versor.mat.ucsb.edu/

Re: Let's remove Quaternions from every 3D Engine

#125

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 tradition…

> Has anyone written a library using these concepts Yes, the C++ library you're looking for is here http://versor.mat.ucsb.edu/

Neat, thanks!

Re: Let's remove Quaternions from every 3D Engine

#126

So 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?

For anyone looking for those videos, here's a link to them:

https://eater.net/quaternions

Each video is interactive, just pause and tweak the 3d visualization. The videos are very good!

Re: Let's remove Quaternions from every 3D Engine

#127
post #61

I 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…

Not “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?”

Two 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.

Re: Let's remove Quaternions from every 3D Engine

#128
Quats 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.

Re: Let's remove Quaternions from every 3D Engine

#129
post #91

Earlier quoted context omitted.

It is easy to compute on vectors. It is possible, but complicated and unintuitive (I have written code to do it in the past), to compute it on multivectors. I'm arguing in favor of most of GA's language. I just keep finding that the wedge and inner product parts are fantastic, and the geometric product part isn't. And I think the reason people keep finding GA appealing is because they didn't have the wedge product be…

I’m telling you that after a few years working with the geometric product a whole bunch, the wedge product really doesn’t cut it. > I still have basically no idea what 'AB' means when both are arbitrary-grade multivectors Any mathematical language (or any natural language) can express a bunch of nonsensical and useless things. What is the sine of the square root of the logarithm of the tangent of some polynomial appl…

> the wedge product really doesn’t cut it

What about the wedge product together with the Hodge star, ie the language that tends to be used in Riemannian geometry?

Post reply on HN