โ† All examples

geometry 4d

4D rotations as pairs of unit quaternions

Compose a 4D rotation from a left and a right unit quaternion, decompose any rotation matrix back into its pair, read its plane angles and kind (left or right isoclinic, simple, double), interpolate along geodesics with double slerp, and write left and right isoclinic loops of the 16-cell as glTF.

Recorded render of 4D rotations as pairs of unit quaternions

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • example.gltf
  • fourd.py
  • preview.png
  • quaternion_pair_rotations.py
  • test_package.py
  • verification/native.json

How it works

Entry points
compose, quaternion_from_rotation3, decompose, half_angle, pair_angles, classify, slerp, interpolate and 6 more
Outputs
example.gltf
Coordinates
x, y, z, w with p = w + xi + yj + zk; frames projected in perspective to Godot/glTF +Y up

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • cli_rebuilds_example
  • gltf_structure_example
  • cli_example_runs
  • cli_example_gltf_structure
  • godot_loads_example
  • godot_loads_cli_isoclinic_fast
  • preview_render

Limits to consider

The animation stores keyframes as morph targets, so vertices move along chords between them (0.6 percent of the radius at most for the example). Tubes are unlit three-sided prisms morphed without normal targets. Decomposition returns one of the two lifts (scalar part of l non-negative).