Reference · Surface maze rules and geometry
stepTurnfunction
A turn about the viewer's own axes: right radians about the vertical (the solid's near side moves right) and down about the horizontal.
Import it
import { stepTurn } from "@johnmorrisdotca/meikyuu/3d";
Definition
function stepTurn(q: Quat, right: number, down: number): Quat
Parameters
| Name | Type | Description |
|---|---|---|
q | Quat | The current normalized rotation quaternion. |
right | number | The horizontal view rotation in radians. |
down | number | The vertical view rotation in radians. |
Returns
Quat
A turn about the viewer's own axes: right radians about the vertical (the solid's near side moves right) and down about the horizontal.
Examples
import type { Quat } from "@johnmorrisdotca/meikyuu/3d";
import { stepTurn } from "@johnmorrisdotca/meikyuu/3d";
const q: Quat = [0,0,0,1];
console.log(stepTurn(q,0.1,0));[ 0, 0.04997916927067833, 0, 0.9987502603949663 ]What it prints (run when this page was built)