diff options
Diffstat (limited to 'public/bluebey-studio/src/animation.js')
| -rw-r--r-- | public/bluebey-studio/src/animation.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/public/bluebey-studio/src/animation.js b/public/bluebey-studio/src/animation.js index 47f1cfb..3233e43 100644 --- a/public/bluebey-studio/src/animation.js +++ b/public/bluebey-studio/src/animation.js @@ -97,7 +97,9 @@ export class Animator { // wants. X (which the first version used) is the *lift*, so opposite signs // there just raised one flipper and dropped the other one. // `legsupport` pivots at the middle of the body, so the legs take a much - // smaller angle than the arms. + // smaller angle than the arms. The legs swing on the OPPOSITE phase to the + // arms, so when a hand comes forward it is the opposite foot that steps out + // (the same value as the arms put them in step, i.e. a "same-side" waddle). const phase = Math.sin(t * 2.4); const bob = Math.abs(Math.sin(t * 2.4)); add('master', -2, 0, phase * 4); @@ -105,8 +107,8 @@ export class Animator { add('arm.r', 6, 0, phase * 26); add('hand.l', 0, 0, phase * 10); add('hand.r', 0, 0, phase * 10); - add('legsupport.l', 0, 0, phase * 9); - add('legsupport.r', 0, 0, phase * 9); + add('legsupport.l', 0, 0, -phase * 9); + add('legsupport.r', 0, 0, -phase * 9); root[1] += bob * 0.05; return { bones, root }; } @@ -114,10 +116,13 @@ export class Animator { if (mode === 'wave') { // One flipper is held up and sweeps back and forth, with the hand lagging a // little behind it; the body and the other flipper rock along gently. The - // +84 X holds the arm up on its own, so the wave reads from a plain stance. + // lift is kept modest: raising the arm much further folds the flipper over + // the top of the head, where its inner edge cuts into the face, so the X + // here (and its swing) stop well short of that. The Z swing is what reads + // as the wave, and it is biased slightly *back* for the same reason. const wave = Math.sin(t * 3.2); - add('arm.l', 84 + wave * 14, 0, wave * 12); - add('hand.l', 0, 0, Math.sin(t * 3.2 + 0.6) * 22); + add('arm.l', 66 + wave * 8, 0, 6 + wave * 10); + add('hand.l', 0, 0, Math.sin(t * 3.2 + 0.6) * 14); add('arm.r', 0, 0, Math.sin(t * 1.6 + 1) * 4); add('master', Math.sin(t * 1.6) * 1.2, 0, Math.sin(t * 1.6 + 0.4) * 3); return { bones, root }; |
