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

moveForWheelfunction

The turn the wheel means over a sticker. across turns the layer that carries it most nearly sideways, rolling the wheel down carrying it right; upDown the layer that carries it most nearly up and down, down carrying it down; face turns the face it is on, down turning it clockwise.

Import it

import { moveForWheel } from "@johnmorrisdotca/kyuubu";

Definition

function moveForWheel(slot: StickerSlot, n: number, view: Mat3, way: "across" | "upDown" | "face", down: boolean): CubeMove

Parameters

NameTypeDescription
slotStickerSlot

The sticker’s centre and outward normal.

nnumber

The cube’s side length.

viewMat3

The view matrix, or mounted CubeView for a guide.

way"across" | "upDown" | "face"

The wheel gesture: across, upDown or face.

downboolean

Whether the wheel rolls down.

Returns

CubeMove

The turn the wheel means over a sticker. across turns the layer that carries it most nearly sideways, rolling the wheel down carrying it right; upDown the layer that carries it most nearly up and down, down carrying it down; face turns the face it is on, down turning it clockwise.

Examples

import { cubeSlots, moveForWheel, viewMatrix } from "@johnmorrisdotca/kyuubu";

const view = viewMatrix(-30, -20);
const slot = cubeSlots(3).slots[0]!;
console.log(moveForWheel(slot, 3, view, "face", true));
{ axis: 1, layer: 2, turns: 3 }

What it prints (run when this page was built)

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