0.9.9 0.9.8 0.9.7 0.9.6 0.9.5 0.9.4 0.9.3 0.9.2 0.9.1 0.9.0

OpenGL Mathematics

GLSL + Optional features = OpenGL Mathematics (GLM)

A C++ mathematics library for graphics programming

OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specification and released under the MIT license.

This library provides classes and functions designed and implemented following as strictly as possible the GLSL conventions and functionalities so that when a programmer knows GLSL, he knows GLM as well, making it really easy to use.

This project isn't limited to GLSL features. An extension system provides extended capabilities: matrix transformations, quaternions, half-based types, random number generation, procedural noise functions, etc.

GLM ensures interoperability with third party libraries, SDKs and OpenGL; replacing advantageously the deprecated matrix functions. It is a good candidate for software rendering (Raytracing / Rasterisation), image processing, physic simulations and any context that requires a simple and convenient mathematics library.

  • It is a platform independent library with no dependence to external libraries even OpenGL. GLM is written in C++98 but can take advantage of C++11 when available. It supports the following compilers:
  • Clang 2.6 and higher
  • CUDA 3.0 and higher
  • GCC 3.4 and higher
  • LLVM 2.3 through GCC 4.2 front-end and higher
  • Visual C++ 2005 and higher
  • Any conform C++98 or C++11 compiler

For more information about GLM, please have a look at the manual and the API reference documentation.

Thanks for contributing to the project by submitting issues for bug reports and feature requests. Any feedback is welcome at