Live data from Hacker News

Let's remove Quaternions from every 3D Engine

marctenbosch.com

101–110 of 184 posts

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

#101

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.

I’d love to see a small GitHub repo that contains Rotators and Quaternions with compared results.

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

#102
post #100

Earlier quoted context omitted.

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…

To be clear, I don't think the wedge product is sufficient either; I just think it's the real reason most people end up finding GA to be appealing. I think there's work to do to clean the whole space up. Particularly, the wedge product is a 'join' or 'union' operator (amusingly, it has the wrong symbol). The 'meet' operator is not widely known but should probably be equally prominent. I haven't figured out for myself…

You might enjoy https://arxiv.org/abs/1205.5935

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

#103

Earlier quoted context omitted.

The same is true (with lower performance, I suspect) with the 3x3 matrix representation.

It'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 th…

That’s because skew-symmetric matrices are the Lie algebra of the Lie group of rotation matrices (and the exponential map takes a Lie algebra to a Lie group). In physics we call them the “infinitesimal generators” of the rotation group.

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

#104

Earlier quoted context omitted.

I would replace the last two operations by another multiplication and one reciprocal square root. There is extensive SIMD support for very fast approximations, and getting better in newer chips.

Yes of course. I just mean, conceptually that is what is required. You can replace a bunch of the multiplications and additions by FMA instructions as well. By the way Raph, I think you might be interested in this draft paper I have been working on (well, not working on for the past two months, but anyway...) https://beta.observablehq.com/d/e639659056145e88

Very cool! Some of the later sections are broken. The fact that this is interactive is great, maybe I'll get around to putting my stuff in this form.

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

#105

Earlier quoted context omitted.

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.

I’d love to see a small GitHub repo that contains Rotators and Quaternions with compared results.

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

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

#106

Earlier quoted context omitted.

Yes of course. I just mean, conceptually that is what is required. You can replace a bunch of the multiplications and additions by FMA instructions as well. By the way Raph, I think you might be interested in this draft paper I have been working on (well, not working on for the past two months, but anyway...) https://beta.observablehq.com/d/e639659056145e88

Very cool! Some of the later sections are broken. The fact that this is interactive is great, maybe I'll get around to putting my stuff in this form.

The broken parts are intentionally commented out, either now redundant or not finished yet. (Observable isn’t the best for version control / etc. yet.)

There are still a bunch of diagrams to make but I got a bit stalled on the project after going on a trip (and taking care of a toddler full time).

There are still a couple of research problems to figure out. In particular how to best set the tangent and curvature at the knots. Just fitting circles through triples of points isn’t the best method.

But I think this thing should compare favorably to Spiro curves for some use cases: in particular it is pretty local, a bit more robust to pathological inputs, and a lot simpler to compute (and explain). (But of course isn’t going to be globally optimizing for some smoothness metric, and isn’t extensional.)

Edit: sorry to bystanders for a completely off-topic conversation.

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

#107

Earlier quoted context omitted.

I’d love to see a small GitHub repo that contains Rotators and Quaternions with compared results.

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

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

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

#108

Earlier quoted context omitted.

The same is true (with lower performance, I suspect) with the 3x3 matrix representation.

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

Isn’t the inversion a trivial transpose for rotations since they’re orthogonal?

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

#109

Earlier quoted context omitted.

Very cool! Some of the later sections are broken. The fact that this is interactive is great, maybe I'll get around to putting my stuff in this form.

The broken parts are intentionally commented out, either now redundant or not finished yet. (Observable isn’t the best for version control / etc. yet.) There are still a bunch of diagrams to make but I got a bit stalled on the project after going on a trip (and taking care of a toddler full time). There are still a couple of research problems to figure out. In particular how to best set the tangent and curvature at t…

Agreed. And (as was largely the point of my thesis) these things are tradeoffs, a spline that's perfect in all these ways is not possible. I played around a bit and am not feeling that they'd be great for font design (they play pretty similarly to Séquin's circle splines, which of course you cite, though I think better).

We're now pretty far afield from the subject of the superiority of Rust over C++^W^W^W tau over pi^W^W^W geometric algebra over quaternions. I'd be more than happy to continue the discussion somewhere else.

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

#110
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…

Please do blog about this. I'd be really interested to hear your thoughts!
Post reply on HN