Skip to content

Feat: Player Piano demo reel + animation state persistence fixes#90

Merged
arossti merged 9 commits intomainfrom
Player-Piano
Feb 11, 2026
Merged

Feat: Player Piano demo reel + animation state persistence fixes#90
arossti merged 9 commits intomainfrom
Player-Piano

Conversation

@arossti
Copy link
Owner

@arossti arossti commented Feb 11, 2026

Summary

  • Player Piano demo reel generator (18-view scripted tour of primitives, platonics, geodesics, tetrahelixes incl. octahedral fireworks)
  • Complete animation state persistence for matrices and tetrahelix3
  • Matrix dissolve opacity pipeline fix
  • Camera slerp fix at Z poles

Changes

Player Piano (scripts/PlayerPiano-generator.js — gitignored)

  • 18-view demo reel: 3 primitives, 5 platonics, 4 geodesics, 6 tetrahelixes (incl. octahedral Tetrahelix3 "fireworks" bloom)
  • Close-up camera framing throughout, pulls back only for ensemble/torus views

State Persistence Fixes (rt-delta.js, rt-filehandler.js)

  • Matrix sub-controls (9326f11): 5 rotate45 toggles, 10 matrix sub-control panels, slider display text — all added to delta capture + filehandler export/import
  • Radial mode toggles (66de343): radialCubeSpaceFill, radialTetIVMMode, radialOctIVMScale added to full persistence pipeline
  • Tetrahelix3 (e3a7add): showTetrahelix3 + 8 strand toggles + 8 chirality toggles added to delta capture; sub-control panel mapping added
  • Double updateGeometry() (66de343): Removed redundant explicit call in buildSteppedTick() — slider dispatch already triggers rebuild

Rendering (rt-rendering.js)

  • Matrix dissolve opacity (66de343): All 10 matrix creation blocks (5 planar + 5 radial) now read group.userData.dissolveOpacity and compute effectiveOpacity before passing to matrix creators

Camera (rt-animate.js — prior commit)

  • Slerp torque at Z poles (bfc1a1c): Proper angle-based slerp for direction interpolation + interpolated up vector

Documentation (Animations.md)

  • Matrix animation known limitation documented with short/medium/long-term pipeline
  • Matrix dissolve opacity optimization workplan (skip rebuilds for opacity-only ticks)
  • All resolved bugs documented with commit hashes

Test plan

  • 18-view demo reel generates and plays back with smooth dissolves
  • Tetrahelix3 octahedral fireworks visible in playback (was blank before delta fix)
  • Radial matrix mode toggles (Space Filling / IVM) persist across save/load
  • Matrix 45° rotation + size slider + sub-control panels persist
  • Camera transitions smooth through Z-pole presets
  • Verify no regressions in manual view creation/editing workflow

🤖 Generated with Claude Code

Co-Authored-By: Andy🤦‍♂️ & Claude🤖 andy@openbuilding.ca

- PlayerPiano-generator.js: 23-view browser console script that tours
  primitives, platonic solids, geodesics, planar/radial matrices, and
  tetrahelixes with camera tumbling between axis views
- Fix captureView() → saveView() call chain (views were created but
  never pushed to state.views)
- Document three discovered bugs in Animations.md:
  - Camera slerp torque on Z-down transitions (quaternion antipodal)
  - Planar/radial matrix groups missing dissolve transitions
  - Radial matrix state not persisting across save/load

🤖 Co-Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Andy🤦‍♂️ & Claude🤖 <andy@openbuilding.ca>
Developer-only console utility that auto-downloads files — should not
be in the public repo. Moved to scripts/ alongside other local tools.

🤖 Co-Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Andy🤦‍♂️ & Claude🤖 <andy@openbuilding.ca>
Two fixes in animateToView():

1. Proper slerp formula for direction interpolation — replaces
   lerp+normalize which breaks near antipodal directions (midpoint
   approaches zero). Angle-based slerp sin((1-t)ω)/sin(ω) handles
   all angular separations correctly.

2. Interpolated up vector — instead of hardcoding camera.up=(0,0,1)
   every frame (which is degenerate when looking along Z axis), now
   captures start up vector and computes end up vector matching
   setCameraPreset Z-pole logic (Y-up near poles). Smooth lerp
   between them avoids the lookAt singularity that caused the 180°
   torque on zdown/zup transitions.

Also adds note about possible browser freeze on tab switch during
preview playback (requestAnimationFrame burst on tab regain).

🤖 Co-Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Andy🤦‍♂️ & Claude🤖 <andy@openbuilding.ca>
…te slider displays, reveal sub-control panels

Three interrelated bugs fixed:
1. 45° rotation toggles (cubeMatrixRotate45 etc.) were absent from both RTDelta capture and RTFileHandler export — now captured in both systems
2. Matrix size slider display text stayed at "1×1" after import because importState() set el.value without updating the display element — now explicitly updates N×N format
3. Matrix sub-control panels (size slider, 45° toggle) stayed hidden after import because importState() had no show/hide blocks for matrix controls — added 10 entries (5 planar + 5 radial)

