zen: UB base loop → Swim1_norm (gentle in-place swim, not the static Idle)

Idle is a resting pose (only eye/mouth/fin micro-motion). Swapped the base loop to
Swim1_norm — a ~2.5s swim cycle with ZERO root drift (verified via trim-clip.mjs), so
UB undulates continuously without traveling off-screen. Generalized the trimmer
(tools/glb-split/trim-clip.mjs: extract any [start,end] range, rebased to 0, + drift report).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
jay
2026-07-01 19:21:55 -04:00
parent ce69b8cd18
commit a47897e7b1
3 changed files with 59 additions and 2 deletions
+3 -2
View File
@@ -19,7 +19,8 @@ import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
const MODEL_URL = '/models/ub-angelfish.glb';
// UB is now a marine angelfish (Queen): ONE mesh, TWO materials (…_body, …_fins — fins
// covers the caudal tail too), and a single trimmed Idle loop. Body renders OPAQUE +
// covers the caudal tail too), and a single trimmed loop (Swim1_norm — a ~2.5s in-place
// swim cycle, zero root drift, so it undulates without traveling). Body renders OPAQUE +
// single-sided; fins default to OPAQUE alpha-tested (clean silhouette, no blend bleed —
// the koi's lesson) but can go translucent. All live-tunable at /zen?debug=1.
export const DEFAULTS = {
@@ -120,7 +121,7 @@ export async function createAquarium(canvas, initial = {}) {
const mixer = new THREE.AnimationMixer(ub);
const actions = {};
for (const clip of gltf.animations) actions[clip.name] = mixer.clipAction(clip);
const baseClip = mixer.clipAction(gltf.animations[0]); // the trimmed Idle loop
const baseClip = mixer.clipAction(gltf.animations[0]); // the trimmed swim loop
baseClip.play();
const baseDuration = baseClip.getClip().duration || 1;
mixer.timeScale = reduced ? 0.6 : 1; // calmer when reduced-motion
Binary file not shown.