Skip to content

feat(examples/three.js): cinematic skinned realtime pose demo + folder reorg#584

Merged
ruvnet merged 2 commits into
mainfrom
feat/three-skinned-realtime-pose-demo
May 17, 2026
Merged

feat(examples/three.js): cinematic skinned realtime pose demo + folder reorg#584
ruvnet merged 2 commits into
mainfrom
feat/three-skinned-realtime-pose-demo

Conversation

@ruvnet

@ruvnet ruvnet commented May 16, 2026

Copy link
Copy Markdown
Owner

Summary

Two commits ship the cinematic three.js demo collection plus an organized folder layout that scales to more demos.

  • 60d2c8eb8 — original demo bundle (5 progressive demos + ESP32 CSI bridge)
  • a9f37e513 — reorganize the flat 13-file root into demos/, screenshots/, server/, assets/; add a README.md indexing all five demos

Demo 05 (05-skinned-realtime.html) is the headline: webcam → MediaPipe Pose Heavy → Mixamo X Bot IK retargeting, with live ESP32-S3 CSI overlay from ruvultra:8766 (Tailscale). Demo 04 wires the same rig but driven by bundled animations only — useful as a fallback when no webcam is available.

Layout after reorg

examples/three.js/
├── README.md                       NEW
├── .gitignore                      MOD
├── demos/
│   ├── 01-helpers.html             ADR-097 helpers in the point-cloud viewer
│   ├── 02-cinematic.html           Cinematic camera + pseudo-CSI viz
│   ├── 03-skinned.html             GLTF skinned mesh + additive blending
│   ├── 04-skinned-fbx.html         Mixamo X Bot loaded from FBX
│   └── 05-skinned-realtime.html    MediaPipe Pose → Mixamo IK + live ESP32 CSI
├── screenshots/                    one PNG per demo
├── server/
│   ├── serve-demo.py               local HTTP server, no-cache headers
│   └── ruvultra-csi-bridge.py      ESP32 CSI WebSocket bridge (ruvultra:8766)
└── assets/
    └── X Bot.fbx                   gitignored — get your own from mixamo.com

Code changes beyond renames

  • 04-skinned-fbx.html, 05-skinned-realtime.html: MODEL_URL resolves '../assets/X%20Bot.fbx'
  • server/serve-demo.py: chdir() walks 3 levels up (was 2); URL banner lists all 5 demos
  • .gitignore: comment refresh pointing at assets/ and screenshots/
  • 05-skinned-realtime.html also picks up in-flight fps-tune work from this branch (Holistic script tag, SMOOTH_K URL param, slerp gain scaling) — same file as the rename

Verified end-to-end

  • python examples/three.js/server/serve-demo.py
  • All 5 demos → 200 OK
  • assets/X%20Bot.fbx → 200 OK from both demo 04 and demo 05 paths
  • Browser screenshots of demo 04 + 05 confirm X Bot mesh renders
  • eval() reports 0 JS errors on demo 05
  • Zero 404s in server access log

Related issues

Test plan

  • Reorg verified with agent-browser on all 5 demos
  • X Bot.fbx still loaded by demos 04 and 05 from new assets/ path
  • serve-demo.py chdir + URL listing updated for new depth
  • (Reviewer, optional) Demo 05 with real webcam — retarget MediaPipe pose onto rig in real time
  • (Reviewer, optional) Demo 05 with live ESP32 CSI feed from ruvultra:8766 — CSI overlay panel populates

🤖 Generated with claude-flow

… CSI bridge

Five-stage example progression exploring three.js helpers (ADR-097 surface) as
a viewer for live RuView sensor data:

1. helpers-demo.html              — clean ADR-097 helper reference (GridHelper,
                                    PolarGridHelper, BoxHelper, AxesHelper),
                                    file://-safe, no backend
2. helpers-cinematic.html         — same scene + UnrealBloomPass + pseudo-CSI
                                    sonar pings + tomography sweep + procedural
                                    cyber floor + ambient drift particles
3. helpers-skinned.html           — replaces sphere skeleton with Mixamo X Bot
                                    via GLTFLoader from threejs.org CDN, plays
                                    bundled animations with additive blending
4. helpers-skinned-fbx.html       — same but loads a local Mixamo FBX (needs
                                    serve-demo.py — file:// can't fetch local
                                    siblings). Drop X Bot.fbx alongside.
5. helpers-skinned-realtime.html  — webcam → MediaPipe Pose Heavy →
                                    poseWorldLandmarks → direct quaternion
                                    retargeting onto the Mixamo skeleton.
                                    Real ESP32-S3 CSI streamed over WebSocket
                                    from ruvultra (Tailscale, port 8766).

Supporting:
  - serve-demo.py             threaded HTTP server with no-cache headers
                               (fixes net::ERR_EMPTY_RESPONSE on the FBX path)
  - ruvultra-csi-bridge.py    ESP32 RuView firmware tick → WebSocket bridge,
                               runs as systemd-run unit on ruvultra

Bugs found + fixed along the way (all documented in code comments):
  - FBX exports yield TWO parallel Bone trees with identical names; only the
    SkinnedMesh.skeleton.bones one drives visible deformation. model.traverse
    finds orphans.
  - Mixamo FBX nests a zero-length wrapper bone above the real bone, same name.
    bone.children[0].getWorldPosition == bone.getWorldPosition → restDir is
    (0,0,0) → setFromUnitVectors collapses to identity. Walk past same-named
    same-position wrappers when computing tail.
  - AnimationMixer.update() with a "stopped" action still mutates bones unless
    enabled=false is set.

Retargeting layer in helpers-skinned-realtime.html:
  - 12 bones direct quaternion retarget (arms × 2, legs × 2, spine × 3, neck)
  - Hips root rotation from shoulder/hip line basis (torso twist + lean)
  - Neck aims at ear-midpoint (kp 7+8), not nose (kp 0), to remove the
    forward bias of the protruding-nose anchor
  - One Euro Filter per landmark per axis (Casiez 2012) — adaptive low-pass
  - Visibility-weighted per-bone slerp gain — occluded limbs relax to rest
  - URL toggles: ?mirror= ?yflip= ?zflip= ?cnn=0/1/2 ?csi=ws://...

Live CSI integration:
  - Bridge parses adaptive_ctrl tick lines (motion/presence/rssi/yield)
  - Browser fans single ESP32 reading across 4 UI nodes with phase-shifted
    wobble (0.88–1.00 × sin(t·0.55 + offsetᵢ))
  - EMA α=0.06 (~3 sec time constant), HUD update throttled 3 Hz

Co-Authored-By: claude-flow <ruv@ruv.net>
@SergioAvRan

Copy link
Copy Markdown

It's has to be the cold on the floor light to be excitable to be at the end

@SergioAvRan

Copy link
Copy Markdown

Cold Need, to be looking for the executable mix to be real Development

…ssets + add README

Flatten the 13-file flat layout into purposeful subfolders so the demo
collection has a clean top-level entry point (README.md) and the file roles
are obvious from a directory listing.

Layout:
  demos/         01..05 — numbered for the progression (helpers → cinematic →
                          skinned → skinned-fbx → skinned-realtime)
  screenshots/   one PNG per demo, matching the demo's filename prefix
  server/        serve-demo.py + ruvultra-csi-bridge.py
  assets/        X Bot.fbx (gitignored, used by demos 04 and 05)

Touched files (beyond the renames):
- 04-skinned-fbx.html, 05-skinned-realtime.html: MODEL_URL now resolves
  '../assets/X%20Bot.fbx' instead of './X%20Bot.fbx'
- server/serve-demo.py: chdir() walks 3 levels up to repo root (was 2), and
  the URL banner now lists all 5 demos
- .gitignore: comment refresh — points at assets/ and screenshots/
- 05-skinned-realtime.html also picks up in-flight fps-tune work from this
  branch (Holistic script, SMOOTH_K URL param, slerp gain scaling) since
  those edits and the rename hit the same file

Verified end-to-end:
- python examples/three.js/server/serve-demo.py
- all 5 demos return 200, X Bot.fbx returns 200 from new asset/ path
- demos 04 + 05 render the X Bot mesh; 0 JS errors via browser eval
- screenshots reproduced match the originals

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet ruvnet changed the title feat(examples/three.js): cinematic skinned realtime pose demo + ESP32 CSI bridge feat(examples/three.js): cinematic skinned realtime pose demo + folder reorg May 16, 2026
@ruvnet ruvnet merged commit 27a6edb into main May 17, 2026
37 checks passed
@ruvnet ruvnet deleted the feat/three-skinned-realtime-pose-demo branch May 17, 2026 21:01
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.

2 participants