awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
g-truc avatar

g-truc/glmFork

0
View on GitHub↗
10,710 stars·2,355 forks·C++·other·12 viewsglm.g-truc.net↗

Glm

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 library is distinguished by its strict adherence to the OpenGL Shading Language specification, ensuring that mathematical results remain consistent across both CPU and GPU code. It provides specialized utilities for managing floating-point precision, including epsilon-based comparisons and unit-in-the-last-place accuracy measurements, which are essential for maintaining numerical stability in real-time rendering pipelines.

Beyond core linear algebra, the library covers a broad capability surface including spatial transformations, procedural generation, and bit-level data manipulation. It supports advanced geometric operations such as quaternion-based rotations, spline interpolation, and coordinate system mapping, while offering SIMD-friendly data layouts to facilitate hardware-level acceleration.

The library is distributed as a header-only collection, allowing developers to incorporate mathematical primitives directly into their projects without complex external dependency management.

Features

  • C++ Rendering Libraries - Provides a header-only C++ library of vector, matrix, and quaternion types mirroring shading language specifications.
  • Shading Language Specification Mappings - Provides C++ data structures that replicate vector and matrix types defined in standard shading language specifications.
  • 3D Math and Geometry Toolkits - Provides standard linear algebra operations for vectors and matrices, including common geometric, exponential, and trigonometric functions.
  • Shading Language Math Implementations - Provides vector, matrix, and scalar types that mirror shading language specifications for consistent results across CPU and GPU code.
  • Geometric - Calculates geometric matrices for translation, rotation, and scaling to position and orient objects within a graphics pipeline.
  • Floating-Point Precision Utilities - Provides specialized utilities for managing floating-point precision and numerical stability in real-time rendering pipelines.
  • Vector - Calculates operations on two to four component vectors using an exhaustive set of operators designed for graphics and geometric transformations.
  • Linear Algebra - Provides a collection of template-based mathematical primitives for high-performance geometric transformations.
  • Quaternion Mathematics - Provides quaternion-based rotation and transformation functions for smooth object movement in 3D space.
  • Floating-Point Quaternions - Provides single-precision floating-point quaternions for 3D rotation and orientation.
  • Quaternion Rotation Utilities - Calculates rotations and orientations using quaternions to manage complex object movement and orientation.
  • Sized Scalar Type Definitions - Provides explicit bit-width scalar types for consistent cross-platform precision.
  • Value Comparators - Checks if the difference between two values or vectors falls within a specific tolerance threshold for floating-point equality testing.
  • Epsilon-Based Type Comparators - Evaluates equality between scalar or vector types using custom tolerance values to ensure accurate results.
  • Epsilon Quaternion Comparators - Evaluates the equality of two quaternions by checking if the difference between their components falls within a specified tolerance threshold.
  • Header-Only Libraries - Distributes mathematical primitives as a header-only collection to simplify integration and eliminate binary dependencies.
  • Matrix Operations - Calculates determinants, inverses, transposes, and component-wise or outer products for square and rectangular matrices.
  • Rendering Pipeline Math - Generates projection, frustum, and transformation matrices for mapping 3D scenes to 2D screens.
  • Geometric Intersection Calculators - Determines the intersection points, distances, or normals between rays and geometric primitives such as spheres, triangles, and planes.
  • Spatial Vector and Matrix Operations - Executes common mathematical functions for matrices and vectors to support general 3D spatial logic.
  • Matrix Calculation Utilities - Provides a suite of mathematical types and operators for two-to-four dimensional matrices to facilitate graphics software development.
  • Matrix Rotation Extractors - Isolates rotational components from transformation matrices for orientation data.
  • Rotation Calculators - Calculates rotation matrices and quaternions from axes and angles for 3D object transformations.
  • Mathematical Function Implementations - Provides a comprehensive suite of mathematical functions that mirror shading language behavior for consistent graphics development.
  • Fixed-Precision Specializations - Provides compile-time generation of fixed-precision scalars and vectors for hardware-specific memory layouts.
  • Quaternion Interpolators - Calculates smooth transitions between orientations using normalized linear, short-path, and squad interpolation methods.
  • Transformation Matrices - Calculates perspective or orthographic transformation matrices to define how 3D scenes are mapped onto a 2D screen.
  • Epsilon Matrix Comparators - Evaluates the equality of two matrices by checking if the difference between their corresponding components is within a specified tolerance level.
  • Frustum Matrix Generators - Calculates projection matrices that define the visible volume for graphics rendering.
  • Mathematical Libraries - Math library for OpenGL interoperability.
  • Mathematics - OpenGL-compatible header-only math library.
  • Networking and Utilities - Header-only math library for graphics.
  • Graphics and Games - OpenGL mathematics library.
  • Numeric Precision Management - Provides specialized epsilon-based comparison and rounding utilities to ensure numerical stability in graphics calculations.
  • Vector Component Comparators - Performs component-wise relational comparisons between two vectors to produce a boolean vector indicating the result of each individual operation.
  • Squared Length Calculators - Calculates squared lengths to improve performance by bypassing square root operations.
  • SIMD-Aligned Data Structures - Structures mathematical primitives to align with hardware memory requirements for efficient data access.
  • Vector Rotation Routines - Applies rotational transformations to vectors around specific axes or planes.
  • Fixed-Width Integer Implementations - Provides fixed-width integer types for consistent memory representation across platforms.
  • Floating Point Distance Calculators - Computes the number of units in the last place between two floating-point values or vectors to measure numerical precision.
  • Geometric Operations - Calculates standard geometric properties and transformations for quaternions, including dot products, cross products, and normalization.
  • Dual Quaternion Operators - Calculates dual quaternion transformations including identity creation, inversion, normalization, and linear interpolation.
  • Dual Quaternions - Provides specialized dual quaternion data structures for representing rigid body transformations.
  • High-Precision Quaternion Calculators - Computes rotations and orientations using double-precision floating point numbers to maintain high accuracy.
  • Quaternion Arithmetic Routines - Calculates exponential, logarithmic, power, and square root values for quaternions to support complex mathematical transformations.
  • Quaternion-Matrix Converters - Transforms dual quaternions into matrices and vice versa to bridge between different mathematical representations of spatial data.
  • Numerical Accuracy Management - Evaluates mathematical function accuracy using ULP metrics to ensure numerical stability.
  • Fast Square Root Approximators - Provides high-speed square root approximations for real-time graphics rendering performance.
  • Spline Interpolators - Computes points along Catmull-Rom, cubic, or Hermite curves based on input control points to facilitate smooth path generation.
  • Vector Interpolators - Computes smooth transitions between orientations using normalized linear, short-path, or squad interpolation methods.
  • Coordinate Space Mappers - Converts between object-space and window-space coordinates to facilitate accurate object picking and rendering tasks.
  • Euler Angle Converters - Builds homogeneous rotation matrices from Euler angle sequences to define 3D object orientation.
  • Quaternion Orientation Generators - Generates quaternions representing specific viewing directions and orientations, supporting both left-handed and right-handed coordinate systems.
  • Component-wise Math Operators - Calculates common mathematical functions such as absolute values, rounding, and clamping across individual components of vectors and matrices to support graphics-oriented computations.
  • Inversion Utilities - Computes the inverse of affine matrices or the inverse transpose of floating-point matrices to support specialized graphics transformations.
  • Procedural Texture Generators - Supports procedural generation of textures and terrain through noise, gradients, and easing curves.
  • Triangle Rasterization - Calculates normal vectors for triangles to assist with lighting and surface orientation.
  • Diagonal Manipulations - Constructs diagonal matrices with specified values to facilitate scaling and projection operations.
  • Object Construction Optimizations - Generates vector or matrix objects by reading raw data from memory addresses to initialize structures from existing buffers.
  • Exponential Operations - Calculates powers, logarithms, and square roots for floating-point vectors using standard mathematical operations defined for graphics programming.
  • Fast Numerical Methods - Implements fast numerical methods to accelerate graphics-intensive mathematical operations.
  • QR Factorization - Factors matrices into orthonormal and triangular components to simplify complex linear algebra operations.
  • Norm Calculators - Computes various vector norms including L1, L2, and LMax for individual vectors or the distance between two vectors.
  • Geometric Intersections - Computes the closest point on a line segment to an arbitrary point in 3D space.
  • Floating-Point Packers - Converts floating-point numbers into compact integer representations and restores them to their original precision to optimize memory usage.
  • Power-of-Two Rounding Utilities - Provides utilities for rounding integer vector components to the nearest power of two.
  • Trigonometric Functions - Computes standard and inverse trigonometric functions for scalar and vector inputs to support complex geometric calculations.
  • Mathematical Function Extenders - Adds specialized operations like matrix decomposition and bitfield manipulation to improve performance for complex graphics calculations.
  • Memory Alignment Utilities - Aligns mathematical data structures to enable hardware-level acceleration and SIMD optimization.
  • Numerical Representation Converters - Translates rotation data between quaternion and matrix formats to facilitate interoperability between graphics systems.
  • Quaternion Comparators - Evaluates component-wise relationships between two quaternions to determine if one is greater than, less than, or equal to another.
  • Vector Type Converters - Scale integer vector components to normalized floating-point values and vice versa to facilitate data format conversion.
  • Header-Only Library Integrations - Allows developers to incorporate mathematical primitives directly into projects by including source files.
  • Memory Alignment Utilities - Enforces memory alignment for vectors and matrices to ensure hardware compatibility and performance.
  • Pointer-Based Type Constructors - Creates vectors or matrices by reading raw data from memory addresses to enable data exchange with external interfaces.
  • Easing Functions - Computes mathematical interpolation curves including back, bounce, circular, cubic, and elastic easing for smooth animation and motion transitions.
  • Coordinate Converters - Transforms vectors between Euclidean and polar coordinate representations to facilitate geometric calculations in graphics applications.
  • Cross Product Matrix Builders - Constructs skew-symmetric matrices from vectors to represent cross product operations.
  • Derived Rotation Matrix Generators - Creates homogeneous matrices that combine rotation angles and angular velocities for advanced motion transformations.
  • Storage Order Constructors - Builds matrices using row-major or column-major ordering by assembling them from individual vectors.
  • Logarithmic Transformers - Computes logarithms using specified bases for scalar and vector inputs.
  • Associated Maximum Finders - Identifies the maximum value among a set of inputs and return the corresponding associated values for each comparison.
  • Associated Value Comparators - Identifies the minimum or maximum value among a set of inputs and return the corresponding associated values for each comparison.
  • Vector Component Aggregators - Calculates sum, product, minimum, or maximum values across all components within a single vector.
  • Vector Projections - Provides geometric vector projection functions for calculating directional components in 3D space.
  • Squared Metric Calculators - Computes the squared length of a vector or the squared distance between two vectors to avoid expensive square root operations during geometric calculations.
  • Build System Integrations - Configures native build systems to include mathematical primitives within existing software projects.
  • Associated Minimum Finders - Identifies the minimum value among a set of inputs and return the corresponding associated values for each comparison.
  • Spatial Orientation Matrix Builders - Constructs a four-by-four rotation matrix based on a normal vector and an up vector to define spatial orientation.
  • Picking Region Matrices - Creates transformation matrices that restrict rendering or selection to a specific viewport area for interactive object selection.
  • Mathematical - Ensures consistent mathematical data structures across different development environments.
  • Fast Power Calculators - Provides optimized power functions to maintain high frame rates in graphics applications.
  • Matrix-Vector Products - Creates matrices with specific memory layouts by assembling them from individual vectors or converting existing structures.
  • Matrix Component Accessors - Provides methods to retrieve or modify specific rows or columns within matrix structures.
  • Normalized Value Converters - Transforms normalized floating-point values into signed or unsigned integer representations of varying bit-depths for optimized data representation.
  • Floating Point Handlers - Validates floating-point data by checking for infinity or NaN values in quaternion components.
  • Floating-Point Navigators - Returns the next or previous representable floating-point value based on a specified number of units in the last place.
  • Exponential Computation Utilities - Provides optimized exponential and logarithmic functions for performance-sensitive graphics tasks.
  • Power-of-Two Identifications - Determines the nearest, next higher, or next lower power of two value relative to a given input integer or vector.
  • Orthonormalization Routines - Provides routines to orthonormalize geometric data for maintaining coordinate system integrity.
  • Orthonormalization Utilities - Calculates an orthogonal unit vector from a pair of input vectors to establish a normalized coordinate basis.
  • Integer Arithmetic - Performs common arithmetic operations including factorials, powers, square roots, and logarithms on integer types to support graphics-related calculations.
  • Integer Bit Analyzers - Provides bit-level analysis utilities for integer data manipulation.
  • Integer Logarithm Calculators - Computes the base-2 logarithm of integer values to assist in tasks such as determining mipmap levels for texture processing.
  • Power Functions - Computes optimized powers for numeric values to improve graphics performance.
  • Integer Matrix Structures - Supports specialized graphics calculations requiring non-floating point matrix precision.
  • Bit-Packed Storage - Provides techniques for converting floating-point scalars and vectors into specialized bit-packed integer representations for efficient storage.
  • Integer Vector Packers - Converts integer vectors into compact bit-packed formats by mapping components to specific bit-depths.
  • Vector Data Packers - Converts vector components into specialized packed formats to optimize memory usage and storage efficiency.
  • Memory Pointer Accessors - Retrieves direct memory addresses for vector or matrix objects to share data buffers with external graphics systems.
  • Derived Rotation Matrices - Computes homogeneous matrices representing rotation and angular velocity about a specific axis for dynamic transformation calculations.
  • Matrix Orthonormalizers - Transforms a 3x3 matrix into an orthonormal form to ensure that its basis vectors are mutually perpendicular and unit length.

Star history

Star history chart for g-truc/glmStar history chart for g-truc/glm

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does g-truc/glm do?

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.

What are the main features of g-truc/glm?

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.

What are some open-source alternatives to g-truc/glm?

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…

Open-source alternatives to Glm

Similar open-source projects, ranked by how many features they share with Glm.
  • toji/gl-matrixtoji avatar

    toji/gl-matrix

    5,654View on GitHub↗

    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

    JavaScript
    View on GitHub↗5,654
  • microsoft/directxtkmicrosoft avatar

    microsoft/DirectXTK

    2,781View on GitHub↗

    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

    C++cpp-librarydesktopdirectx
    View on GitHub↗2,781
  • nicbarker/claynicbarker avatar

    nicbarker/clay

    17,443View on GitHub↗

    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

    Clayoutui
    View on GitHub↗17,443
  • candycat1992/unity_shaders_bookcandycat1992 avatar

    candycat1992/Unity_Shaders_Book

    6,061View on GitHub↗

    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

    ShaderLab
    View on GitHub↗6,061
  • See all 30 alternatives to Glm→