Also: applyDelta() now toggles sub-control panel visibility via _subControlMap, fixing view transitions too.
Radial frequency slider displays also updated with correct Fn format on import.

🤖 Co-Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Andy🤦‍♂️ & Claude🤖 <andy@openbuilding.ca>
… maintenance

- Mark matrix sub-control persistence bug as RESOLVED (9326f11) with full root cause analysis
- Remove archived Janus-Inversion-JAN23.tex, add Universalize-Logs.md

🤖 Co-Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Andy🤦‍♂️ & Claude🤖 <andy@openbuilding.ca>
…rebuild

Three fixes for matrix animation and state persistence:

1. Matrix dissolve opacity — all 10 matrix creation blocks (5 planar +
   5 radial) in rt-rendering.js now read group.userData.dissolveOpacity
   and compute effectiveOpacity before passing to matrix creators.
   Matrices previously popped in at full slider opacity, bypassing the
   dissolve fade system that regular polyhedra use via renderPolyhedron().

2. Radial matrix mode toggles — radialCubeSpaceFill, radialTetIVMMode,
   radialOctIVMScale added to rt-delta.js captureCheckboxes() and
   rt-filehandler.js exportState()/importState(). These three toggles
   were missing from the entire persistence pipeline.

3. Double updateGeometry() per tick — buildSteppedTick() in rt-delta.js
   called _setSlider() (which dispatches 'input' → updateGeometry())
   then also called updateGeometry() explicitly. Removed the redundant
   call; explicit rebuild now only fires for projection radio snaps.

🤖 Co-Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Andy🤦‍♂️ & Claude🤖 <andy@openbuilding.ca>
…orkplan, 30-view demo reel

🤖 Co-Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Andy🤦‍♂️ & Claude🤖 <andy@openbuilding.ca>
Matrix forms (planar + radial) produce glitchy dissolve transitions due
to duplicated geometry with coplanar z-fighting and per-cell material
overhead. Documented as known limitation in Animations.md with short,
medium, and long-term pipeline items.

PlayerPiano generator trimmed from 30 to 15 views — removes Acts 4 & 5
(planar/radial matrices), keeps primitives, platonics, geodesics, and
tetrahelixes which all dissolve cleanly.

🤖 Co-Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Andy🤦‍♂️ & Claude🤖 <andy@openbuilding.ca>
showTetrahelix3, all 8 strand toggles (A-H), and all 8 chirality
toggles were absent from RTDelta._captureCheckboxes(). View deltas
never captured the checkbox state, so playback transitions showed
blank scenes for tetrahelix3 views.

Also added showTetrahelix3 → tetrahelix3-controls to _subControlMap
so the sub-control panel reveals during delta apply.

🤖 Co-Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Andy🤦‍♂️ & Claude🤖 <andy@openbuilding.ca>
@github-actions
Copy link

🤖 Claude Code Review

Looking through the diff and file contents, here's what I found:

Code Quality Issues

1. Unused variables

  • File: modules/rt-animate.js
  • Location: Line 436 in exportAnimation() function
const endZoom = to

This variable declaration is incomplete/cut off at the end of the file, suggesting the code may be truncated or there's a syntax error.

2. Large function

  • File: modules/rt-animate.js
  • Function: animateToView() (lines 42-146)
  • Length: 104+ lines
  • This function handles camera animation setup, state management, position/rotation interpolation, and animation loop control. Consider extracting smaller functions for:
    • Camera state capture and target computation
    • Slerp interpolation logic
    • Animation tick handling

3. Large function

  • File: modules/rt-animate.js
  • Function: _setupFormDissolve() (lines 417-527)
  • Length: 110+ lines
  • This function handles form dissolve animation setup with cleanup, target identification, pre-animation setup, and tick callback creation. Consider breaking into smaller focused functions.

4. Code duplication

  • File: modules/rt-animate.js
  • Lines: 598-611 and 613-626
_updatePlayStopBtn(
  "previewAnimationBtn", 
  playing,
  "Stop animation preview",
  "Preview animation loop in scene"
);

_updatePlayStopBtn(
  "previewFullBtn",
  playing, 
  "Stop full-scene animation preview",
  "Preview with full scene restore (cutplane, render state)"
);

These two functions (_updatePreviewButton and _updatePreviewFullButton) follow identical patterns and could be consolidated into a single parameterized function.

No issues found.


ℹ️ About this review

This automated review checks for:

  • Debug statements (console.log)
  • Commented-out code
  • Code duplication
  • Large functions (>50 lines)
  • Unused variables

Human review required - these are suggestions only.
Diff size: 79967 bytes

@arossti arossti self-assigned this Feb 11, 2026
@arossti arossti merged commit de2ab9c into main Feb 11, 2026
3 checks passed
@arossti arossti deleted the Player-Piano branch February 13, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant