JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2271052
  • Score
    100M100P100Q202007F
  • License MIT

Javascript Matrix and Vector library for High Performance 3D web apps

Package Exports

  • gl-matrix
  • gl-matrix/common
  • gl-matrix/mat2
  • gl-matrix/mat2d
  • gl-matrix/mat3
  • gl-matrix/mat4
  • gl-matrix/quat
  • gl-matrix/quat2
  • gl-matrix/vec2
  • gl-matrix/vec3
  • gl-matrix/vec4

Readme

Fast, flexible vector and matrix math for JavaScript

NPM Version Build Status

glMatrix is a high performance, very flexible library for vector and matrix operations in JavaScript/TypeScript, designed for the needs of realtime 3D graphics APIs like WebGL and WebGPU.

Docs

Documentation is available at https://glmatrix.net/docs/v4/

Using Float64Array

If your use case requires additional precision beyond the default 32-bit floats used by default, you can instead use a 64-bit verions of the library by importing from the f64/ directory of your chosen build type. For example:

import { Vec3 } from './gl-matrix/dist/esm/f64/vec3.js';

If you have a need to mix and match the 64 bit and 32 bit versions, you can do so by importing them as different names:

import { Vec3 as Vec3F32 } from './gl-matrix/dist/esm/vec3.js';
import { Vec3 as Vec3F64 } from './gl-matrix/dist/esm/f64/vec3.js';

All API calls are identical between the two versions, the only difference is the type of TypedArray which the classes extend.