Jeremy Ong, a graphics programmer, writes about geometric algebra, computer graphics, game engines, and low-level systems topics such as memory-mapped files.
HN commenters discuss his geometric algebra library and its reference materials, and engage with his technical points on Windows memory mapping.
Thanks for the questions.
> re: introductory materials
The 3 links I compiled here (https://www.jeremyong.com/klein/references/) I consider an absolute must for starting to consume GA. The book (ref #3) has one chapter undergoing revision regarding the usefulness of the degenerate metric for modeling projective geometry. My understanding is the chapter will be released for free once finished. From this alone, I was able to piece together enough to write one working implementation of GA that I was able to use to verify the computations and my understanding. Klein is my third GA library which I wrote once I was pretty sure I was comfortable with the formalism. Another great set of resources is anything posted on bivector.net.
> re: question 2
The elegance of the math does help me identify better optimizations in a number of cases, but in other cases, it makes a whole series of operations well-defined (for which there was no good analog before). I posted some examples in another comment, but essentially, quats and dual-quats generally only work on points, and in a somewhat awkward manner. I can't easily compose 2 rotations, a translation, a dual quat, and a quat, and then expect it to work on a line for example. In GA, this is ... completely trivial. And because it all fits nicely in the framework, all the above benefits from the same SIMD optimizations.
I believe the reason GA was not considered well-suited for production/perf reasons is twofold. First, prior art focused…
I don't have a book recommendation handy. It's "just" a combination of two neat techniques. Get books on each of those and understand them each, and you have the combination.
GA has been well discussed here, so, the other half:
Projectivization is a fairly standard trick even for normal geometry. It's adding an additional dimension, which is in most contexts just set to 1. (Projective actually just means treating all points on a ray as equivalent; this loses the dimension you just gained
It lets rotations and translations be treated in a nearly uniform manner, and lets you do rotations around points that aren't the origin. It's used all over the place in much graphics code (usually under the name homogeneous coördinates). The last section of https://en.wikipedia.org/wiki/Homogeneous_coordinates discusses this briefly.
For online resources for the combination: another commenter has recommended https://bivector.net/ , and it looks okay, with sections specifically on 2 and 3 dimensional projective geometric algebra.
There is also the nice C++ header library klein: https://www.jeremyong.com/klein/
Some GA libraries[1][2] define types for the different kind of objects (grades), although they are time consuming to implement and fixed in the number of dimensions they describe. But you are right that the most implementation combine all grades into a single array, but the biggest problem with those is that the size of the array in 2^n with n the number of dimensions. To work in 3D you probably want to use R(3,0,1) for all rigid transformation or even R(4,0,1), but that brings the total number of 16 or 32 floats to just represent a point.
Imho the biggest problem in GA for CS is the lack of a good ecosystem of tools. Ganja.js is nice, probably the best in class when it comes to API design, but is completely useless when trying to work with other JS libraries because ganja.js has it's own weird transpiler.
[1]https://www.jeremyong.com/klein/
[2]https://github.com/wrnrlr/g3
Honestly, I couldn't say Johnny. I'm not a graphics engineer, just a hobbyist game programmer who works in construction. I did do some internet searching and came across some blogs that I found interesting and might help you.
1. Finding Your Home in Graphics Programming, https://alextardif.com/LearningGraphics.html
2. Applying for Entry Level Graphic Jobs in Games, https://alextardif.com/GraphicsJobGuide.html
3. Junior Graphics Programmer Interview Questions, https://erkaman.github.io/posts/junior_graphics_programmer_interview.html
4. Interviewing Graphics Programmers, https://www.jeremyong.com/graphics/interviewing/2023/08/05/graphics-programmer-interviewing/
5. Interview Questions, https://aras-p.info/blog/2016/11/05/Interview-questions/
That is correct - matrices are the natural companion of the general linear group. The GA representation exists, and is called 'the mother algebra', for general 4x4 matrices the GA equivalent is R4,4. (where general linear transformations are versors).
For other subgroups GA reps will also exist. (like e.g. if one wants to include projective transformations as versors, that would be the projective group (which preserves the cross ratio of 4 points), and has a GA representation in R3,3).
These spaces quickly become so big that efficient numerical implementations (while not impossible with enough symbolic work at compilation time, see e.g. https://www.jeremyong.com/gal/) are difficult. Other advantages of GA do of course remain.
Do you have some before-and-after code that you can share?
I've seen two other efforts in that general direction:
* "Let's Remove Quaternions from Every 3D Engine"[0], which was underwhelming: let's ask other people to rename existing code for no practical benefit?
* "Klein"[1], a projective geometric algebra library that is amazingly nice to use, and claims to be very fast.
[0]: https://marctenbosch.com/quaternions/
[1]: https://www.jeremyong.com/klein/