This project is a header-only C++ library designed for graphics mathematics, providing a comprehensive suite of vector, matrix, and quaternion types. It is built using template metaprogramming to generate mathematical primitives at compile time, eliminating the need for precompiled binary libraries and allowing for direct integration into existing build systems.
The main features of g-truc/glm are: C++ Rendering Libraries, Shading Language Specification Mappings, 3D Math and Geometry Toolkits, Shading Language Math Implementations, Geometric, Floating-Point Precision Utilities, Vector, Linear Algebra.
Open-source alternatives to g-truc/glm include: toji/gl-matrix — gl-matrix is a high-performance JavaScript library for vector and matrix math, purpose-built for real-time 3D graphics… microsoft/directxtk — DirectXTK is a C++ library designed to simplify 2D and 3D graphics, audio, and input programming for DirectX… nicbarker/clay — Clay is a header-only layout engine designed for C and C++ applications that computes element positions and dimensions… candycat1992/unity_shaders_book — This project is a reference library of HLSL shader implementations and source code examples for Unity. It provides a… ssloy/tinyrenderer — Tinyrenderer is a C++ library designed as an educational tool for building a 3D graphics pipeline from scratch. It… shapely/shapely — Shapely is a library for the manipulation and analysis of planar geometric objects, serving as a Python wrapper for…
gl-matrix is a high-performance JavaScript library for vector and matrix math, purpose-built for real-time 3D graphics and physics simulations. It stores all vectors and matrices as typed arrays (Float32Array or Float64Array) in column-major order, matching the memory layout expected by OpenGL and WebGL shaders without requiring transposition. The library is implemented from scratch with zero external dependencies, keeping its bundle size minimal for web and Node.js environments. The library distinguishes itself through its immutable operation pattern, where each math function returns a new t
DirectXTK is a C++ library designed to simplify 2D and 3D graphics, audio, and input programming for DirectX applications. It serves as a comprehensive toolkit providing high-level wrappers for DirectX graphics, audio management, and input handling. The toolkit includes a graphics wrapper for loading textures and rendering 3D models and 2D sprites, alongside a dedicated audio manager for sound effects and 3D spatial audio. It also provides an input handler to track and process state updates from keyboards, mice, and gamepads. The library covers a broad capability surface including 3D math an
Clay is a header-only layout engine designed for C and C++ applications that computes element positions and dimensions using a declarative box model. By operating as an immediate-mode framework, it calculates interface geometry dynamically on every frame, allowing for the creation of responsive and fluid user interfaces without maintaining persistent state. The library functions as a platform-agnostic tool that decouples layout logic from specific graphics backends. It provides a flexible coordinate system that supports layered elements, such as modals and tooltips, alongside standard documen
This project is a reference library of HLSL shader implementations and source code examples for Unity. It provides a collection of practical samples focused on lighting, coordinate transformations, and rendering passes for 3D graphics. The repository demonstrates the application of 3D rendering mathematics, specifically using vector and matrix calculations to determine light directions and coordinate space transformations. It includes implementations for managing multi-pass rendering pipelines and mapping coordinates between object, world, and view spaces. The material covers foundational gr