Live data from Hacker News

Let's remove Quaternions from every 3D Engine

marctenbosch.com

21–30 of 184 posts

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

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

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

#22

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?

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

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

#23

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…

[deleted]

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

#24

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

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

#25

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?

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

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

#27

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.

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

#28

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…

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

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

#29
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?

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

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

#30
I'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

Post reply on HN