toji /gl-matrix

Javascript Matrix and Vector library for High Performance WebGL apps

★ 5,706⑂ 732👁 144⑃ 208● 295▤ 12
JavaScriptMITCreated 2011-10-05
Download: v3.4.4v3.4.4 ↓3.4.42025-08-08
-1
Daily
5,706
stars
732
forks
144
watchers
208
prs
295
issues
12
releases

README

glMatrix
=======================



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

Top issues

Latest release

v3.4.4 v3.4.4 2025-08-08
Merged multiple pull requests, addressed upcoming compatibility issues with Typescript, and updated some dependencies.

 What's Changed
 Convert to type "module" and use package exports by @lkmill in https://github.com/toji/gl-matrix/pull/432
 random should only return unit vector when scale is undefined by @marcusround in https://github.com/toji/gl-matrix/pull/437
 Fix mat3.scale docs claiming to rotate input mat by @cedric-h in https://github.com/toji/gl-matrix/pull/445
 use symmetric half up rounding in all vector modules. fixes 447 by @mreinstein in https://github.com/toji/gl-matrix/

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON