@webgpu-art/caterfoil
v0.0.7
Published
Demo (try with Gamepad) <https://webgpu.art/caterfoil.ts/>. Hold `△` (face4) to switch from regular view controls to the fourth-dimension movement and rotation controls.
Readme
Caterfoil - 4D objects rendering on 2D screen
Demo (try with Gamepad) https://webgpu.art/caterfoil.ts/. Hold △ (face4) to switch from regular view controls to the fourth-dimension movement and rotation controls.

Reused some code from https://github.com/WebGPU-Art/lagopus.ts .
4D objects to 2D projection is calculated with Geometric Algebra inner product. The screen depth direction is a normalized mix of forward and w directions,
cos(phi) * forward + sin(phi) * w_direction, with phi defaulting to π/4.
You can tweak the view mix from the query string, for example ?phi=0 for a pure forward depth direction or ?phi=1.57079632679 for a pure w depth direction.
License
MIT
