All Projects β†’ jeremyong β†’ Klein

jeremyong / Klein

Licence: mit
P(R*_{3, 0, 1}) specialized SIMD Geometric Algebra Library

Projects that are alternatives of or similar to Klein

Cglm
πŸ“½ Highly Optimized Graphics Math (glm) for C
Stars: ✭ 887 (+91.58%)
Mutual labels:  3d, simd, sse
Std Simd
std::experimental::simd for GCC [ISO/IEC TS 19570:2018]
Stars: ✭ 275 (-40.6%)
Mutual labels:  simd, sse
3D-Engine-OpenGL-4
3D Graphics Engine For Games | C++ OpenGL 4.1
Stars: ✭ 19 (-95.9%)
Mutual labels:  3d, 3d-graphics
Sse2neon
A translator from Intel SSE intrinsics to Arm/Aarch64 NEON implementation
Stars: ✭ 316 (-31.75%)
Mutual labels:  simd, sse
Openscad
OpenSCAD - The Programmers Solid 3D CAD Modeller
Stars: ✭ 4,444 (+859.83%)
Mutual labels:  3d, 3d-graphics
hlml
vectorized high-level math library
Stars: ✭ 42 (-90.93%)
Mutual labels:  sse, simd
Glas
WebGL in WebAssembly with AssemblyScript
Stars: ✭ 278 (-39.96%)
Mutual labels:  3d, 3d-graphics
SoftLight
A shader-based Software Renderer Using The LightSky Framework.
Stars: ✭ 2 (-99.57%)
Mutual labels:  sse, simd
Dotscad
Reduce the burden of mathematics when playing OpenSCAD
Stars: ✭ 344 (-25.7%)
Mutual labels:  3d, 3d-graphics
Curated List Of Awesome 3d Morphable Model Software And Data
The idea of this list is to collect shared data and algorithms around 3D Morphable Models. You are invited to contribute to this list by adding a pull request. The original list arised from the Dagstuhl seminar on 3D Morphable Models https://www.dagstuhl.de/19102 in March 2019.
Stars: ✭ 375 (-19.01%)
Mutual labels:  3d, 3d-graphics
Tinyraytracer
A brief computer graphics / rendering course
Stars: ✭ 3,971 (+757.67%)
Mutual labels:  3d, 3d-graphics
Lume
Create CSS3D/WebGL applications declaratively with HTML. Give regular DOM elements shadow and lighting.
Stars: ✭ 445 (-3.89%)
Mutual labels:  3d, 3d-graphics
FFmpegPlayer
Simple FFmpeg video player
Stars: ✭ 72 (-84.45%)
Mutual labels:  sse, simd
Turbo-Histogram
Fastest Histogram Construction
Stars: ✭ 44 (-90.5%)
Mutual labels:  sse, simd
cpuwhat
Nim utilities for advanced CPU operations: CPU identification, ISA extension detection, bindings to assorted intrinsics
Stars: ✭ 25 (-94.6%)
Mutual labels:  sse, simd
Realityui
A Swift Package for creating familiar UI Elements and animations in a RealityKit rendered Augmented Reality or Virtual Reality scene.
Stars: ✭ 275 (-40.6%)
Mutual labels:  3d, 3d-graphics
Cpp 3d Game Tutorial Series
C++ 3D Game Tutorial Series is a YouTube tutorial series, whose purpose is to help all those who want to take their first steps in the game development from scratch.
Stars: ✭ 400 (-13.61%)
Mutual labels:  3d, 3d-graphics
sse-avx-rasterization
Triangle rasterization routines accelerated by SSE and AVX
Stars: ✭ 53 (-88.55%)
Mutual labels:  sse, simd
oversimple
A library for audio oversampling, which tries to offer a simple api while wrapping HIIR, by Laurent De Soras, for minimum phase antialiasing, and r8brain-free-src, by Aleksey Vaneev, for linear phase antialiasing.
Stars: ✭ 25 (-94.6%)
Mutual labels:  sse, simd
Limonengine
3D FPS game engine with full dynamic lighting and shadows
Stars: ✭ 331 (-28.51%)
Mutual labels:  3d, 3d-graphics

Klein

License: MIT DOI

Build Status Build Status Coverity Status Codacy Badge

πŸ‘‰πŸ‘‰ Project Site πŸ‘ˆπŸ‘ˆ

Description

Do you need to do any of the following? Quickly? Really quickly even?

  • Projecting points onto lines, lines to planes, points to planes?
  • Measuring distances and angles between points, lines, and planes?
  • Rotate or translate points, lines, and planes?
  • Perform smooth rigid body transforms? Interpolate them smoothly?
  • Construct lines from points? Planes from points? Planes from a line and a point?
  • Intersect planes to form lines? Intersect a planes and lines to form points?

If so, then Klein is the library for you!

Klein is an implementation of P(R*_{3, 0, 1}), aka 3D Projective Geometric Algebra. It is designed for applications that demand high-throughput (animation libraries, kinematic solvers, etc). In contrast to other GA libraries, Klein does not attempt to generalize the metric or dimensionality of the space. In exchange for this loss of generality, Klein implements the algebraic operations using the full weight of SSE (Streaming SIMD Extensions) for maximum throughput.

Requirements

  • Machine with a processor that supports SSE3 or later (Steam hardware survey reports 100% market penetration)
  • C++11/14/17 compliant compiler (tested with GCC 9.2.1, Clang 9.0.1, and Visual Studio 2019)
  • Optional SSE4.1 support

Usage

You have two options to use Klein in your codebase. First, you can simply copy the contents of the public folder somewhere in your include path. Alternatively, you can include this entire project in your source tree, and using cmake, add_subdirectory(Klein) and link the klein::klein interface target.

In your code, there is a single header to include via #include <klein/klein.hpp>, at which point you can create planes, points, lines, ideal lines, bivectors, motors, directions, and use their operations. Please refer to the project site for the most up-to-date documentation.

Motivation

PGA fully streamlines traditionally used quaternions, and dual-quaternions in a single algebra. Normally, the onus is on the user to perform appropriate casts and ensure signs and memory layout are accounted for. Here, all types are unified within the geometric algebra, and operations such as applying quaternion or dual-quaternions (rotor/motor) to planes, points, and lines make sense. There is a surprising amount of uniformity in the algebra, which enables efficient implementation, a simple API, and reduced code size.

Performance Considerations

It is known that a "better" way to vectorize computation in general is to arrange the data in an SoA layout to avoid unnecessary cross-lane arithmetic or unnecessary shuffling. PGA is unique in that a given PGA multivector has a natural decomposition into 4 blocks of 4 floating-point quantities. For the even sub-algebra (isomorphic to the space of dual-quaternions) also known as the motor algebra, the geometric product can be densely packed and implemented efficiently using SSE.

References

Klein is deeply indebted to several members of the GA community and their work. Beyond the works cited here, the author stands of the shoulders of giants (Felix Klein, Sophus Lie, Arthur Cayley, William Rowan Hamilton, Julius PlΓΌcker, and William Kingdon Clifford, among others).

[1] Gunn, Charles G. (2019). Course notes Geometric Algebra for Computer Graphics, SIGGRAPH 2019. arXiv link

[2] Steven De Keninck and Charles Gunn. (2019). SIGGRAPH 2019 Geometric Algebra Course. youtube link

[3] Leo Dorst, Daniel Fontijne, Stephen Mann. (2007) Geometric Algebra for Computer Science. Burlington, MA: Morgan Kaufmann Publishers Inc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].