Reference · Cube engine and views
quarterTurnfunction
A quarter turn counter-clockwise, seen from the axis's positive end.
Import it
import { quarterTurn } from "@johnmorrisdotca/kyuubu";
Definition
function quarterTurn(v: Vec3, axis: CubeAxis): Vec3
Parameters
| Name | Type | Description |
|---|---|---|
v | Vec3 | The vector to rotate in model coordinates. |
axis | CubeAxis | The model axis: 0 for x, 1 for y, or 2 for z. |
Returns
Vec3
A quarter turn counter-clockwise, seen from the axis's positive end.
Examples
import { quarterTurn } from "@johnmorrisdotca/kyuubu";
console.log(quarterTurn([1, 0, 0], 2));[ -0, 1, 0 ]What it prints (run when this page was built)