zeroed-some/dougk / 3d099f7

Browse files

reduce donny angle, re-attempt koi trajectories

Authored by espadonne
SHA
3d099f7eaf85298d154a9b861f21b69565245a4e
Parents
978c402
Tree
bbf6b4a

2 changed files

StatusFile+-
M src/renderers/three/koi.js 5 5
M src/renderers/three/narwhal.js 9 9
src/renderers/three/koi.jsmodified
@@ -222,8 +222,8 @@ export function createKoiSchool(scene, gradientMap, pondRadius) {
222222
       const dz = s.targetZ - koi.group.position.z
223223
       const dist = Math.hypot(dx, dz)
224224
 
225
-      // Always swim forward, turn gradually
226
-      const targetRot = Math.atan2(dx, dz)
225
+      // Calculate target rotation - koi model faces +X, so use atan2(dz, dx)
226
+      const targetRot = Math.atan2(dz, dx)
227227
 
228228
       // Very smooth rotation - fish don't turn sharply
229229
       let rotDiff = targetRot - koi.group.rotation.y
@@ -234,10 +234,10 @@ export function createKoiSchool(scene, gradientMap, pondRadius) {
234234
       const turnRate = s.panicMode ? 2.5 : 1.2
235235
       koi.group.rotation.y += rotDiff * turnRate * delta
236236
 
237
-      // Always moving forward (fish don't stop mid-water)
237
+      // Move in the direction koi is facing (model faces +X, so use cos/sin)
238238
       const moveSpeed = s.panicMode ? s.speed * 1.8 : s.speed * 0.5
239
-      const moveX = Math.sin(koi.group.rotation.y) * moveSpeed * delta
240
-      const moveZ = Math.cos(koi.group.rotation.y) * moveSpeed * delta
239
+      const moveX = Math.cos(koi.group.rotation.y) * moveSpeed * delta
240
+      const moveZ = Math.sin(koi.group.rotation.y) * moveSpeed * delta
241241
       koi.group.position.x += moveX
242242
       koi.group.position.z += moveZ
243243
 
src/renderers/three/narwhal.jsmodified
@@ -238,13 +238,13 @@ export function createDonny(scene, gradientMap) {
238238
         // Rise from the water
239239
         const emergeProgress = Math.min(state.timer / 1.5, 1)
240240
         const easeOut = 1 - Math.pow(1 - emergeProgress, 3)
241
-        group.position.y = -2 + easeOut * 2.5 // Rise higher out of water
241
+        group.position.y = -2 + easeOut * 2.25 // Rise higher out of water (10% less)
242242
 
243243
         // Slowly turn toward Doug - lugubrious, not laser tracking
244244
         group.rotation.y = lerpAngle(group.rotation.y, angleToDoug, delta * 0.5)
245245
 
246
-        // Tilt nose UP ~55 degrees - rotate around Z since model faces +X
247
-        group.rotation.z = 0.95 * easeOut
246
+        // Tilt nose UP ~50 degrees - rotate around Z since model faces +X (8% less)
247
+        group.rotation.z = 0.87 * easeOut
248248
 
249249
         // Gentle side-to-side rocking
250250
         group.rotation.x = Math.sin(state.timer * 4) * 0.06
@@ -257,14 +257,14 @@ export function createDonny(scene, gradientMap) {
257257
         break
258258
 
259259
       case 'surfaced':
260
-        // Bob gently, positioned higher
261
-        group.position.y = 0.5 + Math.sin(elapsed * 2) * 0.06
260
+        // Bob gently, positioned at adjusted height
261
+        group.position.y = 0.25 + Math.sin(elapsed * 2) * 0.06
262262
 
263263
         // Slowly turn toward Doug
264264
         group.rotation.y = lerpAngle(group.rotation.y, angleToDoug, delta * 0.3)
265265
 
266
-        // Keep steep tilt ~55 degrees - nose up, tail in water
267
-        group.rotation.z = 0.95 + Math.sin(elapsed * 1.5) * 0.04
266
+        // Keep tilt ~50 degrees - nose up, tail in water
267
+        group.rotation.z = 0.87 + Math.sin(elapsed * 1.5) * 0.04
268268
 
269269
         // Gentle side-to-side rocking
270270
         group.rotation.x = Math.sin(elapsed * 1.5) * 0.03
@@ -291,10 +291,10 @@ export function createDonny(scene, gradientMap) {
291291
         // Sink back down
292292
         const submergeProgress = Math.min(state.timer / 1.2, 1)
293293
         const easeIn = Math.pow(submergeProgress, 2)
294
-        group.position.y = 0.5 - easeIn * 2.7
294
+        group.position.y = 0.25 - easeIn * 2.5
295295
 
296296
         // Tilt nose down as diving back under
297
-        group.rotation.z = 0.95 - easeIn * 1.2
297
+        group.rotation.z = 0.87 - easeIn * 1.1
298298
 
299299
         // Add bubbles/ripples as submerging
300300
         if (Math.random() < delta * 4) {