Mathematical functions for 2D/3D matrices, quaternions, and vectors
This library provides a set of utilities for working with
mathematical operations commonly used in 3D graphics, including
vector and matrix operations such as dot products, vector
negation, addition, and more.
Features
Allocation-aware — typed Vec/Mat constructors return
raw Float32Array / Float64Array typed-array views so they
round-trip cleanly through GPU upload paths.
In-place + out-of-place variants — most ops accept an
optional dest so hot-paths can reuse pre-allocated scratch.
Double-precision throughout — every transform / boundary
math op exists in both Float32 and Float64 flavours; the
Float64 path is used by the scene-graph for accurate world-scale
transforms.
Compression helpers — quantise / dequantise positions
against an AABB, oct-encode / decode normals, pack UVs against
a [uMin, uMax, vMin, vMax] rect. Used by the
SceneModel builder and XGF
format I/O.
RTC (Relative-To-Centre) — tile-based world ↔ local
conversions that keep GPU positions near the origin for
real-world-scale models.
xeokit SDK Math Libraries
Mathematical functions for 2D/3D matrices, quaternions, and vectors
This library provides a set of utilities for working with mathematical operations commonly used in 3D graphics, including vector and matrix operations such as dot products, vector negation, addition, and more.
Features
Vec/Matconstructors return rawFloat32Array/Float64Arraytyped-array views so they round-trip cleanly through GPU upload paths.destso hot-paths can reuse pre-allocated scratch.[uMin, uMax, vMin, vMax]rect. Used by the SceneModel builder and XGF format I/O.Installation
To install the xeokit SDK, use the following npm command:
Usage
You can import and use functions from the math module as follows: