wtc-math
wtc-gl re-exports wtc-math, so its vectors, matrices and quaternions come from the same import as everything else.
js
import { Vec2, Vec3, Vec4, Mat3, Mat4, Quat } from 'wtc-gl'wtc-math has its own reference: wethegit.github.io/wtc-math.
A few things to know when using it with wtc-gl:
- Matrices are column-major, as WebGL expects. In a
Mat4,a11–a14are the first column, anda41–a43are the translation. - Methods ending in
New(addNew,scaleNewand so on) return a new vector; the others change the vector in place. .arraygives a vector's or matrix's values as an array, ready for aUniform.