Live data from Hacker News

Let's remove Quaternions from every 3D Engine

marctenbosch.com

41–50 of 184 posts

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

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

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

#42
post #39

Texts 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 gener…

Yeah, 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.

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

#43

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…

Yes, 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.

there is nothing weird about 4-space, what do you mean?

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

#44

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

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

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

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

#47

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

But once you are in gimbal lock, what do you do?

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

#48

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…

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

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

#49
post #21

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

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

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

#50
post #39

Texts 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 gener…

It's very cool that the geometric product of any orthonormal basis for R^2 gives i as a "pseudoscalar".

    Let {e1,e2} be an orthonormal basis for R^2. 
    Let i = e1e2.
    Then i^2 
    =  e1e2e1e2
    = -e1e1e2e2 (anticommutivity) 
    = -(1)(1)
    = -1.
Personally that alone is enough to justify learning more about geometric algebra.
Post reply on HN