# OpenGL Mathematics (GLM)

> Header-only C++ mathematics library for graphics, modelled on GLSL

Source: https://talira.ai/catalog/opengl-mathematics-glm-n4y9yh7v
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / math / linear algebra](https://talira.ai/categories/libraries/math/linear-algebra), [languages / c cpp](https://talira.ai/categories/languages/c-cpp)
- Licence: MIT OR The Happy Bunny License (Modified MIT License)[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [G-Truc Creation](https://talira.ai/orgs/g-truc.md)

OpenGL Mathematics (GLM) is a header-only C++ mathematics library for graphics software, built on the OpenGL Shading Language (GLSL) specifications: its vector and matrix types and functions use GLSL's names and behaviour, so anyone who knows GLSL can use it in C++. Extensions add matrix transformations, quaternions, data packing, random numbers and noise. It works with OpenGL and alongside other libraries, and suits software rendering, image processing and physics simulations. It needs a C++17 compiler (the 1.0 branch serves older ones) and has no dependencies.

## Links

- GitHub: https://github.com/g-truc/glm
- Docs: https://github.com/g-truc/glm/blob/master/manual.md

## Problems it solves

- vector and matrix maths for my OpenGL renderer in C++
- build a camera's view and projection matrices in C++
- use the same maths types in my C++ code as in my GLSL shaders
- a small header-only maths library for a raytracer

## Features

- GLSL-style vector and matrix types and functions in C++
- header-only, with no dependencies
- extensions for matrix transformations (translate, rotate, perspective) and quaternions
- data packing, random numbers and noise
- GCC, Clang, Visual C++ and experimental CUDA support

## Limitations

- Needs a C++17 compiler; older compilers need the 1.0 branch.[^1]

## Trust

Overall: 0.45 out of 1.
Signals: maintenance 0.27, adoption 0.81, momentum 0.55, community 0.98, backing 0.30, extensibility 0.00.

- latest release 1.0.3 11 months ago
- 11.3k GitHub stars
- 281 contributors
- backed by G-Truc Creation

Warnings:

- last commit 7 months ago

## Alternatives

- [Eigen](https://talira.ai/catalog/eigen-zcfdb1wb.md): C++ template library for linear algebra: matrices, vectors and solvers

## Sources

[^1]: https://github.com/g-truc/glm/blob/master/readme.md (checked 28 Nov 2026)
[^2]: https://github.com/g-truc/glm/blob/master/copying.txt (checked 28 Nov 2026)
