Orbit cube
Adds a hidden-vertex toggle for switching the coordinate readout between visible vertices and the full vertex buffer.
Rust + WebAssembly geometry
A browser-based cube transform demo where Rust owns the geometry, WebAssembly exposes the runtime API, and JavaScript only handles canvas rendering.
Loading WASM...
Version history
Vertex visibility controls make the Rust-owned cube buffer easier to inspect while orbiting.
Adds a hidden-vertex toggle for switching the coordinate readout between visible vertices and the full vertex buffer.
Adds solid cube faces and a drag camera so the cube can be inspected from every angle.
Improves 45-degree readability with a steadier canvas camera and camera-depth face ordering.
Removes the whole-cube shortcut, keeps explicit X, Y, and Z rotation controls, and stabilizes rotation framing.
Adds Rust-owned face vertices, colored face rendering, axis guides, and X, Y, and Z rotation controls.
Replaces the flat rectangle outline with 12 cube edge pairs and a projected 3D view.
Starts with the original Rust vertex buffer, WASM pointer reads, and clockwise Z-axis rotation.
Project logic
The cube starts as a single Rust vertex array made from explicit edge pairs. The browser reads those vertices from WebAssembly memory, projects them to canvas, and requests transforms through exported Rust functions.
Rotation happens in Rust through X, Y, and Z axis transforms using the cube center as the pivot.
JavaScript calls exported functions for reset, rotation, vertex count, and memory pointers. It never duplicates the transform formulas.
The canvas projects 3D world coordinates to pixels, marks the original top edge, and prints the current vertex buffer for inspection.
Implementation
The interaction is intentionally simple, which makes the data flow easy to inspect from UI event to Rust memory mutation.
Quality
Unit and integration tests verify bounds, cube edge geometry, clockwise rotation, center stability, and repeated rotations.
Node tests instantiate the compiled WASM module, validate exports, rotate the runtime buffer, and confirm negative zero is hidden.
GitHub Actions run formatting and the full test suite, then build the static `web/` artifact for GitHub Pages deployment.