Vector3 - noobgl/noobgl-matrix GitHub Wiki

The Vector3 is the must commonly used vector for 3D.

Import

import { Vector3 } from "noobgl-vector";

Constructor

new Vector3(x, y, z);
  • x (optional) the X value of the vector (default 0).
  • y (optional) the Y value of the vector (default 0).
  • z (optional) the Z value of the vector (default 0).

Properties

.x the X value of the vector.

.y the Y value of the vector.

.z the Z value of the vector.

.length the length of the vector

Methods

set(x, y, z)

add(x, y, z)

subtract(x, y, z)

multiply(x, y, z)

divide(x, y, z)

cross(x, y, z)

normalize()

clone()

static length(x, y, z)