Skip to the content

Kyuubuキューブ

Turn CSS 3D cubes by touch, keys or notation, reproduce a scramble from a seed, and follow a solve one named step at a time.

Kyuubu (キューブ) is the Japanese spelling of cube. About the name

Contents

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

NameTypeDescription
vVec3

The vector to rotate in model coordinates.

axisCubeAxis

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kyuubu 1.14.1.