Get started with gl-matrix CDN

MIT licensed

Gl-matrix is a small and efficient library for matrix manipulations.

Tags:
  • math

Stable version

Copied!

How to start using gl-matrix CDN


// Include the gl-matrix library
const mat4 = require("gl-matrix");

// Define two 4x4 matrices
const matrixA = mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
const matrixB = mat4.fromValues(17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);

// Multiply matrixA and matrixB
const result = mat4.multiply(matrixA, matrixB);

// Print the result
console.log(mat4.toArray(result));

All versions