zen: calmer UB — live speed control (default 0.7×) + a touch bigger (scale 1.2)
Swim1_norm read a bit restless; add a tunable playback speed (default 0.7× for a calm glide, ×0.7 again under reduced-motion) wired into the render tuner, and bump the default scale to 1.2 for more presence. Both live-adjustable at /zen?debug=1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,8 @@ const MODEL_URL = '/models/ub-angelfish.glb';
|
|||||||
export const DEFAULTS = {
|
export const DEFAULTS = {
|
||||||
yaw: Math.PI / 2, // ub.rotation.y — side-on-ish (tune live; head faces ±Z)
|
yaw: Math.PI / 2, // ub.rotation.y — side-on-ish (tune live; head faces ±Z)
|
||||||
pitch: 0, // ub.rotation.x — nose up/down
|
pitch: 0, // ub.rotation.x — nose up/down
|
||||||
scale: 1, // multiplier on the auto-fit size
|
scale: 1.2, // multiplier on the auto-fit size (a touch bigger = more presence)
|
||||||
|
speed: 0.7, // swim playback rate — <1 = calmer glide
|
||||||
finTranslucent: false, // false = opaque alpha-tested (coherent); true = blended
|
finTranslucent: false, // false = opaque alpha-tested (coherent); true = blended
|
||||||
finSide: 'double', // front | back | double (fins are thin → double reads fuller)
|
finSide: 'double', // front | back | double (fins are thin → double reads fuller)
|
||||||
finOpacity: 0.9, // only when translucent
|
finOpacity: 0.9, // only when translucent
|
||||||
@@ -124,7 +125,8 @@ export async function createAquarium(canvas, initial = {}) {
|
|||||||
const baseClip = mixer.clipAction(gltf.animations[0]); // the trimmed swim loop
|
const baseClip = mixer.clipAction(gltf.animations[0]); // the trimmed swim loop
|
||||||
baseClip.play();
|
baseClip.play();
|
||||||
const baseDuration = baseClip.getClip().duration || 1;
|
const baseDuration = baseClip.getClip().duration || 1;
|
||||||
mixer.timeScale = reduced ? 0.6 : 1; // calmer when reduced-motion
|
const applySpeed = () => { mixer.timeScale = (params.speed ?? 0.7) * (reduced ? 0.7 : 1); };
|
||||||
|
applySpeed(); // calm glide by default; extra-calm under reduced-motion
|
||||||
|
|
||||||
resize();
|
resize();
|
||||||
// The canvas lives in a responsive container; a ResizeObserver catches layout
|
// The canvas lives in a responsive container; a ResizeObserver catches layout
|
||||||
@@ -153,6 +155,7 @@ export async function createAquarium(canvas, initial = {}) {
|
|||||||
Object.assign(params, next);
|
Object.assign(params, next);
|
||||||
applyMaterials();
|
applyMaterials();
|
||||||
applyTransform();
|
applyTransform();
|
||||||
|
applySpeed();
|
||||||
return { ...params };
|
return { ...params };
|
||||||
},
|
},
|
||||||
getParams() { return { ...params }; },
|
getParams() { return { ...params }; },
|
||||||
|
|||||||
@@ -95,6 +95,8 @@
|
|||||||
<input type="range" min="-0.6" max="0.6" step="0.01" bind:value={dbg.pitch} oninput={apply} /></label>
|
<input type="range" min="-0.6" max="0.6" step="0.01" bind:value={dbg.pitch} oninput={apply} /></label>
|
||||||
<label>scale <span>{dbg.scale.toFixed(2)}</span>
|
<label>scale <span>{dbg.scale.toFixed(2)}</span>
|
||||||
<input type="range" min="0.3" max="2.5" step="0.05" bind:value={dbg.scale} oninput={apply} /></label>
|
<input type="range" min="0.3" max="2.5" step="0.05" bind:value={dbg.scale} oninput={apply} /></label>
|
||||||
|
<label>speed <span>{dbg.speed.toFixed(2)}</span>
|
||||||
|
<input type="range" min="0.2" max="1.5" step="0.05" bind:value={dbg.speed} oninput={apply} /></label>
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
<div class="ph">Fins & tail</div>
|
<div class="ph">Fins & tail</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user