vector_math.js
A Node.js vector math library for 3D and 2D applications
Javascript version of vector_math.dart with SIMD implementation from glMatrix
Features
- 2D, 3D, and 4D vector and matrix types.
- Quaternion type for animating rotations.
- Collision detection: AABB, rays, spheres, ...
- Fully documented.
Missing features
- Utilities like color and common rendering related operations
- Flexible getters and setters, for example, position.xwz = color.grb;.
Npm install
"dependencies":
Example
This sample code shows how to manipulate matrices :
var m1 = Matrix4;var m2 = 00 10 20 30 00 10 20 30 00 10 20 30;var scale_mul = m1;
This sample code shows how to manipulate vectors :
var v1 = Vector3;var v2 = 10 00 20;console + v1);console;