From a9f37e5138873f865c298e9a7c85f0a1ced3e38e Mon Sep 17 00:00:00 2001 From: ruv Date: Sat, 16 May 2026 08:56:38 -0400 Subject: [PATCH] refactor(examples/three.js): organize into demos/screenshots/server/assets + add README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- examples/three.js/.gitignore | 6 +- examples/three.js/README.md | 77 ++++ .../01-helpers.html} | 0 .../02-cinematic.html} | 0 .../03-skinned.html} | 0 .../04-skinned-fbx.html} | 2 +- .../05-skinned-realtime.html} | 400 ++++++++++++++++-- .../01-helpers.png} | Bin .../02-cinematic.png} | Bin .../03-skinned.png} | Bin .../04-skinned-fbx.png} | Bin .../05-skinned-realtime.png} | Bin .../{ => server}/ruvultra-csi-bridge.py | 0 examples/three.js/{ => server}/serve-demo.py | 22 +- 14 files changed, 462 insertions(+), 45 deletions(-) create mode 100644 examples/three.js/README.md rename examples/three.js/{helpers-demo.html => demos/01-helpers.html} (100%) rename examples/three.js/{helpers-cinematic.html => demos/02-cinematic.html} (100%) rename examples/three.js/{helpers-skinned.html => demos/03-skinned.html} (100%) rename examples/three.js/{helpers-skinned-fbx.html => demos/04-skinned-fbx.html} (99%) rename examples/three.js/{helpers-skinned-realtime.html => demos/05-skinned-realtime.html} (82%) rename examples/three.js/{helpers-demo-screenshot.png => screenshots/01-helpers.png} (100%) rename examples/three.js/{helpers-cinematic-screenshot.png => screenshots/02-cinematic.png} (100%) rename examples/three.js/{helpers-skinned-screenshot.png => screenshots/03-skinned.png} (100%) rename examples/three.js/{helpers-skinned-fbx-screenshot.png => screenshots/04-skinned-fbx.png} (100%) rename examples/three.js/{helpers-skinned-realtime-screenshot.png => screenshots/05-skinned-realtime.png} (100%) rename examples/three.js/{ => server}/ruvultra-csi-bridge.py (100%) rename examples/three.js/{ => server}/serve-demo.py (69%) diff --git a/examples/three.js/.gitignore b/examples/three.js/.gitignore index 4436a8d0..b59f7f6a 100644 --- a/examples/three.js/.gitignore +++ b/examples/three.js/.gitignore @@ -1,8 +1,10 @@ # Mixamo FBX downloads — too large + license boundary. Get your own from -# mixamo.com (FBX Binary + T-Pose / Without Skin), drop alongside the HTML. +# mixamo.com (FBX Binary + T-Pose / Without Skin), drop into assets/. *.fbx -# Diagnostic / debug screenshots from session +# Diagnostic / debug screenshots from a dev session. Official screenshots +# live in screenshots/ and are committed; these underscore-prefixed ones +# are scratch. _diag-*.png _demo-mode-shot*.png _PROOF-*.png diff --git a/examples/three.js/README.md b/examples/three.js/README.md new file mode 100644 index 00000000..893d51da --- /dev/null +++ b/examples/three.js/README.md @@ -0,0 +1,77 @@ +# three.js demos + +Five progressively richer browser demos of the ADR-097 sensing-helpers scene, +ending with a live MediaPipe-Pose → Mixamo X Bot retargeting pipeline driven +by a real ESP32 CSI feed. + +## Run them + +```bash +python examples/three.js/server/serve-demo.py +# then open one of the URLs the script prints +``` + +`server/serve-demo.py` is a tiny `ThreadingHTTPServer` with aggressive +no-cache headers — the stdlib `http.server` is single-threaded and times out +on the parallel script + FBX fetches the demos make. + +## Demos + +| # | File | What it shows | +|---|------|---------------| +| 01 | [`demos/01-helpers.html`](demos/01-helpers.html) | Plain ADR-097 helpers in the point-cloud viewer | +| 02 | [`demos/02-cinematic.html`](demos/02-cinematic.html) | Cinematic camera + pseudo-CSI visualization on top of #01 | +| 03 | [`demos/03-skinned.html`](demos/03-skinned.html) | GLTF skinned mesh + additive animation blending | +| 04 | [`demos/04-skinned-fbx.html`](demos/04-skinned-fbx.html) | Mixamo X Bot loaded from FBX in the ADR-097 scene | +| 05 | [`demos/05-skinned-realtime.html`](demos/05-skinned-realtime.html) | Webcam → MediaPipe Pose Heavy → Mixamo IK retarget, live ESP32 CSI overlay | + +| Screenshot | | +|---|---| +| ![01](screenshots/01-helpers.png) | ![02](screenshots/02-cinematic.png) | +| ![03](screenshots/03-skinned.png) | ![04](screenshots/04-skinned-fbx.png) | +| ![05](screenshots/05-skinned-realtime.png) | | + +## Layout + +``` +examples/three.js/ +├── README.md +├── .gitignore +├── demos/ # 5 self-contained HTML demos +│ ├── 01-helpers.html +│ ├── 02-cinematic.html +│ ├── 03-skinned.html +│ ├── 04-skinned-fbx.html +│ └── 05-skinned-realtime.html +├── screenshots/ # one PNG per demo +│ └── 0N-*.png +├── server/ +│ ├── serve-demo.py # local HTTP server with no-cache headers +│ └── ruvultra-csi-bridge.py # ESP32 CSI WebSocket bridge (ruvultra:8766) +└── assets/ + └── X Bot.fbx # gitignored — get your own from mixamo.com + # (FBX Binary, T-Pose, Without Skin) + # used by demos 04 and 05 +``` + +## Mixamo X Bot + +Demos 04 and 05 expect `assets/X Bot.fbx`. It's gitignored (size + license +boundary). Download yours from [mixamo.com](https://mixamo.com): pick the +"X Bot" character, export as **FBX Binary**, **T-Pose**, **Without Skin**, +and drop it into `assets/`. + +## Live ESP32 CSI overlay (demo 05 only) + +`server/ruvultra-csi-bridge.py` is the systemd-deployable bridge that runs on +the `ruvultra` host (over Tailscale). It listens for ESP32-S3 CSI on UDP and +re-broadcasts it as WebSocket frames at `ws://ruvultra:8766/csi`. Demo 05 +auto-connects; if the socket is down, it falls back to the bundled idle clip +plus a synthetic CSI driver. + +## Open issues + +- [#583](https://github.com/ruvnet/RuView/issues/583) — head/face tracking + fidelity in `05-skinned-realtime.html`. Recommended fix: swap MediaPipe + Pose Heavy for MediaPipe Holistic (same API, adds 468-point face mesh + + hand landmarks for proper PnP head pose and finger curl tracking). diff --git a/examples/three.js/helpers-demo.html b/examples/three.js/demos/01-helpers.html similarity index 100% rename from examples/three.js/helpers-demo.html rename to examples/three.js/demos/01-helpers.html diff --git a/examples/three.js/helpers-cinematic.html b/examples/three.js/demos/02-cinematic.html similarity index 100% rename from examples/three.js/helpers-cinematic.html rename to examples/three.js/demos/02-cinematic.html diff --git a/examples/three.js/helpers-skinned.html b/examples/three.js/demos/03-skinned.html similarity index 100% rename from examples/three.js/helpers-skinned.html rename to examples/three.js/demos/03-skinned.html diff --git a/examples/three.js/helpers-skinned-fbx.html b/examples/three.js/demos/04-skinned-fbx.html similarity index 99% rename from examples/three.js/helpers-skinned-fbx.html rename to examples/three.js/demos/04-skinned-fbx.html index b63ead0a..8353c015 100644 --- a/examples/three.js/helpers-skinned-fbx.html +++ b/examples/three.js/demos/04-skinned-fbx.html @@ -223,7 +223,7 @@ // rig-only. // ===================================================================== - const MODEL_URL = './X%20Bot.fbx'; + const MODEL_URL = '../assets/X%20Bot.fbx'; const NODE_POSITIONS = [ [-1.9, 1.3, 1.9],[ 1.9, 1.3, 1.9], diff --git a/examples/three.js/helpers-skinned-realtime.html b/examples/three.js/demos/05-skinned-realtime.html similarity index 82% rename from examples/three.js/helpers-skinned-realtime.html rename to examples/three.js/demos/05-skinned-realtime.html index 641a16ae..a366096b 100644 --- a/examples/three.js/helpers-skinned-realtime.html +++ b/examples/three.js/demos/05-skinned-realtime.html @@ -6,7 +6,7 @@ - + RuView · Skinned Realtime · MediaPipe Pose → Mixamo IK retargeting