4 ms·
I'm the author of Klein and was surprised to see a sudden burst of traffic so I checked the usual suspects and ended up here :) My goals for authoring Klein wa
by ninepoints 7y ago
I'm the author of Klein and was surprised to see a sudden burst of traffic so I checked the usual suspects and ended up here :)
My goals for authoring Klein was to provide a library for performing all manner of geometric operations using the language of Geometric Algebra. The benefits are that the formulism is exception-free (meaning, for example, parallel planes have a well-defined line of intersection, that projections to higher/lower grade entities make sense, etc), and works equally well on points, lines, and planes. Practitioners coming from robotics/animation will also find the entirety of the Lie algebra/group inside GA as well for smooth interpolation, etc.
As a graphics engineer, I found most libraries out there unsuitable because of performance reasons. We're used to having nicely packed SIMD optimized quaternions for example. Klein fills this gap and (hopefully) in a manner where you can use it even if you don't understand the Geometric Algebra (yet!). Over time, I'd like to round out the documentation to explain the underlying theory, which I find unreasonably elegant and has shifted my thinking in the last few years.
Let me know if you have any questions about Klein or geometric algebra!
- throwaway17_17 7y agoI saw a post in the last month or so on the front page of HN that linked a video lecture and a paper/presentation on GA, it’s still sitting in my watch/read folder unfortunately. So, since you volunteered for questions, I’ll ask a few: - is there a generally accepted, or just personally approved, set of introductory materials on GA, to get one up to speed? I have a decent mathematics background, but I have been focusing on other areas recently so I am a bit rusty. - I think your goals for Klein look interesting, and since you are a graphics engineer, I assume you are aware of the prior art (your comment indicates this is correct), so, is the main draw of using GA as an implementation theory the elegance of the underlying math alone, or does the math create a new space for potential optimization in the graphics space (I am assuming that your mention of performance penalty in existing implementations is due to a lack of focus on performance not unsuitability of GA to a performance domain).
- throwaway17_17 7y agoAs a quick note: I think your last comment up thread answered my second question reasonably well, it posted while I was writing my comment. But any additional details you want to share will be welcome.
- ninepoints 7y agoThanks for the questions. > re: introductory materials The 3 links I compiled here (https://www.jeremyong.com/klein/references/ 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 on GA with arbitrary dimensionality/metric (results in either increased compilation time, or reduced performance). Second, there wasn't much overlap between practicitioners of GA, and graphics/animation engineers on the other side. I view Klein as "low-hanging fruit" in that sense, and consider myself fortunate to have come across the theory in the manner I did. I had written it off as just "an easier to understand Quaternion," but once I realized how much I (and perhaps some of my colleagues) were missing, I opted to actually try and productionize GA to "fill the gap" so to speak. (FYI tried to send this over an hour ago but HN keeps rate limiting me :( )