toji/gl-matrix

Javascript Matrix and Vector library for High Performance WebGL apps

JavaScript

5,700

602 commits

updated Jul 13, 2026

See the code

README

glMatrix

NPM Version Build Status

JavaScript has evolved into a language capable of handling realtime 3D graphics, via WebGL, and computationally intensive tasks such as physics simulations. These types of applications demand high performance vector and matrix math, which is something that JavaScript doesn't provide by default. glMatrix to the rescue!

glMatrix is designed to perform vector and matrix operations stupidly fast! By hand-tuning each function for maximum performance and encouraging efficient usage patterns through API conventions, glMatrix will help you get the most out of your browser's JavaScript engine.

Learn More

For documentation and news, visit the glMatrix Homepage

For a tutorial, see the "Introducing glMatrix" section of Introduction to Computer Graphics by David J. Eck

For a babel plugin to make writing the API nicer, see babel-plugin-transform-gl-matrix

Regarding the current performance in modern web browsers, calling glMatrix.setMatrixArrayType(Array) to use normal arrays instead of Float32Arrays can greatly increase the performance.

Contributing Guidelines

See CONTRIBUTING.md

Building

See BUILDING.md

toji/gl-matrix

Javascript Matrix and Vector library for High Performance WebGL apps

JavaScript

5,700

602 commits

updated Jul 13, 2026

See the code

README

glMatrix

NPM Version Build Status

JavaScript has evolved into a language capable of handling realtime 3D graphics, via WebGL, and computationally intensive tasks such as physics simulations. These types of applications demand high performance vector and matrix math, which is something that JavaScript doesn't provide by default. glMatrix to the rescue!

glMatrix is designed to perform vector and matrix operations stupidly fast! By hand-tuning each function for maximum performance and encouraging efficient usage patterns through API conventions, glMatrix will help you get the most out of your browser's JavaScript engine.

Learn More

For documentation and news, visit the glMatrix Homepage

For a tutorial, see the "Introducing glMatrix" section of Introduction to Computer Graphics by David J. Eck

For a babel plugin to make writing the API nicer, see babel-plugin-transform-gl-matrix

Regarding the current performance in modern web browsers, calling glMatrix.setMatrixArrayType(Array) to use normal arrays instead of Float32Arrays can greatly increase the performance.

Contributing Guidelines

See CONTRIBUTING.md

Building

See BUILDING.md

Significant stargazers

(top 24 of 66)

Armin Ronacher

25,784 followers · starred Oct 2011

Renée

498 followers · starred Dec 2024

Dominic Tarr

3,710 followers · starred Oct 2011

Marvin Hagemeister

1,711 followers · starred Mar 2023