Skip to content

Turn one illustration into an animated 2D mesh avatar with a coding agent and a local editor

Use independent mesh avatar terminology and parameter names

shinshin86f4722bb6a893
diff --git a/reference/engine/createMeshAvatar.js b/reference/engine/createMeshAvatar.js
index adf34f9..133199f 100644
--- a/reference/engine/createMeshAvatar.js
+++ b/reference/engine/createMeshAvatar.js
@@ -1,5 +1,5 @@
// Mesh avatar engine: turns a pre-split single illustration (see public/avatar/miko-qipao/) into a
-// Live2D-like animated avatar on a WebGL2 canvas. No UI and no framework: the app drives it
+// 2D mesh avatar animated on a WebGL2 canvas. No UI and no framework: the app drives it
// through the small API returned by createMeshAvatar().
import { IMG, EYES, setEyes, baseWeights, deformBase, eyePartY, eyePartAlpha, handWeights, handFrame, deformHand, TASSELS } from './rig.js';
import { Renderer, buildGrid } from './renderer.js';
@@ -129,8 +129,8 @@ export async function createMeshAvatar(canvas, options = {}) {
// cut-out lash leaves seams at its edges
const eyeOpenFor = v => (sprites ? 1 : v);
for (const ep of eyeParts) {
- const open = eyeOpenFor(ep.eye === 0 ? P.ParamEyeROpen : P.ParamEyeLOpen);
- const smile = ep.eye === 0 ? P.ParamEyeSmile : (P.eyeSmileL ?? P.ParamEyeSmile);
+ const open = eyeOpenFor(ep.eye === 0 ? P.eyeROpen : P.eyeLOpen);
+ const smile = ep.eye === 0 ? P.eyeSmile : (P.eyeSmileL ?? P.eyeSmile);
ep.layer.alpha = eyePartAlpha(ep.part, open, smile);
const r = ep.mesh.rest, o = ep.mesh.pos;
for (let k = 0; k < ep.W.length; k++) {
@@ -151,11 +151,11 @@ export async function createMeshAvatar(canvas, options = {}) {
const ball = 7; // px of iris travel
R.draw({
eyes: [
- eyeOpenFor(P.ParamEyeROpen), P.ParamEyeSmile, P.ParamEyeBallX * ball, -P.ParamEyeBallY * ball * 0.6,
- eyeOpenFor(P.ParamEyeLOpen), P.eyeSmileL ?? P.ParamEyeSmile, P.ParamEyeBallX * ball * 0.85, -P.ParamEyeBallY * ball * 0.6,
+ eyeOpenFor(P.eyeROpen), P.eyeSmile, P.gazeX * ball, -P.gazeY * ball * 0.6,
+ eyeOpenFor(P.eyeLOpen), P.eyeSmileL ?? P.eyeSmile, P.gazeX * ball * 0.85, -P.gazeY * ball * 0.6,
],
// with sprites the drawn mouths replace the shader-painted one
- mouthOpen: sprites ? 0 : P.ParamMouthOpenY, mouthForm: P.ParamMouthForm, cheek: P.ParamCheek,
+ mouthOpen: sprites ? 0 : P.mouthOpen, mouthForm: P.mouthForm, cheek: P.blush,
showMesh: false, originalAlpha: 0, joints: [],
});
}
diff --git a/reference/engine/motion.js b/reference/engine/motion.js
index bcf5fe4..44ca26b 100644
--- a/reference/engine/motion.js
+++ b/reference/engine/motion.js
@@ -7,11 +7,11 @@ const ALL_MOTIONS = { ...MOTIONS, ...IDLE_MOTIONS };
// scales the head / body / arm tracks of idle motions (they are authored at full size, so 1)
// (gaze, eyes and brows are left alone)
export const IDLE_GAIN = { amp: 1, stiff: 1.8 };
-const IDLE_SCALED = /^Param(Angle|BodyAngle|ArmAngle|HandAngle)/;
+const IDLE_SCALED = /^(angle|bodyAngle|armAngle|handAngle)/;
// motion tracks that replace the expression (the rest are additive or body targets)
-const FACE_TRACKS = new Set(['eyeOpen', 'eyeOpenL', 'eyeSmileL', 'ParamEyeSmile', 'ParamMouthOpenY',
- 'ParamMouthForm', 'ParamCheek', 'ParamBrowY', 'ParamBrowAngle']);
+const FACE_TRACKS = new Set(['eyeOpen', 'eyeOpenL', 'eyeSmileL', 'eyeSmile', 'mouthOpen',
+ 'mouthForm', 'blush', 'browY', 'browAngle']);
const sstep = (a, b, x) => { const t = Math.min(1, Math.max(0, (x - a) / (b - a))); return t * t * (3 - 2 * t); };
// smooth 1D value noise
@@ -26,18 +26,18 @@ const clamp = (v, a, b) => Math.max(a, Math.min(b, v));
export const EXPRESSIONS = {
normal: { label: 'ふつう', p: {} },
- smile: { label: 'にっこり', p: { eyeOpen: 0, ParamEyeSmile: 1, ParamCheek: 0.35, ParamBrowY: 0.2 } },
- shy: { label: '照れ', p: { eyeOpen: 0.78, ParamEyeSmile: 0.5, ParamCheek: 1, ParamBrowAngle: -0.5, ParamBrowY: -0.1, glance: [0.7, 0.35] } },
- jito: { label: 'ジト目', p: { eyeOpen: 0.5, ParamBrowY: -0.5, ParamBrowAngle: 0.6 } },
- surprise: { label: 'びっくり', p: { eyeOpen: 1.22, ParamBrowY: 1, ParamMouthOpenY: 0.6, ParamMouthForm: 0.6 } },
- wink: { label: 'ウインク', p: { eyeOpenL: 0, eyeSmileL: 1, ParamCheek: 0.3 } },
+ smile: { label: 'にっこり', p: { eyeOpen: 0, eyeSmile: 1, blush: 0.35, browY: 0.2 } },
+ shy: { label: '照れ', p: { eyeOpen: 0.78, eyeSmile: 0.5, blush: 1, browAngle: -0.5, browY: -0.1, glance: [0.7, 0.35] } },
+ jito: { label: 'ジト目', p: { eyeOpen: 0.5, browY: -0.5, browAngle: 0.6 } },
+ surprise: { label: 'びっくり', p: { eyeOpen: 1.22, browY: 1, mouthOpen: 0.6, mouthForm: 0.6 } },
+ wink: { label: 'ウインク', p: { eyeOpenL: 0, eyeSmileL: 1, blush: 0.3 } },
// talking faces for AITuber OnAir emotion tags: eyes stay mostly open (closed / ^^ eyes are
// what a single image fakes worst, and they would stay shut for a whole sentence)
- happyTalk: { label: 'happy', p: { eyeOpen: 0.8, ParamEyeSmile: 0.45, ParamCheek: 0.35, ParamBrowY: 0.25, ParamMouthForm: -0.5 } },
- sadTalk: { label: 'sad', p: { eyeOpen: 0.78, ParamBrowAngle: -0.8, ParamBrowY: -0.2, ParamMouthForm: 0.3, glance: [0, -0.35] } },
- angryTalk: { label: 'angry', p: { eyeOpen: 0.72, ParamBrowAngle: 0.85, ParamBrowY: -0.55, ParamMouthForm: 0.2 } },
- surprisedTalk: { label: 'surprised', p: { eyeOpen: 1.18, ParamBrowY: 0.9, ParamMouthForm: 0.9 } },
- relaxedTalk: { label: 'relaxed', p: { eyeOpen: 0.82, ParamEyeSmile: 0.35, ParamCheek: 0.15, ParamBrowY: 0.1 } },
+ happyTalk: { label: 'happy', p: { eyeOpen: 0.8, eyeSmile: 0.45, blush: 0.35, browY: 0.25, mouthForm: -0.5 } },
+ sadTalk: { label: 'sad', p: { eyeOpen: 0.78, browAngle: -0.8, browY: -0.2, mouthForm: 0.3, glance: [0, -0.35] } },
+ angryTalk: { label: 'angry', p: { eyeOpen: 0.72, browAngle: 0.85, browY: -0.55, mouthForm: 0.2 } },
+ surprisedTalk: { label: 'surprised', p: { eyeOpen: 1.18, browY: 0.9, mouthForm: 0.9 } },
+ relaxedTalk: { label: 'relaxed', p: { eyeOpen: 0.82, eyeSmile: 0.35, blush: 0.15, browY: 0.1 } },
};
// emotion tag -> [expression, motion played when the line starts]
@@ -52,10 +52,10 @@ const EMOTIONS = {
// [stiffness, damping ratio] of the parameter smoothing; unlisted params use [120, 0.95]
const SPRINGS = {
- ParamEyeBallX: [260, 0.9], ParamEyeBallY: [260, 0.9],
- ParamAngleX: [55, 0.72], ParamAngleY: [55, 0.72], ParamAngleZ: [45, 0.75],
- ParamBodyAngleX: [14, 0.9], ParamBodyAngleZ: [12, 0.9],
- ParamArmAngle: [20, 0.85], ParamHandAngle: [30, 0.8],
+ gazeX: [260, 0.9], gazeY: [260, 0.9],
+ angleX: [55, 0.72], angleY: [55, 0.72], angleZ: [45, 0.75],
+ bodyAngleX: [14, 0.9], bodyAngleZ: [12, 0.9],
+ armAngle: [20, 0.85], handAngle: [30, 0.8],
};
export class Motion {
@@ -211,13 +211,13 @@ export class Motion {
Object.assign(T, this.manual);
} else if (this.mode === 'auto') {
// wandering plus following the gaze: the eyes jump first, the head turns after them
- T.ParamAngleX = fbm(t * 0.18, 1) * 10 + this.gaze.x * 11;
- T.ParamAngleY = fbm(t * 0.15, 2) * 6 - 1 + this.gaze.y * 7;
- T.ParamAngleZ = fbm(t * 0.12, 3) * 10;
- T.ParamBodyAngleX = fbm(t * 0.1, 4) * 5;
- T.ParamBodyAngleZ = fbm(t * 0.09, 5) * 4;
- T.ParamArmAngle = fbm(t * 0.14, 6) * 5;
- T.ParamHandAngle = fbm(t * 0.21, 7) * 5;
+ T.angleX = fbm(t * 0.18, 1) * 10 + this.gaze.x * 11;
+ T.angleY = fbm(t * 0.15, 2) * 6 - 1 + this.gaze.y * 7;
+ T.angleZ = fbm(t * 0.12, 3) * 10;
+ T.bodyAngleX = fbm(t * 0.1, 4) * 5;
+ T.bodyAngleZ = fbm(t * 0.09, 5) * 4;
+ T.armAngle = fbm(t * 0.14, 6) * 5;
+ T.handAngle = fbm(t * 0.21, 7) * 5;
// glances
if (t > this.gaze.next) {
const r = Math.random();
@@ -225,8 +225,8 @@ export class Motion {
this.gaze.y = r < 0.45 ? 0 : (Math.random() * 2 - 1) * 0.5;
this.gaze.next = t + 0.8 + Math.random() * 2.5;
}
- T.ParamEyeBallX = this.gaze.x + T.ParamAngleX / 60;
- T.ParamEyeBallY = this.gaze.y + T.ParamAngleY / 60;
+ T.gazeX = this.gaze.x + T.angleX / 60;
+ T.gazeY = this.gaze.y + T.angleY / 60;
// occasional finger tapping on the chin
if (t > this.tap.next) { this.tap.until = t + 1.1; this.tap.next = t + 5 + Math.random() * 6; }
// random playback: reactions every ~15-25 s, small idle motions every few seconds in between
@@ -236,9 +236,9 @@ export class Motion {
this.nextAuto = Math.max(this.nextAuto, t + 6);
const g = this.talkGain;
this.talkNod = (this.talkNod ?? 0) + (this.voice * 7 * g - (this.talkNod ?? 0)) * Math.min(1, dt * 6);
- T.ParamAngleY -= this.talkNod;
- T.ParamAngleX += fbm(t * 0.6, 11) * 5 * g;
- T.ParamAngleZ += fbm(t * 0.5, 12) * 4 * g;
+ T.angleY -= this.talkNod;
+ T.angleX += fbm(t * 0.6, 11) * 5 * g;
+ T.angleZ += fbm(t * 0.5, 12) * 4 * g;
}
if (!this.speaking && t > this.emotionUntil) { this.expr = 'normal'; this.emotionUntil = Infinity; }
if (this.speaking) { /* no random playback */ }
@@ -252,17 +252,17 @@ export class Motion {
}
} else if (this.mode === 'mouse' && this.pointer) {
const dx = (this.pointer[0] - this.faceCenter[0]) / 500, dy = (this.pointer[1] - this.faceCenter[1]) / 500;
- T.ParamAngleX = clamp(dx * 30, -30, 30);
- T.ParamAngleY = clamp(-dy * 30, -30, 30);
- T.ParamAngleZ = clamp(-dx * dy * 25, -12, 12);
- T.ParamBodyAngleX = clamp(dx * 10, -10, 10) * 0.6;
- T.ParamEyeBallX = clamp(dx * 1.4, -1, 1);
- T.ParamEyeBallY = clamp(-dy * 1.4, -1, 1);
- T.ParamHandAngle = clamp(dx * 4, -5, 5);
+ T.angleX = clamp(dx * 30, -30, 30);
+ T.angleY = clamp(-dy * 30, -30, 30);
+ T.angleZ = clamp(-dx * dy * 25, -12, 12);
+ T.bodyAngleX = clamp(dx * 10, -10, 10) * 0.6;
+ T.gazeX = clamp(dx * 1.4, -1, 1);
+ T.gazeY = clamp(-dy * 1.4, -1, 1);
+ T.handAngle = clamp(dx * 4, -5, 5);
}
if (this.mode !== 'manual') {
- T.ParamBreath = this.breathValue(dt);
- if (t < this.tap.until) T.ParamFingerTap = Math.max(0, Math.sin((this.tap.until - t) * Math.PI * 3.6)) ** 2;
+ T.breath = this.breathValue(dt);
+ if (t < this.tap.until) T.fingerTap = Math.max(0, Math.sin((this.tap.until - t) * Math.PI * 3.6)) ** 2;
}
// motion: body/head tracks go into the targets, so the springs smooth them too
@@ -278,20 +278,20 @@ export class Motion {
mw = sstep(0, 0.15, this.play.t) * (1 - sstep(def.dur - 0.25, def.dur, this.play.t));
for (const [id, v] of Object.entries(M)) {
if (ADDITIVE.has(id)) T[id] += v;
- else if (id === 'ParamBreath') T[id] += (v - T[id]) * mw; // a motion sets its own breathing
+ else if (id === 'breath') T[id] += (v - T[id]) * mw; // a motion sets its own breathing
else if (!FACE_TRACKS.has(id)) T[id] = Math.max(T[id], Math.max(0, v));
}
}
}
- if (this.mode !== 'manual') T.ParamAngleY += T.ParamBreath * 1.6;
+ if (this.mode !== 'manual') T.angleY += T.breath * 1.6;
// expression layer (smoothed so switching is not a jump)
const E = EXPRESSIONS[this.expr].p;
- const keys = ['eyeOpen', 'eyeOpenL', 'eyeSmileL', 'ParamEyeSmile', 'ParamMouthOpenY', 'ParamMouthForm', 'ParamCheek', 'ParamBrowY', 'ParamBrowAngle', 'gx', 'gy'];
- const target = { eyeOpen: E.eyeOpen ?? 1, eyeOpenL: E.eyeOpenL ?? E.eyeOpen ?? 1, eyeSmileL: E.eyeSmileL ?? E.ParamEyeSmile ?? 0,
- ParamEyeSmile: E.ParamEyeSmile ?? 0, ParamMouthOpenY: E.ParamMouthOpenY ?? 0, ParamMouthForm: E.ParamMouthForm ?? 0,
- ParamCheek: E.ParamCheek ?? 0, ParamBrowY: E.ParamBrowY ?? 0, ParamBrowAngle: E.ParamBrowAngle ?? 0,
+ const keys = ['eyeOpen', 'eyeOpenL', 'eyeSmileL', 'eyeSmile', 'mouthOpen', 'mouthForm', 'blush', 'browY', 'browAngle', 'gx', 'gy'];
+ const target = { eyeOpen: E.eyeOpen ?? 1, eyeOpenL: E.eyeOpenL ?? E.eyeOpen ?? 1, eyeSmileL: E.eyeSmileL ?? E.eyeSmile ?? 0,
+ eyeSmile: E.eyeSmile ?? 0, mouthOpen: E.mouthOpen ?? 0, mouthForm: E.mouthForm ?? 0,
+ blush: E.blush ?? 0, browY: E.browY ?? 0, browAngle: E.browAngle ?? 0,
gx: E.glance?.[0] ?? 0, gy: E.glance?.[1] ?? 0 };
const k = 1 - Math.exp(-dt * 9);
for (const key of keys) {
@@ -310,9 +310,9 @@ export class Motion {
// keyframed motions are already smooth; follow them more tightly than idle wandering
// keyframed motions are followed more tightly than the idle wandering; idle motions a
// bit less so they stay soft but still reach their poses
- if (M && /^ParamAngle|^ParamBody/.test(id)) {
+ if (M && /^angle|^body/.test(id)) {
if (ALL_MOTIONS[this.play?.id ?? '']?.idle) { stiff *= IDLE_GAIN.stiff; zeta = 0.8; }
- else if (/^ParamAngle/.test(id)) { stiff *= 4.5; zeta = 0.75; }
+ else if (/^angle/.test(id)) { stiff *= 4.5; zeta = 0.75; }
}
const damp = 2 * Math.sqrt(stiff) * zeta;
this.vel[id] += (stiff * (T[id] - this.cur[id]) - damp * this.vel[id]) * dt;
@@ -322,38 +322,38 @@ export class Motion {
let blink = 1;
if (this.mode !== 'manual') {
blink = this.blinkValue(dt);
- out.ParamEyeROpen = X.eyeOpen * blink;
- out.ParamEyeLOpen = X.eyeOpenL * blink;
- out.ParamEyeSmile = X.ParamEyeSmile;
+ out.eyeROpen = X.eyeOpen * blink;
+ out.eyeLOpen = X.eyeOpenL * blink;
+ out.eyeSmile = X.eyeSmile;
out.eyeSmileL = X.eyeSmileL;
- out.ParamMouthOpenY = X.ParamMouthOpenY;
- out.ParamMouthForm = X.ParamMouthForm;
- out.ParamCheek = X.ParamCheek;
+ out.mouthOpen = X.mouthOpen;
+ out.mouthForm = X.mouthForm;
+ out.blush = X.blush;
// brows dip a little with each blink and lift when looking up
- out.ParamBrowY = X.ParamBrowY + (out.ParamAngleY > 0 ? out.ParamAngleY / 60 : 0) - (1 - blink) * 0.18;
- out.ParamBrowAngle = X.ParamBrowAngle;
- out.ParamEyeBallX = clamp(out.ParamEyeBallX + X.gx, -1, 1);
- out.ParamEyeBallY = clamp(out.ParamEyeBallY + X.gy, -1, 1);
+ out.browY = X.browY + (out.angleY > 0 ? out.angleY / 60 : 0) - (1 - blink) * 0.18;
+ out.browAngle = X.browAngle;
+ out.gazeX = clamp(out.gazeX + X.gx, -1, 1);
+ out.gazeY = clamp(out.gazeY + X.gy, -1, 1);
} else {
- out.eyeSmileL = out.ParamEyeSmile;
+ out.eyeSmileL = out.eyeSmile;
}
if (M) {
const mix = (key, v) => { out[key] += (v - out[key]) * mw; };
const clampEye = v => Math.min(1.3, Math.max(0, v));
- if ('eyeOpen' in M) { mix('ParamEyeROpen', clampEye(M.eyeOpen) * blink); if (!('eyeOpenL' in M)) mix('ParamEyeLOpen', clampEye(M.eyeOpen) * blink); }
- if ('eyeOpenL' in M) mix('ParamEyeLOpen', clampEye(M.eyeOpenL) * blink);
- if ('ParamEyeSmile' in M) { mix('ParamEyeSmile', M.ParamEyeSmile); if (!('eyeSmileL' in M)) mix('eyeSmileL', M.ParamEyeSmile); }
+ if ('eyeOpen' in M) { mix('eyeROpen', clampEye(M.eyeOpen) * blink); if (!('eyeOpenL' in M)) mix('eyeLOpen', clampEye(M.eyeOpen) * blink); }
+ if ('eyeOpenL' in M) mix('eyeLOpen', clampEye(M.eyeOpenL) * blink);
+ if ('eyeSmile' in M) { mix('eyeSmile', M.eyeSmile); if (!('eyeSmileL' in M)) mix('eyeSmileL', M.eyeSmile); }
if ('eyeSmileL' in M) mix('eyeSmileL', M.eyeSmileL);
- for (const id of ['ParamMouthOpenY', 'ParamMouthForm', 'ParamCheek', 'ParamBrowY', 'ParamBrowAngle'])
- if (id in M) mix(id, id === 'ParamMouthOpenY' || id === 'ParamCheek' ? Math.max(0, M[id]) : M[id]);
+ for (const id of ['mouthOpen', 'mouthForm', 'blush', 'browY', 'browAngle'])
+ if (id in M) mix(id, id === 'mouthOpen' || id === 'blush' ? Math.max(0, M[id]) : M[id]);
}
const sm = this.speechMouth(dt);
if (sm) { this.lipOpen = sm[0]; this.lipForm = sm[1]; }
else if (this.lipOpen !== null && !this.speaking && !this.kana) this.lipOpen = null;
if (this.lipOpen !== null) {
- out.ParamMouthOpenY = Math.max(out.ParamMouthOpenY * 0.3, this.lipOpen);
+ out.mouthOpen = Math.max(out.mouthOpen * 0.3, this.lipOpen);
// while talking the voice decides the vowel; the expression's form would shift it
- out.ParamMouthForm = clamp(this.lipForm, -1, 1);
+ out.mouthForm = clamp(this.lipForm, -1, 1);
}
this.P = out;
return out;
diff --git a/reference/engine/motions.js b/reference/engine/motions.js
index d220b47..b9ab772 100644
--- a/reference/engine/motions.js
+++ b/reference/engine/motions.js
@@ -4,340 +4,340 @@
// The result still goes through the parameter springs, which adds follow-through.
export const ADDITIVE = new Set([
- 'ParamAngleX', 'ParamAngleY', 'ParamAngleZ', 'ParamBodyAngleX', 'ParamBodyAngleZ',
- 'ParamArmAngle', 'ParamHandAngle', 'ParamEyeBallX', 'ParamEyeBallY',
+ 'angleX', 'angleY', 'angleZ', 'bodyAngleX', 'bodyAngleZ',
+ 'armAngle', 'handAngle', 'gazeX', 'gazeY',
]);
export const MOTIONS = {
nod: {
label: 'うなずき', dur: 1.7,
tracks: {
- ParamAngleY: [[0, 0], [0.32, -13], [0.62, 2], [0.95, -9], [1.3, 1], [1.7, 0]],
- ParamAngleZ: [[0, 0], [0.4, -2], [1.0, -1], [1.7, 0]],
- ParamBodyAngleX: [[0, 0], [0.5, -1.5], [1.7, 0]],
- ParamEyeSmile: [[0, 0], [0.3, 0.45], [1.3, 0.45], [1.7, 0]],
+ angleY: [[0, 0], [0.32, -13], [0.62, 2], [0.95, -9], [1.3, 1], [1.7, 0]],
+ angleZ: [[0, 0], [0.4, -2], [1.0, -1], [1.7, 0]],
+ bodyAngleX: [[0, 0], [0.5, -1.5], [1.7, 0]],
+ eyeSmile: [[0, 0], [0.3, 0.45], [1.3, 0.45], [1.7, 0]],
eyeOpen: [[0, 1], [0.3, 0.72], [1.3, 0.72], [1.7, 1]],
- ParamMouthOpenY: [[0, 0], [0.3, 0.12], [1.3, 0.12], [1.7, 0]],
- ParamMouthForm: [[0, 0], [0.3, -0.6], [1.7, -0.3]],
+ mouthOpen: [[0, 0], [0.3, 0.12], [1.3, 0.12], [1.7, 0]],
+ mouthForm: [[0, 0], [0.3, -0.6], [1.7, -0.3]],
},
},
tilt: {
label: '首かしげ', dur: 2.6,
tracks: {
- ParamAngleZ: [[0, 0], [0.55, 17], [2.0, 15], [2.6, 0]],
- ParamAngleX: [[0, 0], [0.6, 8], [2.0, 7], [2.6, 0]],
- ParamAngleY: [[0, 0], [0.6, 4], [2.6, 0]],
- ParamBodyAngleZ: [[0, 0], [0.8, 3], [2.0, 3], [2.6, 0]],
- ParamEyeBallX: [[0, 0], [0.4, 0.5], [2.1, 0.4], [2.6, 0]],
- ParamEyeBallY: [[0, 0], [0.4, 0.35], [2.1, 0.3], [2.6, 0]],
- ParamBrowAngle: [[0, 0], [0.5, -0.7], [2.1, -0.6], [2.6, 0]],
- ParamBrowY: [[0, 0], [0.5, 0.35], [2.1, 0.3], [2.6, 0]],
+ angleZ: [[0, 0], [0.55, 17], [2.0, 15], [2.6, 0]],
+ angleX: [[0, 0], [0.6, 8], [2.0, 7], [2.6, 0]],
+ angleY: [[0, 0], [0.6, 4], [2.6, 0]],
+ bodyAngleZ: [[0, 0], [0.8, 3], [2.0, 3], [2.6, 0]],
+ gazeX: [[0, 0], [0.4, 0.5], [2.1, 0.4], [2.6, 0]],
+ gazeY: [[0, 0], [0.4, 0.35], [2.1, 0.3], [2.6, 0]],
+ browAngle: [[0, 0], [0.5, -0.7], [2.1, -0.6], [2.6, 0]],
+ browY: [[0, 0], [0.5, 0.35], [2.1, 0.3], [2.6, 0]],
// closed mouth: a barely open round mouth read as a squashed blob
},
},
think: {
label: '考えごと', dur: 3.6,
tracks: {
- ParamAngleX: [[0, 0], [0.7, -11], [3.0, -9], [3.6, 0]],
- ParamAngleY: [[0, 0], [0.7, 9], [3.0, 8], [3.6, 0]],
- ParamAngleZ: [[0, 0], [0.8, 6], [3.0, 5], [3.6, 0]],
- ParamEyeBallX: [[0, 0], [0.35, -0.8], [3.1, -0.7], [3.6, 0]],
- ParamEyeBallY: [[0, 0], [0.35, 0.7], [3.1, 0.6], [3.6, 0]],
- ParamHandAngle: [[0, 0], [0.6, 3], [3.0, 3], [3.6, 0]],
- ParamFingerTap: [[0, 0], [0.9, 0], [1.05, 1], [1.2, 0], [1.4, 1], [1.55, 0], [1.75, 1], [1.9, 0],
+ angleX: [[0, 0], [0.7, -11], [3.0, -9], [3.6, 0]],
+ angleY: [[0, 0], [0.7, 9], [3.0, 8], [3.6, 0]],
+ angleZ: [[0, 0], [0.8, 6], [3.0, 5], [3.6, 0]],
+ gazeX: [[0, 0], [0.35, -0.8], [3.1, -0.7], [3.6, 0]],
+ gazeY: [[0, 0], [0.35, 0.7], [3.1, 0.6], [3.6, 0]],
+ handAngle: [[0, 0], [0.6, 3], [3.0, 3], [3.6, 0]],
+ fingerTap: [[0, 0], [0.9, 0], [1.05, 1], [1.2, 0], [1.4, 1], [1.55, 0], [1.75, 1], [1.9, 0],
[2.3, 0], [2.45, 1], [2.6, 0], [3.6, 0]],
- ParamBrowY: [[0, 0], [0.6, 0.25], [3.0, 0.2], [3.6, 0]],
- ParamBrowAngle: [[0, 0], [0.6, -0.3], [3.0, -0.3], [3.6, 0]],
- ParamMouthForm: [[0, 0], [0.6, 0.4], [3.6, 0]],
+ browY: [[0, 0], [0.6, 0.25], [3.0, 0.2], [3.6, 0]],
+ browAngle: [[0, 0], [0.6, -0.3], [3.0, -0.3], [3.6, 0]],
+ mouthForm: [[0, 0], [0.6, 0.4], [3.6, 0]],
},
},
giggle: {
label: 'くすっと笑う', dur: 2.2,
tracks: {
eyeOpen: [[0, 1], [0.2, 0], [1.8, 0], [2.2, 1]],
- ParamEyeSmile: [[0, 0], [0.2, 1], [1.8, 1], [2.2, 0]],
- ParamMouthOpenY: [[0, 0], [0.2, 0.5], [0.45, 0.32], [0.7, 0.55], [0.95, 0.34], [1.2, 0.5], [1.8, 0.3], [2.1, 0]],
- ParamMouthForm: [[0, 0], [0.2, -0.8], [2.2, -0.2]],
- ParamCheek: [[0, 0], [0.3, 0.7], [1.8, 0.7], [2.2, 0.1]],
- ParamAngleY: [[0, 0], [0.2, -5], [0.45, -1], [0.7, -6], [0.95, -2], [1.2, -5], [1.6, -2], [2.2, 0]],
- ParamAngleZ: [[0, 0], [0.3, -6], [1.8, -5], [2.2, 0]],
- ParamBodyAngleZ: [[0, 0], [0.25, 2], [0.5, -1], [0.75, 2], [1.0, -1], [1.3, 1.5], [2.2, 0]],
- ParamBrowY: [[0, 0], [0.3, 0.3], [1.8, 0.3], [2.2, 0]],
+ eyeSmile: [[0, 0], [0.2, 1], [1.8, 1], [2.2, 0]],
+ mouthOpen: [[0, 0], [0.2, 0.5], [0.45, 0.32], [0.7, 0.55], [0.95, 0.34], [1.2, 0.5], [1.8, 0.3], [2.1, 0]],
+ mouthForm: [[0, 0], [0.2, -0.8], [2.2, -0.2]],
+ blush: [[0, 0], [0.3, 0.7], [1.8, 0.7], [2.2, 0.1]],
+ angleY: [[0, 0], [0.2, -5], [0.45, -1], [0.7, -6], [0.95, -2], [1.2, -5], [1.6, -2], [2.2, 0]],
+ angleZ: [[0, 0], [0.3, -6], [1.8, -5], [2.2, 0]],
+ bodyAngleZ: [[0, 0], [0.25, 2], [0.5, -1], [0.75, 2], [1.0, -1], [1.3, 1.5], [2.2, 0]],
+ browY: [[0, 0], [0.3, 0.3], [1.8, 0.3], [2.2, 0]],
},
},
surprise: {
label: 'びっくり', dur: 2.0,
tracks: {
- ParamAngleY: [[0, 0], [0.12, 10], [0.5, 6], [1.5, 5], [2.0, 0]],
- ParamAngleX: [[0, 0], [0.12, -4], [2.0, 0]],
- ParamBodyAngleX: [[0, 0], [0.15, -4], [1.5, -3], [2.0, 0]],
+ angleY: [[0, 0], [0.12, 10], [0.5, 6], [1.5, 5], [2.0, 0]],
+ angleX: [[0, 0], [0.12, -4], [2.0, 0]],
+ bodyAngleX: [[0, 0], [0.15, -4], [1.5, -3], [2.0, 0]],
eyeOpen: [[0, 1], [0.1, 1.25], [1.5, 1.2], [2.0, 1]],
- ParamBrowY: [[0, 0], [0.1, 1], [1.5, 0.9], [2.0, 0]],
- ParamMouthOpenY: [[0, 0], [0.12, 0.6], [1.4, 0.45], [2.0, 0]],
- ParamMouthForm: [[0, 0], [0.12, 0.6], [1.5, 0.55], [2.0, 0]], // お
- ParamArmAngle: [[0, 0], [0.15, -4], [1.5, -3], [2.0, 0]],
+ browY: [[0, 0], [0.1, 1], [1.5, 0.9], [2.0, 0]],
+ mouthOpen: [[0, 0], [0.12, 0.6], [1.4, 0.45], [2.0, 0]],
+ mouthForm: [[0, 0], [0.12, 0.6], [1.5, 0.55], [2.0, 0]], // お
+ armAngle: [[0, 0], [0.15, -4], [1.5, -3], [2.0, 0]],
},
},
shy: {
label: '照れる', dur: 3.2,
tracks: {
- ParamAngleX: [[0, 0], [0.6, 14], [2.6, 12], [3.2, 0]],
- ParamAngleY: [[0, 0], [0.6, -9], [2.6, -8], [3.2, 0]],
- ParamAngleZ: [[0, 0], [0.7, -8], [2.6, -7], [3.2, 0]],
- ParamEyeBallX: [[0, 0], [0.3, 0.8], [1.6, 0.8], [1.9, -0.3], [2.2, 0.8], [2.8, 0.6], [3.2, 0]],
- ParamEyeBallY: [[0, 0], [0.3, -0.5], [2.8, -0.4], [3.2, 0]],
+ angleX: [[0, 0], [0.6, 14], [2.6, 12], [3.2, 0]],
+ angleY: [[0, 0], [0.6, -9], [2.6, -8], [3.2, 0]],
+ angleZ: [[0, 0], [0.7, -8], [2.6, -7], [3.2, 0]],
+ gazeX: [[0, 0], [0.3, 0.8], [1.6, 0.8], [1.9, -0.3], [2.2, 0.8], [2.8, 0.6], [3.2, 0]],
+ gazeY: [[0, 0], [0.3, -0.5], [2.8, -0.4], [3.2, 0]],
eyeOpen: [[0, 1], [0.5, 0.75], [2.7, 0.75], [3.2, 1]],
- ParamEyeSmile: [[0, 0], [0.5, 0.5], [2.7, 0.5], [3.2, 0]],
- ParamCheek: [[0, 0], [0.8, 1], [2.7, 1], [3.2, 0]],
- ParamBrowAngle: [[0, 0], [0.5, -0.6], [2.7, -0.5], [3.2, 0]],
- ParamMouthForm: [[0, 0], [0.5, -0.4], [3.2, 0]],
- ParamHandAngle: [[0, 0], [0.8, 4], [2.6, 4], [3.2, 0]],
+ eyeSmile: [[0, 0], [0.5, 0.5], [2.7, 0.5], [3.2, 0]],
+ blush: [[0, 0], [0.8, 1], [2.7, 1], [3.2, 0]],
+ browAngle: [[0, 0], [0.5, -0.6], [2.7, -0.5], [3.2, 0]],
+ mouthForm: [[0, 0], [0.5, -0.4], [3.2, 0]],
+ handAngle: [[0, 0], [0.8, 4], [2.6, 4], [3.2, 0]],
},
},
no: {
label: 'いやいや', dur: 1.9,
tracks: {
- ParamAngleX: [[0, 0], [0.2, 13], [0.45, -13], [0.7, 12], [0.95, -10], [1.2, 5], [1.5, 0]],
- ParamAngleY: [[0, 0], [0.2, -3], [1.3, -3], [1.9, 0]],
- ParamBodyAngleX: [[0, 0], [0.3, 1.5], [0.6, -1.5], [0.9, 1], [1.3, 0]],
+ angleX: [[0, 0], [0.2, 13], [0.45, -13], [0.7, 12], [0.95, -10], [1.2, 5], [1.5, 0]],
+ angleY: [[0, 0], [0.2, -3], [1.3, -3], [1.9, 0]],
+ bodyAngleX: [[0, 0], [0.3, 1.5], [0.6, -1.5], [0.9, 1], [1.3, 0]],
eyeOpen: [[0, 1], [0.15, 0], [1.4, 0], [1.9, 1]],
- ParamEyeSmile: [[0, 0], [0.15, 1], [1.4, 1], [1.9, 0]],
+ eyeSmile: [[0, 0], [0.15, 1], [1.4, 1], [1.9, 0]],
// closed mouth while shaking the head
- ParamBrowAngle: [[0, 0], [0.2, -0.5], [1.4, -0.5], [1.9, 0]],
+ browAngle: [[0, 0], [0.2, -0.5], [1.4, -0.5], [1.9, 0]],
},
},
wink: {
label: 'ウインク', dur: 2.0,
tracks: {
- ParamAngleZ: [[0, 0], [0.35, -13], [1.5, -12], [2.0, 0]],
- ParamAngleX: [[0, 0], [0.35, 9], [1.5, 8], [2.0, 0]],
- ParamBodyAngleZ: [[0, 0], [0.5, -2], [1.5, -2], [2.0, 0]],
+ angleZ: [[0, 0], [0.35, -13], [1.5, -12], [2.0, 0]],
+ angleX: [[0, 0], [0.35, 9], [1.5, 8], [2.0, 0]],
+ bodyAngleZ: [[0, 0], [0.5, -2], [1.5, -2], [2.0, 0]],
eyeOpenL: [[0, 1], [0.25, 1], [0.4, 0], [1.4, 0], [1.6, 1]],
eyeSmileL: [[0, 0], [0.3, 1], [1.5, 1], [1.7, 0]],
- ParamMouthOpenY: [[0, 0], [2.0, 0]], // wink with a closed smile
- ParamMouthForm: [[0, 0], [0.35, -0.8], [2.0, 0]],
- ParamCheek: [[0, 0], [0.4, 0.5], [1.6, 0.5], [2.0, 0]],
+ mouthOpen: [[0, 0], [2.0, 0]], // wink with a closed smile
+ mouthForm: [[0, 0], [0.35, -0.8], [2.0, 0]],
+ blush: [[0, 0], [0.4, 0.5], [1.6, 0.5], [2.0, 0]],
},
},
greet: {
label: 'ごあいさつ', dur: 2.6,
tracks: {
- ParamAngleY: [[0, 0], [0.7, -18], [1.2, -17], [1.9, 2], [2.6, 0]],
- ParamBodyAngleX: [[0, 0], [0.8, 2], [1.8, 0]],
- ParamBodyAngleZ: [[0, 0], [0.8, 1.5], [2.0, 0]],
- ParamArmAngle: [[0, 0], [0.8, 3], [2.0, 0]],
+ angleY: [[0, 0], [0.7, -18], [1.2, -17], [1.9, 2], [2.6, 0]],
+ bodyAngleX: [[0, 0], [0.8, 2], [1.8, 0]],
+ bodyAngleZ: [[0, 0], [0.8, 1.5], [2.0, 0]],
+ armAngle: [[0, 0], [0.8, 3], [2.0, 0]],
eyeOpen: [[0, 1], [0.5, 0], [1.4, 0], [1.8, 1]],
- ParamEyeSmile: [[0, 0], [0.5, 1], [1.6, 1], [2.3, 0.4], [2.6, 0]],
- ParamMouthOpenY: [[0, 0], [1.6, 0], [1.8, 0.3], [2.3, 0.2], [2.6, 0]],
- ParamMouthForm: [[0, 0], [1.6, -0.8], [2.6, -0.3]],
- ParamCheek: [[0, 0], [1.6, 0.3], [2.6, 0]],
+ eyeSmile: [[0, 0], [0.5, 1], [1.6, 1], [2.3, 0.4], [2.6, 0]],
+ mouthOpen: [[0, 0], [1.6, 0], [1.8, 0.3], [2.3, 0.2], [2.6, 0]],
+ mouthForm: [[0, 0], [1.6, -0.8], [2.6, -0.3]],
+ blush: [[0, 0], [1.6, 0.3], [2.6, 0]],
},
},
};
// Idle motions: every one moves several parameters at once (breath, head, body, arm,
-// gaze, lids, brows) so the whole figure takes part, like a Live2D idle.
+// gaze, lids, brows) so the whole figure takes part, like a 2D mesh avatar idle.
// Eyes only go down to ~0.55 open and the mouth stays shut (a single image fakes those worst).
-// ParamBreath tracks replace the automatic breathing while the motion plays.
+// breath tracks replace the automatic breathing while the motion plays.
export const IDLE_MOTIONS = {
lookAround: {
label: 'きょろきょろ', dur: 5.2, idle: true,
tracks: {
- ParamEyeBallX: [[0, 0], [0.25, -0.85], [1.5, -0.8], [1.8, 0.1], [2.1, 0.85], [3.4, 0.8], [3.7, 0], [5.2, 0]],
- ParamEyeBallY: [[0, 0], [0.25, 0.15], [1.8, 0.25], [2.1, 0.1], [3.7, 0], [5.2, 0]],
- ParamAngleX: [[0, 0], [0.7, -20], [1.6, -18], [2.5, 19], [3.5, 17], [4.4, 0], [5.2, 0]],
- ParamAngleY: [[0, 0], [0.7, 3], [1.8, 5], [2.5, 3], [4.4, 0]],
- ParamAngleZ: [[0, 0], [0.8, 4], [1.8, 0], [2.6, -4], [4.4, 0]],
- ParamBodyAngleX: [[0, 0], [1.0, -4], [2.8, 4], [4.6, 0]],
- ParamBodyAngleZ: [[0, 0], [1.0, 1.5], [2.8, -1.5], [4.6, 0]],
- ParamHandAngle: [[0, 0], [1.0, -2], [2.8, 2], [4.6, 0]],
- ParamBrowY: [[0, 0], [0.5, 0.35], [3.6, 0.3], [4.4, 0]],
+ gazeX: [[0, 0], [0.25, -0.85], [1.5, -0.8], [1.8, 0.1], [2.1, 0.85], [3.4, 0.8], [3.7, 0], [5.2, 0]],
+ gazeY: [[0, 0], [0.25, 0.15], [1.8, 0.25], [2.1, 0.1], [3.7, 0], [5.2, 0]],
+ angleX: [[0, 0], [0.7, -20], [1.6, -18], [2.5, 19], [3.5, 17], [4.4, 0], [5.2, 0]],
+ angleY: [[0, 0], [0.7, 3], [1.8, 5], [2.5, 3], [4.4, 0]],
+ angleZ: [[0, 0], [0.8, 4], [1.8, 0], [2.6, -4], [4.4, 0]],
+ bodyAngleX: [[0, 0], [1.0, -4], [2.8, 4], [4.6, 0]],
+ bodyAngleZ: [[0, 0], [1.0, 1.5], [2.8, -1.5], [4.6, 0]],
+ handAngle: [[0, 0], [1.0, -2], [2.8, 2], [4.6, 0]],
+ browY: [[0, 0], [0.5, 0.35], [3.6, 0.3], [4.4, 0]],
// curious: a quick inhale, held while looking, let out at the end
- ParamBreath: [[0, 0.2], [0.6, 0.85], [3.6, 0.7], [4.6, 0], [5.2, 0.1]],
+ breath: [[0, 0.2], [0.6, 0.85], [3.6, 0.7], [4.6, 0], [5.2, 0.1]],
},
},
glance: {
label: 'ふと横を見る', dur: 4.6, idle: true,
tracks: {
- ParamEyeBallX: [[0, 0], [0.18, 0.9], [2.6, 0.85], [2.9, 0.15], [3.2, 0], [4.6, 0]],
- ParamEyeBallY: [[0, 0], [0.18, 0.4], [2.6, 0.35], [3.2, 0]],
- ParamAngleX: [[0, 0], [0.6, 13], [2.6, 11], [3.6, 0]],
- ParamAngleY: [[0, 0], [0.6, 6], [2.6, 5], [3.6, 0]],
- ParamAngleZ: [[0, 0], [0.7, -5], [2.6, -4], [3.6, 0]],
- ParamBodyAngleX: [[0, 0], [1.0, 2.5], [2.8, 2], [4.0, 0]],
+ gazeX: [[0, 0], [0.18, 0.9], [2.6, 0.85], [2.9, 0.15], [3.2, 0], [4.6, 0]],
+ gazeY: [[0, 0], [0.18, 0.4], [2.6, 0.35], [3.2, 0]],
+ angleX: [[0, 0], [0.6, 13], [2.6, 11], [3.6, 0]],
+ angleY: [[0, 0], [0.6, 6], [2.6, 5], [3.6, 0]],
+ angleZ: [[0, 0], [0.7, -5], [2.6, -4], [3.6, 0]],
+ bodyAngleX: [[0, 0], [1.0, 2.5], [2.8, 2], [4.0, 0]],
eyeOpen: [[0, 1], [0.3, 1.06], [2.5, 1.05], [2.8, 0.85], [3.4, 1]],
- ParamBrowY: [[0, 0], [0.4, 0.4], [2.5, 0.35], [3.4, 0]],
- ParamBrowAngle: [[0, 0], [0.4, -0.2], [2.5, -0.2], [3.4, 0]],
- ParamBreath: [[0, 0], [0.5, 0.6], [2.6, 0.55], [3.8, 0], [4.6, 0.3]],
+ browY: [[0, 0], [0.4, 0.4], [2.5, 0.35], [3.4, 0]],
+ browAngle: [[0, 0], [0.4, -0.2], [2.5, -0.2], [3.4, 0]],
+ breath: [[0, 0], [0.5, 0.6], [2.6, 0.55], [3.8, 0], [4.6, 0.3]],
},
},
sway: {
label: 'ゆらゆら', dur: 7.0, idle: true,
tracks: {
- ParamBodyAngleZ: [[0, 0], [1.6, 6], [3.4, -6], [5.2, 5], [7.0, 0]],
- ParamBodyAngleX: [[0, 0], [1.6, 3], [3.4, -3], [5.2, 2.5], [7.0, 0]],
- ParamAngleZ: [[0, 0], [1.8, -10], [3.6, 10], [5.4, -8], [7.0, 0]],
- ParamAngleX: [[0, 0], [1.8, 6], [3.6, -6], [5.4, 5], [7.0, 0]],
- ParamAngleY: [[0, 0], [0.9, 3], [1.8, 0], [2.7, 3], [3.6, 0], [4.5, 3], [5.4, 0], [7.0, 0]],
- ParamArmAngle: [[0, 0], [1.6, 3], [3.4, -3], [5.2, 2], [7.0, 0]],
- ParamHandAngle: [[0, 0], [1.8, -4], [3.6, 4], [5.4, -3], [7.0, 0]],
- ParamEyeBallX: [[0, 0], [1.8, -0.3], [3.6, 0.3], [5.4, -0.2], [7.0, 0]],
+ bodyAngleZ: [[0, 0], [1.6, 6], [3.4, -6], [5.2, 5], [7.0, 0]],
+ bodyAngleX: [[0, 0], [1.6, 3], [3.4, -3], [5.2, 2.5], [7.0, 0]],
+ angleZ: [[0, 0], [1.8, -10], [3.6, 10], [5.4, -8], [7.0, 0]],
+ angleX: [[0, 0], [1.8, 6], [3.6, -6], [5.4, 5], [7.0, 0]],
+ angleY: [[0, 0], [0.9, 3], [1.8, 0], [2.7, 3], [3.6, 0], [4.5, 3], [5.4, 0], [7.0, 0]],
+ armAngle: [[0, 0], [1.6, 3], [3.4, -3], [5.2, 2], [7.0, 0]],
+ handAngle: [[0, 0], [1.8, -4], [3.6, 4], [5.4, -3], [7.0, 0]],
+ gazeX: [[0, 0], [1.8, -0.3], [3.6, 0.3], [5.4, -0.2], [7.0, 0]],
eyeOpen: [[0, 1], [0.8, 0.82], [6.2, 0.82], [7.0, 1]],
- ParamEyeSmile: [[0, 0], [0.8, 0.35], [6.2, 0.35], [7.0, 0]],
+ eyeSmile: [[0, 0], [0.8, 0.35], [6.2, 0.35], [7.0, 0]],
// slow, even breaths in time with the sway
- ParamBreath: [[0, 0], [0.9, 1], [1.8, 0], [2.7, 1], [3.6, 0], [4.5, 1], [5.4, 0], [6.3, 0.8], [7.0, 0]],
+ breath: [[0, 0], [0.9, 1], [1.8, 0], [2.7, 1], [3.6, 0], [4.5, 1], [5.4, 0], [6.3, 0.8], [7.0, 0]],
},
},
sigh: {
label: 'ひと息', dur: 5.6, idle: true,
tracks: {
- ParamBreath: [[0, 0], [1.3, 1.25], [1.9, 1.25], [3.6, 0], [5.6, 0]],
- ParamAngleY: [[0, 0], [1.3, 9], [1.9, 9], [3.3, -9], [4.6, -6], [5.6, 0]],
- ParamAngleZ: [[0, 0], [1.3, -3], [3.3, 5], [5.6, 0]],
- ParamBodyAngleX: [[0, 0], [1.3, -2.5], [3.3, 2.5], [5.6, 0]],
- ParamBodyAngleZ: [[0, 0], [1.9, 1], [3.3, -1.5], [5.6, 0]],
- ParamArmAngle: [[0, 0], [1.3, -2.5], [3.3, 2], [5.6, 0]],
- ParamEyeBallY: [[0, 0], [1.2, 0.4], [2.0, 0.3], [3.2, -0.4], [4.8, -0.2], [5.6, 0]],
+ breath: [[0, 0], [1.3, 1.25], [1.9, 1.25], [3.6, 0], [5.6, 0]],
+ angleY: [[0, 0], [1.3, 9], [1.9, 9], [3.3, -9], [4.6, -6], [5.6, 0]],
+ angleZ: [[0, 0], [1.3, -3], [3.3, 5], [5.6, 0]],
+ bodyAngleX: [[0, 0], [1.3, -2.5], [3.3, 2.5], [5.6, 0]],
+ bodyAngleZ: [[0, 0], [1.9, 1], [3.3, -1.5], [5.6, 0]],
+ armAngle: [[0, 0], [1.3, -2.5], [3.3, 2], [5.6, 0]],
+ gazeY: [[0, 0], [1.2, 0.4], [2.0, 0.3], [3.2, -0.4], [4.8, -0.2], [5.6, 0]],
eyeOpen: [[0, 1], [1.0, 0.95], [1.9, 0.6], [3.4, 0.6], [4.6, 0.78], [5.6, 1]],
- ParamBrowY: [[0, 0], [1.3, 0.35], [3.2, -0.2], [5.6, 0]],
- ParamBrowAngle: [[0, 0], [1.9, -0.4], [4.6, -0.35], [5.6, 0]],
+ browY: [[0, 0], [1.3, 0.35], [3.2, -0.2], [5.6, 0]],
+ browAngle: [[0, 0], [1.9, -0.4], [4.6, -0.35], [5.6, 0]],
},
},
doze: {
label: 'うとうと', dur: 7.2, idle: true,
tracks: {
eyeOpen: [[0, 1], [1.8, 0.78], [3.2, 0.62], [4.5, 0.55], [4.75, 1.1], [5.6, 1.05], [7.2, 1]],
- ParamAngleY: [[0, 0], [1.8, -6], [3.2, -9], [4.5, -17], [4.75, 5], [5.6, 2], [7.2, 0]],
- ParamAngleZ: [[0, 0], [2.0, 4], [4.5, 10], [4.75, -2], [7.2, 0]],
- ParamAngleX: [[0, 0], [4.5, -4], [4.75, 3], [5.4, -6], [6.2, 5], [7.2, 0]],
- ParamBodyAngleZ: [[0, 0], [4.5, 3], [4.8, -2], [7.2, 0]],
- ParamBodyAngleX: [[0, 0], [4.5, 2], [4.8, -1.5], [7.2, 0]],
- ParamArmAngle: [[0, 0], [4.5, 3], [4.8, -2], [7.2, 0]],
- ParamHandAngle: [[0, 0], [4.5, 5], [4.8, -1], [7.2, 0]],
- ParamEyeBallY: [[0, 0], [4.5, -0.4], [4.75, 0.2], [7.2, 0]],
- ParamEyeBallX: [[0, 0], [4.8, 0], [5.3, -0.6], [6.1, 0.6], [6.8, 0]],
- ParamBrowY: [[0, 0], [4.5, -0.35], [4.75, 0.8], [5.8, 0.3], [7.2, 0]],
+ angleY: [[0, 0], [1.8, -6], [3.2, -9], [4.5, -17], [4.75, 5], [5.6, 2], [7.2, 0]],
+ angleZ: [[0, 0], [2.0, 4], [4.5, 10], [4.75, -2], [7.2, 0]],
+ angleX: [[0, 0], [4.5, -4], [4.75, 3], [5.4, -6], [6.2, 5], [7.2, 0]],
+ bodyAngleZ: [[0, 0], [4.5, 3], [4.8, -2], [7.2, 0]],
+ bodyAngleX: [[0, 0], [4.5, 2], [4.8, -1.5], [7.2, 0]],
+ armAngle: [[0, 0], [4.5, 3], [4.8, -2], [7.2, 0]],
+ handAngle: [[0, 0], [4.5, 5], [4.8, -1], [7.2, 0]],
+ gazeY: [[0, 0], [4.5, -0.4], [4.75, 0.2], [7.2, 0]],
+ gazeX: [[0, 0], [4.8, 0], [5.3, -0.6], [6.1, 0.6], [6.8, 0]],
+ browY: [[0, 0], [4.5, -0.35], [4.75, 0.8], [5.8, 0.3], [7.2, 0]],
// long, slow, deepening breaths; a sharp inhale on waking
- ParamBreath: [[0, 0], [1.1, 0.7], [2.6, 0], [3.8, 0.6], [4.5, 0.2], [4.8, 1.1], [6.0, 0.2], [7.2, 0]],
+ breath: [[0, 0], [1.1, 0.7], [2.6, 0], [3.8, 0.6], [4.5, 0.2], [4.8, 1.1], [6.0, 0.2], [7.2, 0]],
},
},
stretch: {
label: '首をのばす', dur: 6.2, idle: true,
tracks: {
- ParamAngleZ: [[0, 0], [1.3, -22], [2.3, -21], [3.8, 20], [4.8, 19], [6.2, 0]],
- ParamAngleY: [[0, 0], [1.3, 5], [2.3, 7], [3.1, -3], [3.8, 5], [4.8, 6], [6.2, 0]],
- ParamAngleX: [[0, 0], [1.3, -5], [3.8, 5], [6.2, 0]],
- ParamBodyAngleZ: [[0, 0], [1.3, 4], [3.8, -4], [6.2, 0]],
- ParamBodyAngleX: [[0, 0], [1.3, -2], [3.8, 2], [6.2, 0]],
- ParamArmAngle: [[0, 0], [1.3, 2], [3.8, -2], [6.2, 0]],
+ angleZ: [[0, 0], [1.3, -22], [2.3, -21], [3.8, 20], [4.8, 19], [6.2, 0]],
+ angleY: [[0, 0], [1.3, 5], [2.3, 7], [3.1, -3], [3.8, 5], [4.8, 6], [6.2, 0]],
+ angleX: [[0, 0], [1.3, -5], [3.8, 5], [6.2, 0]],
+ bodyAngleZ: [[0, 0], [1.3, 4], [3.8, -4], [6.2, 0]],
+ bodyAngleX: [[0, 0], [1.3, -2], [3.8, 2], [6.2, 0]],
+ armAngle: [[0, 0], [1.3, 2], [3.8, -2], [6.2, 0]],
eyeOpen: [[0, 1], [0.8, 0.62], [4.9, 0.62], [5.6, 1]],
- ParamBrowAngle: [[0, 0], [1.0, -0.3], [4.9, -0.3], [5.8, 0]],
- ParamBreath: [[0, 0], [1.3, 1.1], [2.3, 0.9], [3.1, 0.2], [3.8, 1.1], [4.8, 0.9], [6.2, 0]],
+ browAngle: [[0, 0], [1.0, -0.3], [4.9, -0.3], [5.8, 0]],
+ breath: [[0, 0], [1.3, 1.1], [2.3, 0.9], [3.1, 0.2], [3.8, 1.1], [4.8, 0.9], [6.2, 0]],
},
},
lean: {
label: 'のぞきこむ', dur: 4.8, idle: true,
tracks: {
- ParamBodyAngleX: [[0, 0], [0.9, 6], [3.4, 6], [4.4, 0]],
- ParamBodyAngleZ: [[0, 0], [0.9, -3], [3.4, -3], [4.4, 0]],
- ParamAngleX: [[0, 0], [0.9, 9], [2.0, 7], [2.6, 10], [3.4, 8], [4.4, 0]],
- ParamAngleY: [[0, 0], [0.9, -6], [3.4, -5], [4.4, 0]],
- ParamAngleZ: [[0, 0], [0.9, 10], [2.2, 12], [3.4, 9], [4.4, 0]],
- ParamArmAngle: [[0, 0], [0.9, -3], [3.4, -3], [4.4, 0]],
- ParamHandAngle: [[0, 0], [0.9, 3], [3.4, 3], [4.4, 0]],
- ParamEyeBallY: [[0, 0], [0.6, 0.45], [3.4, 0.4], [4.2, 0]],
- ParamEyeBallX: [[0, 0], [1.5, 0], [1.8, -0.3], [2.3, 0.2], [2.8, 0], [4.2, 0]],
+ bodyAngleX: [[0, 0], [0.9, 6], [3.4, 6], [4.4, 0]],
+ bodyAngleZ: [[0, 0], [0.9, -3], [3.4, -3], [4.4, 0]],
+ angleX: [[0, 0], [0.9, 9], [2.0, 7], [2.6, 10], [3.4, 8], [4.4, 0]],
+ angleY: [[0, 0], [0.9, -6], [3.4, -5], [4.4, 0]],
+ angleZ: [[0, 0], [0.9, 10], [2.2, 12], [3.4, 9], [4.4, 0]],
+ armAngle: [[0, 0], [0.9, -3], [3.4, -3], [4.4, 0]],
+ handAngle: [[0, 0], [0.9, 3], [3.4, 3], [4.4, 0]],
+ gazeY: [[0, 0], [0.6, 0.45], [3.4, 0.4], [4.2, 0]],
+ gazeX: [[0, 0], [1.5, 0], [1.8, -0.3], [2.3, 0.2], [2.8, 0], [4.2, 0]],
eyeOpen: [[0, 1], [0.6, 1.1], [3.4, 1.08], [4.2, 1]],
- ParamBrowY: [[0, 0], [0.6, 0.45], [3.4, 0.4], [4.2, 0]],
- ParamBrowAngle: [[0, 0], [0.6, -0.3], [3.4, -0.3], [4.2, 0]],
- ParamCheek: [[0, 0], [1.2, 0.25], [3.4, 0.25], [4.4, 0]],
- ParamBreath: [[0, 0], [0.8, 0.8], [3.4, 0.6], [4.4, 0], [4.8, 0.2]],
+ browY: [[0, 0], [0.6, 0.45], [3.4, 0.4], [4.2, 0]],
+ browAngle: [[0, 0], [0.6, -0.3], [3.4, -0.3], [4.2, 0]],
+ blush: [[0, 0], [1.2, 0.25], [3.4, 0.25], [4.4, 0]],
+ breath: [[0, 0], [0.8, 0.8], [3.4, 0.6], [4.4, 0], [4.8, 0.2]],
},
},
hum: {
label: 'ふんふん', dur: 5.6, idle: true,
tracks: {
- ParamAngleY: [[0, 0], [0.45, -5], [0.9, 2], [1.35, -5], [1.8, 2], [2.25, -5], [2.7, 2], [3.15, -5], [3.6, 2], [4.05, -4], [4.8, 0]],
- ParamAngleZ: [[0, 0], [0.9, 8], [1.8, -8], [2.7, 8], [3.6, -8], [4.6, 0]],
- ParamAngleX: [[0, 0], [0.9, 4], [1.8, -4], [2.7, 4], [3.6, -4], [4.6, 0]],
- ParamBodyAngleZ: [[0, 0], [0.9, -3], [1.8, 3], [2.7, -3], [3.6, 3], [4.6, 0]],
- ParamBodyAngleX: [[0, 0], [1.8, 2], [3.6, -2], [4.8, 0]],
- ParamHandAngle: [[0, 0], [0.9, 3], [1.8, -3], [2.7, 3], [3.6, -3], [4.6, 0]],
- ParamFingerTap: [[0, 0], [0.45, 1], [0.9, 0], [1.35, 1], [1.8, 0], [2.25, 1], [2.7, 0], [3.15, 1], [3.6, 0], [5.6, 0]],
- ParamEyeBallX: [[0, 0], [0.9, 0.3], [1.8, -0.3], [2.7, 0.3], [3.6, -0.3], [4.6, 0]],
+ angleY: [[0, 0], [0.45, -5], [0.9, 2], [1.35, -5], [1.8, 2], [2.25, -5], [2.7, 2], [3.15, -5], [3.6, 2], [4.05, -4], [4.8, 0]],
+ angleZ: [[0, 0], [0.9, 8], [1.8, -8], [2.7, 8], [3.6, -8], [4.6, 0]],
+ angleX: [[0, 0], [0.9, 4], [1.8, -4], [2.7, 4], [3.6, -4], [4.6, 0]],
+ bodyAngleZ: [[0, 0], [0.9, -3], [1.8, 3], [2.7, -3], [3.6, 3], [4.6, 0]],
+ bodyAngleX: [[0, 0], [1.8, 2], [3.6, -2], [4.8, 0]],
+ handAngle: [[0, 0], [0.9, 3], [1.8, -3], [2.7, 3], [3.6, -3], [4.6, 0]],
+ fingerTap: [[0, 0], [0.45, 1], [0.9, 0], [1.35, 1], [1.8, 0], [2.25, 1], [2.7, 0], [3.15, 1], [3.6, 0], [5.6, 0]],
+ gazeX: [[0, 0], [0.9, 0.3], [1.8, -0.3], [2.7, 0.3], [3.6, -0.3], [4.6, 0]],
eyeOpen: [[0, 1], [0.4, 0.72], [4.6, 0.72], [5.3, 1]],
- ParamEyeSmile: [[0, 0], [0.4, 0.55], [4.6, 0.55], [5.3, 0]],
- ParamCheek: [[0, 0], [0.8, 0.3], [4.6, 0.3], [5.6, 0]],
- ParamBrowY: [[0, 0], [0.5, 0.25], [4.6, 0.25], [5.4, 0]],
- ParamBreath: [[0, 0], [0.9, 0.9], [1.8, 0.2], [2.7, 0.9], [3.6, 0.2], [4.6, 0.8], [5.6, 0]],
+ eyeSmile: [[0, 0], [0.4, 0.55], [4.6, 0.55], [5.3, 0]],
+ blush: [[0, 0], [0.8, 0.3], [4.6, 0.3], [5.6, 0]],
+ browY: [[0, 0], [0.5, 0.25], [4.6, 0.25], [5.4, 0]],
+ breath: [[0, 0], [0.9, 0.9], [1.8, 0.2], [2.7, 0.9], [3.6, 0.2], [4.6, 0.8], [5.6, 0]],
},
},
tap: {
label: 'とんとん', dur: 5.0, idle: true,
tracks: {
- ParamEyeBallX: [[0, 0], [0.3, -0.6], [2.2, -0.5], [2.5, -0.1], [2.8, -0.6], [4.2, -0.5], [4.7, 0]],
- ParamEyeBallY: [[0, 0], [0.3, 0.55], [4.2, 0.5], [4.7, 0]],
- ParamAngleX: [[0, 0], [0.8, -11], [2.4, -9], [3.0, -12], [4.2, -10], [5.0, 0]],
- ParamAngleY: [[0, 0], [0.8, 8], [4.2, 7], [5.0, 0]],
- ParamAngleZ: [[0, 0], [0.8, 6], [2.4, 4], [3.0, 7], [4.2, 5], [5.0, 0]],
- ParamBodyAngleX: [[0, 0], [1.0, -2], [4.2, -2], [5.0, 0]],
- ParamHandAngle: [[0, 0], [0.8, 3], [4.2, 3], [5.0, 0]],
- ParamFingerTap: [[0, 0], [0.9, 0], [1.05, 1], [1.2, 0], [1.4, 1], [1.55, 0], [1.75, 1], [1.9, 0],
+ gazeX: [[0, 0], [0.3, -0.6], [2.2, -0.5], [2.5, -0.1], [2.8, -0.6], [4.2, -0.5], [4.7, 0]],
+ gazeY: [[0, 0], [0.3, 0.55], [4.2, 0.5], [4.7, 0]],
+ angleX: [[0, 0], [0.8, -11], [2.4, -9], [3.0, -12], [4.2, -10], [5.0, 0]],
+ angleY: [[0, 0], [0.8, 8], [4.2, 7], [5.0, 0]],
+ angleZ: [[0, 0], [0.8, 6], [2.4, 4], [3.0, 7], [4.2, 5], [5.0, 0]],
+ bodyAngleX: [[0, 0], [1.0, -2], [4.2, -2], [5.0, 0]],
+ handAngle: [[0, 0], [0.8, 3], [4.2, 3], [5.0, 0]],
+ fingerTap: [[0, 0], [0.9, 0], [1.05, 1], [1.2, 0], [1.4, 1], [1.55, 0], [1.75, 1], [1.9, 0],
[2.6, 0], [2.75, 1], [2.9, 0], [3.1, 1], [3.25, 0], [5.0, 0]],
- ParamBrowY: [[0, 0], [0.6, 0.3], [4.2, 0.25], [5.0, 0]],
- ParamBrowAngle: [[0, 0], [0.6, -0.35], [4.2, -0.3], [5.0, 0]],
+ browY: [[0, 0], [0.6, 0.3], [4.2, 0.25], [5.0, 0]],
+ browAngle: [[0, 0], [0.6, -0.35], [4.2, -0.3], [5.0, 0]],
eyeOpen: [[0, 1], [0.6, 0.9], [4.2, 0.9], [5.0, 1]],
- ParamBreath: [[0, 0], [0.8, 0.7], [2.2, 0.4], [3.2, 0.8], [4.4, 0], [5.0, 0.2]],
+ breath: [[0, 0], [0.8, 0.7], [2.2, 0.4], [3.2, 0.8], [4.4, 0], [5.0, 0.2]],
},
},
readNote: {
label: '原稿を見る', dur: 2.6, idle: true,
tracks: {
// a quick look down at the notes on the desk and back to the camera
- ParamEyeBallY: [[0, 0], [0.2, -0.85], [1.5, -0.8], [1.75, 0], [2.6, 0]],
- ParamEyeBallX: [[0, 0], [0.2, -0.15], [1.5, -0.1], [1.75, 0]],
- ParamAngleY: [[0, 0], [0.45, -9], [1.5, -8], [2.0, 1], [2.6, 0]],
- ParamAngleZ: [[0, 0], [0.5, 2], [1.6, 2], [2.6, 0]],
+ gazeY: [[0, 0], [0.2, -0.85], [1.5, -0.8], [1.75, 0], [2.6, 0]],
+ gazeX: [[0, 0], [0.2, -0.15], [1.5, -0.1], [1.75, 0]],
+ angleY: [[0, 0], [0.45, -9], [1.5, -8], [2.0, 1], [2.6, 0]],
+ angleZ: [[0, 0], [0.5, 2], [1.6, 2], [2.6, 0]],
eyeOpen: [[0, 1], [0.3, 0.78], [1.5, 0.78], [1.75, 1]],
- ParamBreath: [[0, 0.3], [0.8, 0.5], [1.8, 0.2], [2.6, 0.4]],
+ breath: [[0, 0.3], [0.8, 0.5], [1.8, 0.2], [2.6, 0.4]],
},
},
waiting: {
label: 'そわそわ', dur: 6.4, idle: true,
tracks: {
// shifts her weight, checks the viewer, looks away, shifts back
- ParamBodyAngleZ: [[0, 0], [0.9, 5], [2.4, 4], [3.3, -5], [5.2, -4], [6.4, 0]],
- ParamBodyAngleX: [[0, 0], [0.9, 3], [3.3, -3], [5.2, -2], [6.4, 0]],
- ParamAngleZ: [[0, 0], [1.0, -6], [2.4, -4], [3.4, 6], [5.2, 5], [6.4, 0]],
- ParamAngleX: [[0, 0], [1.2, -8], [2.2, 2], [3.6, 12], [5.0, 10], [6.2, 0]],
- ParamAngleY: [[0, 0], [1.2, -3], [2.2, 2], [3.6, -2], [6.2, 0]],
- ParamArmAngle: [[0, 0], [0.9, 3], [3.3, -3], [5.2, -2], [6.4, 0]],
- ParamHandAngle: [[0, 0], [1.2, 3], [3.4, -3], [6.4, 0]],
- ParamFingerTap: [[0, 0], [4.2, 0], [4.35, 1], [4.5, 0], [4.7, 1], [4.85, 0], [6.4, 0]],
- ParamEyeBallX: [[0, 0], [0.9, -0.7], [1.9, -0.6], [2.1, 0], [2.7, 0], [2.9, 0.8], [5.0, 0.7], [5.4, 0], [6.4, 0]],
- ParamEyeBallY: [[0, 0], [0.9, -0.2], [2.1, 0], [2.9, 0.3], [5.4, 0]],
+ bodyAngleZ: [[0, 0], [0.9, 5], [2.4, 4], [3.3, -5], [5.2, -4], [6.4, 0]],
+ bodyAngleX: [[0, 0], [0.9, 3], [3.3, -3], [5.2, -2], [6.4, 0]],
+ angleZ: [[0, 0], [1.0, -6], [2.4, -4], [3.4, 6], [5.2, 5], [6.4, 0]],
+ angleX: [[0, 0], [1.2, -8], [2.2, 2], [3.6, 12], [5.0, 10], [6.2, 0]],
+ angleY: [[0, 0], [1.2, -3], [2.2, 2], [3.6, -2], [6.2, 0]],
+ armAngle: [[0, 0], [0.9, 3], [3.3, -3], [5.2, -2], [6.4, 0]],
+ handAngle: [[0, 0], [1.2, 3], [3.4, -3], [6.4, 0]],
+ fingerTap: [[0, 0], [4.2, 0], [4.35, 1], [4.5, 0], [4.7, 1], [4.85, 0], [6.4, 0]],
+ gazeX: [[0, 0], [0.9, -0.7], [1.9, -0.6], [2.1, 0], [2.7, 0], [2.9, 0.8], [5.0, 0.7], [5.4, 0], [6.4, 0]],
+ gazeY: [[0, 0], [0.9, -0.2], [2.1, 0], [2.9, 0.3], [5.4, 0]],
eyeOpen: [[0, 1], [2.0, 1], [2.2, 1.06], [2.8, 1.05], [3.1, 0.85], [5.4, 0.85], [6.2, 1]],
- ParamBrowAngle: [[0, 0], [0.9, -0.35], [2.0, -0.35], [2.3, 0], [3.1, -0.4], [5.4, -0.35], [6.4, 0]],
- ParamBrowY: [[0, 0], [2.2, 0.4], [2.8, 0.35], [3.2, 0], [6.4, 0]],
- ParamBreath: [[0, 0.3], [0.9, 0.8], [2.0, 0.3], [2.6, 0.9], [3.4, 0.2], [4.4, 0.8], [5.6, 0], [6.4, 0.2]],
+ browAngle: [[0, 0], [0.9, -0.35], [2.0, -0.35], [2.3, 0], [3.1, -0.4], [5.4, -0.35], [6.4, 0]],
+ browY: [[0, 0], [2.2, 0.4], [2.8, 0.35], [3.2, 0], [6.4, 0]],
+ breath: [[0, 0.3], [0.9, 0.8], [2.0, 0.3], [2.6, 0.9], [3.4, 0.2], [4.4, 0.8], [5.6, 0], [6.4, 0.2]],
},
},
spaceOut: {
label: 'ぼんやり', dur: 7.4, idle: true,
tracks: {
// gaze drifts up and away, breaths get slow and long, one slow blink
- ParamEyeBallX: [[0, 0], [1.4, -0.55], [4.8, -0.6], [5.6, 0.1], [7.0, 0]],
- ParamEyeBallY: [[0, 0], [1.4, 0.6], [4.8, 0.55], [5.6, 0], [7.0, 0]],
- ParamAngleX: [[0, 0], [2.0, -9], [4.8, -10], [6.0, 2], [7.4, 0]],
- ParamAngleY: [[0, 0], [2.0, 7], [4.8, 8], [6.0, -2], [7.4, 0]],
- ParamAngleZ: [[0, 0], [2.0, 9], [4.8, 11], [6.0, 2], [7.4, 0]],
- ParamBodyAngleZ: [[0, 0], [2.2, 3], [4.8, 3.5], [6.4, 0]],
- ParamBodyAngleX: [[0, 0], [2.2, -2], [4.8, -2], [6.4, 0]],
- ParamHandAngle: [[0, 0], [2.2, 4], [4.8, 5], [6.4, 0]],
- ParamArmAngle: [[0, 0], [2.2, 2], [4.8, 2], [6.4, 0]],
+ gazeX: [[0, 0], [1.4, -0.55], [4.8, -0.6], [5.6, 0.1], [7.0, 0]],
+ gazeY: [[0, 0], [1.4, 0.6], [4.8, 0.55], [5.6, 0], [7.0, 0]],
+ angleX: [[0, 0], [2.0, -9], [4.8, -10], [6.0, 2], [7.4, 0]],
+ angleY: [[0, 0], [2.0, 7], [4.8, 8], [6.0, -2], [7.4, 0]],
+ angleZ: [[0, 0], [2.0, 9], [4.8, 11], [6.0, 2], [7.4, 0]],
+ bodyAngleZ: [[0, 0], [2.2, 3], [4.8, 3.5], [6.4, 0]],
+ bodyAngleX: [[0, 0], [2.2, -2], [4.8, -2], [6.4, 0]],
+ handAngle: [[0, 0], [2.2, 4], [4.8, 5], [6.4, 0]],
+ armAngle: [[0, 0], [2.2, 2], [4.8, 2], [6.4, 0]],
eyeOpen: [[0, 1], [1.4, 0.8], [3.0, 0.8], [3.35, 0.56], [3.8, 0.8], [4.8, 0.8], [5.6, 1.04], [6.4, 1]],
- ParamBrowY: [[0, 0], [1.6, 0.15], [4.8, 0.15], [5.6, 0.35], [6.6, 0]],
- ParamBreath: [[0, 0], [1.6, 0.9], [3.4, 0], [5.0, 0.9], [6.2, 0.1], [7.4, 0]],
+ browY: [[0, 0], [1.6, 0.15], [4.8, 0.15], [5.6, 0.35], [6.6, 0]],
+ breath: [[0, 0], [1.6, 0.9], [3.4, 0], [5.0, 0.9], [6.2, 0.1], [7.4, 0]],
},
},
};
diff --git a/reference/engine/physics.js b/reference/engine/physics.js
index 147fa32..dccc9e9 100644
--- a/reference/engine/physics.js
+++ b/reference/engine/physics.js
@@ -57,7 +57,7 @@ export class Physics {
step(P, dt) {
const sub = Math.max(1, Math.ceil(dt / (1 / 240)));
const h = Math.min(dt, 0.05) / sub;
- const roll = -P.ParamAngleZ / 30 * 9 * Math.PI / 180 - P.ParamBodyAngleZ / 10 * 3 * Math.PI / 180;
+ const roll = -P.angleZ / 30 * 9 * Math.PI / 180 - P.bodyAngleZ / 10 * 3 * Math.PI / 180;
const g = this.gain;
const noSway = { gain: 0, bunL: [0, 0], bunR: [0, 0] };
diff --git a/reference/engine/rig.js b/reference/engine/rig.js
index f551539..795b313 100644
--- a/reference/engine/rig.js
+++ b/reference/engine/rig.js
@@ -5,25 +5,25 @@
export const IMG = { w: 1254, h: 1254 };
export const PARAMS = [
- { id: 'ParamAngleX', label: '顔の向き 左右', min: -30, max: 30, def: 0, group: '頭と体' },
- { id: 'ParamAngleY', label: '顔の向き 上下', min: -30, max: 30, def: 0, group: '頭と体' },
- { id: 'ParamAngleZ', label: '顔の傾き', min: -30, max: 30, def: 0, group: '頭と体' },
- { id: 'ParamBodyAngleX', label: '体の向き 左右', min: -10, max: 10, def: 0, group: '頭と体' },
- { id: 'ParamBodyAngleZ', label: '体の傾き', min: -10, max: 10, def: 0, group: '頭と体' },
- { id: 'ParamBreath', label: '呼吸', min: 0, max: 1, def: 0, group: '頭と体' },
- { id: 'ParamEyeLOpen', label: '左目の開き', min: 0, max: 1.25, def: 1, group: '目と眉' },
- { id: 'ParamEyeROpen', label: '右目の開き', min: 0, max: 1.25, def: 1, group: '目と眉' },
- { id: 'ParamEyeSmile', label: '目の笑い', min: 0, max: 1, def: 0, group: '目と眉' },
- { id: 'ParamEyeBallX', label: '目玉 左右', min: -1, max: 1, def: 0, group: '目と眉' },
- { id: 'ParamEyeBallY', label: '目玉 上下', min: -1, max: 1, def: 0, group: '目と眉' },
- { id: 'ParamBrowY', label: '眉 上下', min: -1, max: 1, def: 0, group: '目と眉' },
- { id: 'ParamBrowAngle', label: '眉の角度', min: -1, max: 1, def: 0, group: '目と眉' },
- { id: 'ParamMouthOpenY', label: '口の開き', min: 0, max: 1, def: 0, group: '口と頬' },
- { id: 'ParamMouthForm', label: '口の形 (い↔お)', min: -1, max: 1, def: 0, group: '口と頬' },
- { id: 'ParamCheek', label: '照れ', min: 0, max: 1, def: 0, group: '口と頬' },
- { id: 'ParamArmAngle', label: '腕の角度', min: -10, max: 10, def: 0, group: '手' },
- { id: 'ParamHandAngle', label: '手首の角度', min: -10, max: 10, def: 0, group: '手' },
- { id: 'ParamFingerTap', label: '指トントン', min: 0, max: 1, def: 0, group: '手' },
+ { id: 'angleX', label: '顔の向き 左右', min: -30, max: 30, def: 0, group: '頭と体' },
+ { id: 'angleY', label: '顔の向き 上下', min: -30, max: 30, def: 0, group: '頭と体' },
+ { id: 'angleZ', label: '顔の傾き', min: -30, max: 30, def: 0, group: '頭と体' },
+ { id: 'bodyAngleX', label: '体の向き 左右', min: -10, max: 10, def: 0, group: '頭と体' },
+ { id: 'bodyAngleZ', label: '体の傾き', min: -10, max: 10, def: 0, group: '頭と体' },
+ { id: 'breath', label: '呼吸', min: 0, max: 1, def: 0, group: '頭と体' },
+ { id: 'eyeLOpen', label: '左目の開き', min: 0, max: 1.25, def: 1, group: '目と眉' },
+ { id: 'eyeROpen', label: '右目の開き', min: 0, max: 1.25, def: 1, group: '目と眉' },
+ { id: 'eyeSmile', label: '目の笑い', min: 0, max: 1, def: 0, group: '目と眉' },
+ { id: 'gazeX', label: '目玉 左右', min: -1, max: 1, def: 0, group: '目と眉' },
+ { id: 'gazeY', label: '目玉 上下', min: -1, max: 1, def: 0, group: '目と眉' },
+ { id: 'browY', label: '眉 上下', min: -1, max: 1, def: 0, group: '目と眉' },
+ { id: 'browAngle', label: '眉の角度', min: -1, max: 1, def: 0, group: '目と眉' },
+ { id: 'mouthOpen', label: '口の開き', min: 0, max: 1, def: 0, group: '口と頬' },
+ { id: 'mouthForm', label: '口の形 (い↔お)', min: -1, max: 1, def: 0, group: '口と頬' },
+ { id: 'blush', label: '照れ', min: 0, max: 1, def: 0, group: '口と頬' },
+ { id: 'armAngle', label: '腕の角度', min: -10, max: 10, def: 0, group: '手' },
+ { id: 'handAngle', label: '手首の角度', min: -10, max: 10, def: 0, group: '手' },
+ { id: 'fingerTap', label: '指トントン', min: 0, max: 1, def: 0, group: '手' },
];
// ---- face features ----
@@ -194,20 +194,20 @@ function rotateAround(p, cx, cy, a) {
// Head transform with weight w (0 = body, 1 = fully head). Mutates p.
export function applyHead(p, w, P, wTurn = w) {
- const o = turnOffset(p[0], p[1], P.ParamAngleX / 30, P.ParamAngleY / 30);
+ const o = turnOffset(p[0], p[1], P.angleX / 30, P.angleY / 30);
p[0] += o[0] * wTurn; p[1] += o[1] * wTurn;
if (w <= 0) return;
- rotateAround(p, HEAD.pivotX, HEAD.pivotY, -P.ParamAngleZ / 30 * HEAD.maxRoll * w);
+ rotateAround(p, HEAD.pivotX, HEAD.pivotY, -P.angleZ / 30 * HEAD.maxRoll * w);
}
export function applyBody(p, restY, P, chest = 0, breathW = 1, shoulder = 0) {
- const b = P.ParamBreath;
+ const b = P.breath;
// inhale: everything above the cut-off rises, shoulders lift more, the chest widens a little
p[1] -= b * (5 * breathW + 4 * shoulder);
p[0] += (p[0] - 660) * 0.012 * b * chest;
- p[0] += P.ParamBodyAngleX / 10 * (7 + 9 * chest);
+ p[0] += P.bodyAngleX / 10 * (7 + 9 * chest);
// bottom rows stay put so no gap opens at the cut-off edge of the image
- rotateAround(p, BODY.pivotX, BODY.pivotY, -P.ParamBodyAngleZ / 10 * BODY.maxRoll * (1 - sstep(950, 1254, restY)));
+ rotateAround(p, BODY.pivotX, BODY.pivotY, -P.bodyAngleZ / 10 * BODY.maxRoll * (1 - sstep(950, 1254, restY)));
}
// Base layer: hair and face-part offsets are added in rest space, then head, then body.
@@ -225,15 +225,15 @@ export function deformBase(x, y, w, P, phys, out) {
p[0] += (phys.bunL[0] * w.bunL + phys.bunR[0] * w.bunR) * g;
p[1] += (phys.bunL[1] * w.bunL + phys.bunR[1] * w.bunR) * g;
// brows
- p[1] -= P.ParamBrowY * 7 * w.brow;
+ p[1] -= P.browY * 7 * w.brow;
if (w.brow > 0.01) {
- const a = P.ParamBrowAngle * 0.12 * w.brow;
+ const a = P.browAngle * 0.12 * w.brow;
p[1] += (x - 700) * Math.sin(a);
}
- p[1] += P.ParamMouthOpenY * 3.5 * w.jaw;
+ p[1] += P.mouthOpen * 3.5 * w.jaw;
// head turn, per part: nose and mouth travel further than the eyes, the far eye
// narrows and the near eye widens, the ears and buns slide the other way
- const ax = P.ParamAngleX / 30, ay = P.ParamAngleY / 30;
+ const ax = P.angleX / 30, ay = P.angleY / 30;
p[0] += ax * (8 * w.nose + 5 * w.mouth) + (x - 493) * 0.12 * ax * w.eyeA - (x - 713) * 0.12 * ax * w.eyeB
- ax * 9 * w.earR + ax * 4 * w.earL - ax * 10 * (w.bunL + w.bunR);
p[1] -= ay * (6 * w.nose + 3 * w.mouth);
@@ -283,8 +283,8 @@ export function handFrame(P) {
export function deformHand(x, y, w, P, F, out) {
let p = [x, y];
// kept small on purpose: anything the hand uncovers is only a blurry inpaint
- p = rot(p, KNUCKLE, Math.cos(P.ParamFingerTap * 0.07 * w.finger), Math.sin(P.ParamFingerTap * 0.07 * w.finger));
- const ha = -P.ParamHandAngle / 10 * 0.045 * w.wrist, aa = -P.ParamArmAngle / 10 * 0.015 * w.arm;
+ p = rot(p, KNUCKLE, Math.cos(P.fingerTap * 0.07 * w.finger), Math.sin(P.fingerTap * 0.07 * w.finger));
+ const ha = -P.handAngle / 10 * 0.045 * w.wrist, aa = -P.armAngle / 10 * 0.015 * w.arm;
p = rot(p, WRIST, Math.cos(ha), Math.sin(ha));
p = rot(p, ELBOW, Math.cos(aa), Math.sin(aa));
p = F.tr(p);
diff --git a/reference/engine/sprites.js b/reference/engine/sprites.js
index 740dc3f..6750124 100644
--- a/reference/engine/sprites.js
+++ b/reference/engine/sprites.js
@@ -9,8 +9,8 @@ const sstep = (a, b, x) => { const t = Math.min(1, Math.max(0, (x - a) / (b - a)
// Mouth opening area (the region the mouth drawings were painted in): used to squash only
// the inside of the mouth sprite, the skin at its edge stays put.
const MOUTH_AREA = { cx: 636, cy: 574, rx: 62, ry: 34, angle: -14 * Math.PI / 180 };
-// Mouth shapes. ParamMouthForm is the vowel axis: -1 wide (い) .. 0 (あ) .. +1 round (う/お);
-// ParamMouthOpenY how far it opens. Each shape names the drawing it uses, the openness that
+// Mouth shapes. mouthForm is the vowel axis: -1 wide (い) .. 0 (あ) .. +1 round (う/お);
+// mouthOpen how far it opens. Each shape names the drawing it uses, the openness that
// drawing shows at full size, and a width factor (う is a narrowed お).
export const MOUTH_SHAPES = {
a: { sprite: 'mouth_a', ref: 0.9, width: 1 },
@@ -118,8 +118,8 @@ export function createSprites(R, sheet, imgs, buildGrid, alphaOf) {
for (const it of Object.values(items)) it.layer.visible = false;
const covered = [false, false];
const eyes = [
- [P.ParamEyeROpen, P.ParamEyeSmile],
- [P.ParamEyeLOpen, P.eyeSmileL ?? P.ParamEyeSmile],
+ [P.eyeROpen, P.eyeSmile],
+ [P.eyeLOpen, P.eyeSmileL ?? P.eyeSmile],
];
// the frame is picked by openness; when it changes, the new drawing fades in over
// EYE_FADE_SEC (a time-based cross-fade, so no double image is ever held)
@@ -147,16 +147,16 @@ export function createSprites(R, sheet, imgs, buildGrid, alphaOf) {
else { show(st.cur, 1); show(st.prev, 1 - k); }
covered[i] = st.cur !== 'open' && k >= 0.999;
});
- const shape = mouthShape(P.ParamMouthOpenY, P.ParamMouthForm, lastShape);
+ const shape = mouthShape(P.mouthOpen, P.mouthForm, lastShape);
lastShape = shape;
const def = shape && MOUTH_SHAPES[shape];
const mt = def && items[def.sprite];
if (mt) {
mt.layer.visible = true;
// fade in right above the threshold so the closed line hands over softly
- mt.layer.alpha = sstep(MOUTH_OPEN_MIN, MOUTH_OPEN_MIN + 0.04, P.ParamMouthOpenY);
+ mt.layer.alpha = sstep(MOUTH_OPEN_MIN, MOUTH_OPEN_MIN + 0.04, P.mouthOpen);
// never squash a drawing below half its height: flatter looked like a blob
- const squash = Math.min(1.1, Math.max(0.5, P.ParamMouthOpenY / def.ref));
+ const squash = Math.min(1.1, Math.max(0.5, P.mouthOpen / def.ref));
place(mt, P, phys, squash, def.width);
}
return { eyes: covered, mouth: shape };
diff --git a/src/editor/Preview.tsx b/src/editor/Preview.tsx
index 2c97fdb..848bb11 100644
--- a/src/editor/Preview.tsx
+++ b/src/editor/Preview.tsx
@@ -5,12 +5,12 @@ import type { Rig } from '../rig/types';
const defaults: Record<string, number> = Object.fromEntries(PARAMS.map(p => [p.id, p.def]));
const sliders = [
- { id: 'ParamAngleX', label: 'Angle X', min: -30, max: 30, def: 0 },
- { id: 'ParamAngleY', label: 'Angle Y', min: -30, max: 30, def: 0 },
- { id: 'ParamAngleZ', label: 'Angle Z', min: -30, max: 30, def: 0 },
+ { id: 'angleX', label: 'Angle X', min: -30, max: 30, def: 0 },
+ { id: 'angleY', label: 'Angle Y', min: -30, max: 30, def: 0 },
+ { id: 'angleZ', label: 'Angle Z', min: -30, max: 30, def: 0 },
{ id: 'EyeOpen', label: 'Eye open', min: 0, max: 1.25, def: 1 },
- { id: 'ParamMouthOpenY', label: 'Mouth open', min: 0, max: 1, def: 0 },
- { id: 'ParamBodyAngleZ', label: 'Body roll', min: -10, max: 10, def: 0 },
+ { id: 'mouthOpen', label: 'Mouth open', min: 0, max: 1, def: 0 },
+ { id: 'bodyAngleZ', label: 'Body roll', min: -10, max: 10, def: 0 },
];
export function Preview({ rig, assets }: { rig: Rig; assets?: Record<string, string> }) {
const canvas = useRef<HTMLCanvasElement>(null);
@@ -62,8 +62,8 @@ export function Preview({ rig, assets }: { rig: Rig; assets?: Record<string, str
if (stress) {
const t = (now - start) / 1000;
value.setParameters({ ...defaults, ...parameters,
- ParamAngleX: Math.sin(t * 2) * 30, ParamAngleY: Math.cos(t * 1.3) * 25,
- ParamAngleZ: Math.sin(t * 1.1) * 25, ParamBodyAngleZ: Math.cos(t * 0.7) * 8 });
+ angleX: Math.sin(t * 2) * 30, angleY: Math.cos(t * 1.3) * 25,
+ angleZ: Math.sin(t * 1.1) * 25, bodyAngleZ: Math.cos(t * 0.7) * 8 });
if (t >= 6) { setStress(false); return; }
}
value.advance(1 / 60);
@@ -86,14 +86,14 @@ export function Preview({ rig, assets }: { rig: Rig; assets?: Record<string, str
{sliders.map(slider => (
<label key={slider.id}>{slider.label}
<input type="range" aria-label={slider.label} min={slider.min} max={slider.max} step="0.05"
- value={parameters[slider.id === 'EyeOpen' ? 'ParamEyeLOpen' : slider.id] ?? slider.def}
+ value={parameters[slider.id === 'EyeOpen' ? 'eyeLOpen' : slider.id] ?? slider.def}
onChange={event => {
const value = Number(event.target.value);
setParameters(current => slider.id === 'EyeOpen'
- ? { ...current, ParamEyeLOpen: value, ParamEyeROpen: value }
+ ? { ...current, eyeLOpen: value, eyeROpen: value }
: { ...current, [slider.id]: value });
}} />
- <output>{(parameters[slider.id === 'EyeOpen' ? 'ParamEyeLOpen' : slider.id] ?? slider.def).toFixed(2)}</output>
+ <output>{(parameters[slider.id === 'EyeOpen' ? 'eyeLOpen' : slider.id] ?? slider.def).toFixed(2)}</output>
</label>
))}
</div>
diff --git a/src/engine/createMeshAvatar.js b/src/engine/createMeshAvatar.js
index a8e96a5..2b67dee 100644
--- a/src/engine/createMeshAvatar.js
+++ b/src/engine/createMeshAvatar.js
@@ -1,5 +1,5 @@
// Mesh avatar engine: turns a pre-split single illustration (see public/avatar/miko-qipao/) into a
-// Live2D-like animated avatar on a WebGL2 canvas. No UI and no framework: the app drives it
+// 2D mesh avatar animated on a WebGL2 canvas. No UI and no framework: the app drives it
// through the small API returned by createMeshAvatar().
import { createRig } from './rig.js';
import { createRenderer } from './renderer.js';
@@ -154,8 +154,8 @@ export async function createMeshAvatarImpl(canvas, options) {
// cut-out lash leaves seams at its edges
const eyeOpenFor = v => (sprites ? 1 : v);
for (const ep of eyeParts) {
- const open = eyeOpenFor(ep.eye === 0 ? P.ParamEyeROpen : P.ParamEyeLOpen);
- const smile = ep.eye === 0 ? P.ParamEyeSmile : (P.eyeSmileL ?? P.ParamEyeSmile);
+ const open = eyeOpenFor(ep.eye === 0 ? P.eyeROpen : P.eyeLOpen);
+ const smile = ep.eye === 0 ? P.eyeSmile : (P.eyeSmileL ?? P.eyeSmile);
ep.layer.alpha = eyePartAlpha(ep.part, open, smile);
const r = ep.mesh.rest, o = ep.mesh.pos;
for (let k = 0; k < ep.W.length; k++) {
@@ -176,11 +176,11 @@ export async function createMeshAvatarImpl(canvas, options) {
const ball = 7; // px of iris travel
R.draw({
eyes: [
- eyeOpenFor(P.ParamEyeROpen), P.ParamEyeSmile, P.ParamEyeBallX * ball, -P.ParamEyeBallY * ball * 0.6,
- eyeOpenFor(P.ParamEyeLOpen), P.eyeSmileL ?? P.ParamEyeSmile, P.ParamEyeBallX * ball * 0.85, -P.ParamEyeBallY * ball * 0.6,
+ eyeOpenFor(P.eyeROpen), P.eyeSmile, P.gazeX * ball, -P.gazeY * ball * 0.6,
+ eyeOpenFor(P.eyeLOpen), P.eyeSmileL ?? P.eyeSmile, P.gazeX * ball * 0.85, -P.gazeY * ball * 0.6,
],
// with sprites the drawn mouths replace the shader-painted one
- mouthOpen: sprites ? 0 : P.ParamMouthOpenY, mouthForm: P.ParamMouthForm, cheek: P.ParamCheek,
+ mouthOpen: sprites ? 0 : P.mouthOpen, mouthForm: P.mouthForm, cheek: P.blush,
showMesh: false, originalAlpha: 0, joints: [],
});
}
diff --git a/src/engine/motion.js b/src/engine/motion.js
index 0f3f005..c80cd15 100644
--- a/src/engine/motion.js
+++ b/src/engine/motion.js
@@ -7,11 +7,11 @@ const ALL_MOTIONS = { ...MOTIONS, ...IDLE_MOTIONS };
// scales the head / body / arm tracks of idle motions (they are authored at full size, so 1)
// (gaze, eyes and brows are left alone)
export const IDLE_GAIN = { amp: 1, stiff: 1.8 };
-const IDLE_SCALED = /^Param(Angle|BodyAngle|ArmAngle|HandAngle)/;
+const IDLE_SCALED = /^(angle|bodyAngle|armAngle|handAngle)/;
// motion tracks that replace the expression (the rest are additive or body targets)
-const FACE_TRACKS = new Set(['eyeOpen', 'eyeOpenL', 'eyeSmileL', 'ParamEyeSmile', 'ParamMouthOpenY',
- 'ParamMouthForm', 'ParamCheek', 'ParamBrowY', 'ParamBrowAngle']);
+const FACE_TRACKS = new Set(['eyeOpen', 'eyeOpenL', 'eyeSmileL', 'eyeSmile', 'mouthOpen',
+ 'mouthForm', 'blush', 'browY', 'browAngle']);
const sstep = (a, b, x) => { const t = Math.min(1, Math.max(0, (x - a) / (b - a))); return t * t * (3 - 2 * t); };
// smooth 1D value noise
@@ -26,18 +26,18 @@ const clamp = (v, a, b) => Math.max(a, Math.min(b, v));
export const EXPRESSIONS = {
normal: { label: 'Neutral', p: {} },
- smile: { label: 'Smile', p: { eyeOpen: 0, ParamEyeSmile: 1, ParamCheek: 0.35, ParamBrowY: 0.2 } },
- shy: { label: 'Blush', p: { eyeOpen: 0.78, ParamEyeSmile: 0.5, ParamCheek: 1, ParamBrowAngle: -0.5, ParamBrowY: -0.1, glance: [0.7, 0.35] } },
- jito: { label: 'Half-lidded', p: { eyeOpen: 0.5, ParamBrowY: -0.5, ParamBrowAngle: 0.6 } },
- surprise: { label: 'Surprise', p: { eyeOpen: 1.22, ParamBrowY: 1, ParamMouthOpenY: 0.6, ParamMouthForm: 0.6 } },
- wink: { label: 'Wink', p: { eyeOpenL: 0, eyeSmileL: 1, ParamCheek: 0.3 } },
+ smile: { label: 'Smile', p: { eyeOpen: 0, eyeSmile: 1, blush: 0.35, browY: 0.2 } },
+ shy: { label: 'Blush', p: { eyeOpen: 0.78, eyeSmile: 0.5, blush: 1, browAngle: -0.5, browY: -0.1, glance: [0.7, 0.35] } },
+ jito: { label: 'Half-lidded', p: { eyeOpen: 0.5, browY: -0.5, browAngle: 0.6 } },
+ surprise: { label: 'Surprise', p: { eyeOpen: 1.22, browY: 1, mouthOpen: 0.6, mouthForm: 0.6 } },
+ wink: { label: 'Wink', p: { eyeOpenL: 0, eyeSmileL: 1, blush: 0.3 } },
// talking faces for AITuber OnAir emotion tags: eyes stay mostly open (closed / ^^ eyes are
// what a single image fakes worst, and they would stay shut for a whole sentence)
- happyTalk: { label: 'happy', p: { eyeOpen: 0.8, ParamEyeSmile: 0.45, ParamCheek: 0.35, ParamBrowY: 0.25, ParamMouthForm: -0.5 } },
- sadTalk: { label: 'sad', p: { eyeOpen: 0.78, ParamBrowAngle: -0.8, ParamBrowY: -0.2, ParamMouthForm: 0.3, glance: [0, -0.35] } },
- angryTalk: { label: 'angry', p: { eyeOpen: 0.72, ParamBrowAngle: 0.85, ParamBrowY: -0.55, ParamMouthForm: 0.2 } },
- surprisedTalk: { label: 'surprised', p: { eyeOpen: 1.18, ParamBrowY: 0.9, ParamMouthForm: 0.9 } },
- relaxedTalk: { label: 'relaxed', p: { eyeOpen: 0.82, ParamEyeSmile: 0.35, ParamCheek: 0.15, ParamBrowY: 0.1 } },
+ happyTalk: { label: 'happy', p: { eyeOpen: 0.8, eyeSmile: 0.45, blush: 0.35, browY: 0.25, mouthForm: -0.5 } },
+ sadTalk: { label: 'sad', p: { eyeOpen: 0.78, browAngle: -0.8, browY: -0.2, mouthForm: 0.3, glance: [0, -0.35] } },
+ angryTalk: { label: 'angry', p: { eyeOpen: 0.72, browAngle: 0.85, browY: -0.55, mouthForm: 0.2 } },
+ surprisedTalk: { label: 'surprised', p: { eyeOpen: 1.18, browY: 0.9, mouthForm: 0.9 } },
+ relaxedTalk: { label: 'relaxed', p: { eyeOpen: 0.82, eyeSmile: 0.35, blush: 0.15, browY: 0.1 } },
};
// emotion tag -> [expression, motion played when the line starts]
@@ -52,10 +52,10 @@ const EMOTIONS = {
// [stiffness, damping ratio] of the parameter smoothing; unlisted params use [120, 0.95]
const SPRINGS = {
- ParamEyeBallX: [260, 0.9], ParamEyeBallY: [260, 0.9],
- ParamAngleX: [55, 0.72], ParamAngleY: [55, 0.72], ParamAngleZ: [45, 0.75],
- ParamBodyAngleX: [14, 0.9], ParamBodyAngleZ: [12, 0.9],
- ParamArmAngle: [20, 0.85], ParamHandAngle: [30, 0.8],
+ gazeX: [260, 0.9], gazeY: [260, 0.9],
+ angleX: [55, 0.72], angleY: [55, 0.72], angleZ: [45, 0.75],
+ bodyAngleX: [14, 0.9], bodyAngleZ: [12, 0.9],
+ armAngle: [20, 0.85], handAngle: [30, 0.8],
};
export class Motion {
@@ -212,13 +212,13 @@ export class Motion {
Object.assign(T, this.manual);
} else if (this.mode === 'auto') {
// wandering plus following the gaze: the eyes jump first, the head turns after them
- T.ParamAngleX = fbm(t * 0.18, 1) * 10 + this.gaze.x * 11;
- T.ParamAngleY = fbm(t * 0.15, 2) * 6 - 1 + this.gaze.y * 7;
- T.ParamAngleZ = fbm(t * 0.12, 3) * 10;
- T.ParamBodyAngleX = fbm(t * 0.1, 4) * 5;
- T.ParamBodyAngleZ = fbm(t * 0.09, 5) * 4;
- T.ParamArmAngle = fbm(t * 0.14, 6) * 5;
- T.ParamHandAngle = fbm(t * 0.21, 7) * 5;
+ T.angleX = fbm(t * 0.18, 1) * 10 + this.gaze.x * 11;
+ T.angleY = fbm(t * 0.15, 2) * 6 - 1 + this.gaze.y * 7;
+ T.angleZ = fbm(t * 0.12, 3) * 10;
+ T.bodyAngleX = fbm(t * 0.1, 4) * 5;
+ T.bodyAngleZ = fbm(t * 0.09, 5) * 4;
+ T.armAngle = fbm(t * 0.14, 6) * 5;
+ T.handAngle = fbm(t * 0.21, 7) * 5;
// glances
if (t > this.gaze.next) {
const r = Math.random();
@@ -226,8 +226,8 @@ export class Motion {
this.gaze.y = r < 0.45 ? 0 : (Math.random() * 2 - 1) * 0.5;
this.gaze.next = t + 0.8 + Math.random() * 2.5;
}
- T.ParamEyeBallX = this.gaze.x + T.ParamAngleX / 60;
- T.ParamEyeBallY = this.gaze.y + T.ParamAngleY / 60;
+ T.gazeX = this.gaze.x + T.angleX / 60;
+ T.gazeY = this.gaze.y + T.angleY / 60;
// occasional finger tapping on the chin
if (t > this.tap.next) { this.tap.until = t + 1.1; this.tap.next = t + 5 + Math.random() * 6; }
// random playback: reactions every ~15-25 s, small idle motions every few seconds in between
@@ -237,9 +237,9 @@ export class Motion {
this.nextAuto = Math.max(this.nextAuto, t + 6);
const g = this.talkGain;
this.talkNod = (this.talkNod ?? 0) + (this.voice * 7 * g - (this.talkNod ?? 0)) * Math.min(1, dt * 6);
- T.ParamAngleY -= this.talkNod;
- T.ParamAngleX += fbm(t * 0.6, 11) * 5 * g;
- T.ParamAngleZ += fbm(t * 0.5, 12) * 4 * g;
+ T.angleY -= this.talkNod;
+ T.angleX += fbm(t * 0.6, 11) * 5 * g;
+ T.angleZ += fbm(t * 0.5, 12) * 4 * g;
}
if (!this.speaking && t > this.emotionUntil) { this.expr = 'normal'; this.emotionUntil = Infinity; }
if (this.speaking) { /* no random playback */ }
@@ -253,17 +253,17 @@ export class Motion {
}
} else if (this.mode === 'mouse' && this.pointer) {
const dx = (this.pointer[0] - this.faceCenter[0]) / 500, dy = (this.pointer[1] - this.faceCenter[1]) / 500;
- T.ParamAngleX = clamp(dx * 30, -30, 30);
- T.ParamAngleY = clamp(-dy * 30, -30, 30);
- T.ParamAngleZ = clamp(-dx * dy * 25, -12, 12);
- T.ParamBodyAngleX = clamp(dx * 10, -10, 10) * 0.6;
- T.ParamEyeBallX = clamp(dx * 1.4, -1, 1);
- T.ParamEyeBallY = clamp(-dy * 1.4, -1, 1);
- T.ParamHandAngle = clamp(dx * 4, -5, 5);
+ T.angleX = clamp(dx * 30, -30, 30);
+ T.angleY = clamp(-dy * 30, -30, 30);
+ T.angleZ = clamp(-dx * dy * 25, -12, 12);
+ T.bodyAngleX = clamp(dx * 10, -10, 10) * 0.6;
+ T.gazeX = clamp(dx * 1.4, -1, 1);
+ T.gazeY = clamp(-dy * 1.4, -1, 1);
+ T.handAngle = clamp(dx * 4, -5, 5);
}
if (this.mode !== 'manual') {
- T.ParamBreath = this.breathValue(dt);
- if (t < this.tap.until) T.ParamFingerTap = Math.max(0, Math.sin((this.tap.until - t) * Math.PI * 3.6)) ** 2;
+ T.breath = this.breathValue(dt);
+ if (t < this.tap.until) T.fingerTap = Math.max(0, Math.sin((this.tap.until - t) * Math.PI * 3.6)) ** 2;
}
// motion: body/head tracks go into the targets, so the springs smooth them too
@@ -279,20 +279,20 @@ export class Motion {
mw = sstep(0, 0.15, this.play.t) * (1 - sstep(def.dur - 0.25, def.dur, this.play.t));
for (const [id, v] of Object.entries(M)) {
if (ADDITIVE.has(id)) T[id] += v;
- else if (id === 'ParamBreath') T[id] += (v - T[id]) * mw; // a motion sets its own breathing
+ else if (id === 'breath') T[id] += (v - T[id]) * mw; // a motion sets its own breathing
else if (!FACE_TRACKS.has(id)) T[id] = Math.max(T[id], Math.max(0, v));
}
}
}
- if (this.mode !== 'manual') T.ParamAngleY += T.ParamBreath * 1.6;
+ if (this.mode !== 'manual') T.angleY += T.breath * 1.6;
// expression layer (smoothed so switching is not a jump)
const E = EXPRESSIONS[this.expr].p;
- const keys = ['eyeOpen', 'eyeOpenL', 'eyeSmileL', 'ParamEyeSmile', 'ParamMouthOpenY', 'ParamMouthForm', 'ParamCheek', 'ParamBrowY', 'ParamBrowAngle', 'gx', 'gy'];
- const target = { eyeOpen: E.eyeOpen ?? 1, eyeOpenL: E.eyeOpenL ?? E.eyeOpen ?? 1, eyeSmileL: E.eyeSmileL ?? E.ParamEyeSmile ?? 0,
- ParamEyeSmile: E.ParamEyeSmile ?? 0, ParamMouthOpenY: E.ParamMouthOpenY ?? 0, ParamMouthForm: E.ParamMouthForm ?? 0,
- ParamCheek: E.ParamCheek ?? 0, ParamBrowY: E.ParamBrowY ?? 0, ParamBrowAngle: E.ParamBrowAngle ?? 0,
+ const keys = ['eyeOpen', 'eyeOpenL', 'eyeSmileL', 'eyeSmile', 'mouthOpen', 'mouthForm', 'blush', 'browY', 'browAngle', 'gx', 'gy'];
+ const target = { eyeOpen: E.eyeOpen ?? 1, eyeOpenL: E.eyeOpenL ?? E.eyeOpen ?? 1, eyeSmileL: E.eyeSmileL ?? E.eyeSmile ?? 0,
+ eyeSmile: E.eyeSmile ?? 0, mouthOpen: E.mouthOpen ?? 0, mouthForm: E.mouthForm ?? 0,
+ blush: E.blush ?? 0, browY: E.browY ?? 0, browAngle: E.browAngle ?? 0,
gx: E.glance?.[0] ?? 0, gy: E.glance?.[1] ?? 0 };
const k = 1 - Math.exp(-dt * 9);
for (const key of keys) {
@@ -311,9 +311,9 @@ export class Motion {
// keyframed motions are already smooth; follow them more tightly than idle wandering
// keyframed motions are followed more tightly than the idle wandering; idle motions a
// bit less so they stay soft but still reach their poses
- if (M && /^ParamAngle|^ParamBody/.test(id)) {
+ if (M && /^angle|^body/.test(id)) {
if (ALL_MOTIONS[this.play?.id ?? '']?.idle) { stiff *= IDLE_GAIN.stiff; zeta = 0.8; }
- else if (/^ParamAngle/.test(id)) { stiff *= 4.5; zeta = 0.75; }
+ else if (/^angle/.test(id)) { stiff *= 4.5; zeta = 0.75; }
}
const damp = 2 * Math.sqrt(stiff) * zeta;
this.vel[id] += (stiff * (T[id] - this.cur[id]) - damp * this.vel[id]) * dt;
@@ -323,38 +323,38 @@ export class Motion {
let blink = 1;
if (this.mode !== 'manual') {
blink = this.blinkValue(dt);
- out.ParamEyeROpen = X.eyeOpen * blink;
- out.ParamEyeLOpen = X.eyeOpenL * blink;
- out.ParamEyeSmile = X.ParamEyeSmile;
+ out.eyeROpen = X.eyeOpen * blink;
+ out.eyeLOpen = X.eyeOpenL * blink;
+ out.eyeSmile = X.eyeSmile;
out.eyeSmileL = X.eyeSmileL;
- out.ParamMouthOpenY = X.ParamMouthOpenY;
- out.ParamMouthForm = X.ParamMouthForm;
- out.ParamCheek = X.ParamCheek;
+ out.mouthOpen = X.mouthOpen;
+ out.mouthForm = X.mouthForm;
+ out.blush = X.blush;
// brows dip a little with each blink and lift when looking up
- out.ParamBrowY = X.ParamBrowY + (out.ParamAngleY > 0 ? out.ParamAngleY / 60 : 0) - (1 - blink) * 0.18;
- out.ParamBrowAngle = X.ParamBrowAngle;
- out.ParamEyeBallX = clamp(out.ParamEyeBallX + X.gx, -1, 1);
- out.ParamEyeBallY = clamp(out.ParamEyeBallY + X.gy, -1, 1);
+ out.browY = X.browY + (out.angleY > 0 ? out.angleY / 60 : 0) - (1 - blink) * 0.18;
+ out.browAngle = X.browAngle;
+ out.gazeX = clamp(out.gazeX + X.gx, -1, 1);
+ out.gazeY = clamp(out.gazeY + X.gy, -1, 1);
} else {
- out.eyeSmileL = out.ParamEyeSmile;
+ out.eyeSmileL = out.eyeSmile;
}
if (M) {
const mix = (key, v) => { out[key] += (v - out[key]) * mw; };
const clampEye = v => Math.min(1.3, Math.max(0, v));
- if ('eyeOpen' in M) { mix('ParamEyeROpen', clampEye(M.eyeOpen) * blink); if (!('eyeOpenL' in M)) mix('ParamEyeLOpen', clampEye(M.eyeOpen) * blink); }
- if ('eyeOpenL' in M) mix('ParamEyeLOpen', clampEye(M.eyeOpenL) * blink);
- if ('ParamEyeSmile' in M) { mix('ParamEyeSmile', M.ParamEyeSmile); if (!('eyeSmileL' in M)) mix('eyeSmileL', M.ParamEyeSmile); }
+ if ('eyeOpen' in M) { mix('eyeROpen', clampEye(M.eyeOpen) * blink); if (!('eyeOpenL' in M)) mix('eyeLOpen', clampEye(M.eyeOpen) * blink); }
+ if ('eyeOpenL' in M) mix('eyeLOpen', clampEye(M.eyeOpenL) * blink);
+ if ('eyeSmile' in M) { mix('eyeSmile', M.eyeSmile); if (!('eyeSmileL' in M)) mix('eyeSmileL', M.eyeSmile); }
if ('eyeSmileL' in M) mix('eyeSmileL', M.eyeSmileL);
- for (const id of ['ParamMouthOpenY', 'ParamMouthForm', 'ParamCheek', 'ParamBrowY', 'ParamBrowAngle'])
- if (id in M) mix(id, id === 'ParamMouthOpenY' || id === 'ParamCheek' ? Math.max(0, M[id]) : M[id]);
+ for (const id of ['mouthOpen', 'mouthForm', 'blush', 'browY', 'browAngle'])
+ if (id in M) mix(id, id === 'mouthOpen' || id === 'blush' ? Math.max(0, M[id]) : M[id]);
}
const sm = this.speechMouth(dt);
if (sm) { this.lipOpen = sm[0]; this.lipForm = sm[1]; }
else if (this.lipOpen !== null && !this.speaking && !this.kana) this.lipOpen = null;
if (this.lipOpen !== null) {
- out.ParamMouthOpenY = Math.max(out.ParamMouthOpenY * 0.3, this.lipOpen);
+ out.mouthOpen = Math.max(out.mouthOpen * 0.3, this.lipOpen);
// while talking the voice decides the vowel; the expression's form would shift it
- out.ParamMouthForm = clamp(this.lipForm, -1, 1);
+ out.mouthForm = clamp(this.lipForm, -1, 1);
}
this.P = out;
return out;
diff --git a/src/engine/motions.js b/src/engine/motions.js
index c588ee7..963f7a6 100644
--- a/src/engine/motions.js
+++ b/src/engine/motions.js
@@ -4,340 +4,340 @@
// The result still goes through the parameter springs, which adds follow-through.
export const ADDITIVE = new Set([
- 'ParamAngleX', 'ParamAngleY', 'ParamAngleZ', 'ParamBodyAngleX', 'ParamBodyAngleZ',
- 'ParamArmAngle', 'ParamHandAngle', 'ParamEyeBallX', 'ParamEyeBallY',
+ 'angleX', 'angleY', 'angleZ', 'bodyAngleX', 'bodyAngleZ',
+ 'armAngle', 'handAngle', 'gazeX', 'gazeY',
]);
export const MOTIONS = {
nod: {
label: 'Nod', dur: 1.7,
tracks: {
- ParamAngleY: [[0, 0], [0.32, -13], [0.62, 2], [0.95, -9], [1.3, 1], [1.7, 0]],
- ParamAngleZ: [[0, 0], [0.4, -2], [1.0, -1], [1.7, 0]],
- ParamBodyAngleX: [[0, 0], [0.5, -1.5], [1.7, 0]],
- ParamEyeSmile: [[0, 0], [0.3, 0.45], [1.3, 0.45], [1.7, 0]],
+ angleY: [[0, 0], [0.32, -13], [0.62, 2], [0.95, -9], [1.3, 1], [1.7, 0]],
+ angleZ: [[0, 0], [0.4, -2], [1.0, -1], [1.7, 0]],
+ bodyAngleX: [[0, 0], [0.5, -1.5], [1.7, 0]],
+ eyeSmile: [[0, 0], [0.3, 0.45], [1.3, 0.45], [1.7, 0]],
eyeOpen: [[0, 1], [0.3, 0.72], [1.3, 0.72], [1.7, 1]],
- ParamMouthOpenY: [[0, 0], [0.3, 0.12], [1.3, 0.12], [1.7, 0]],
- ParamMouthForm: [[0, 0], [0.3, -0.6], [1.7, -0.3]],
+ mouthOpen: [[0, 0], [0.3, 0.12], [1.3, 0.12], [1.7, 0]],
+ mouthForm: [[0, 0], [0.3, -0.6], [1.7, -0.3]],
},
},
tilt: {
label: 'Head tilt', dur: 2.6,
tracks: {
- ParamAngleZ: [[0, 0], [0.55, 17], [2.0, 15], [2.6, 0]],
- ParamAngleX: [[0, 0], [0.6, 8], [2.0, 7], [2.6, 0]],
- ParamAngleY: [[0, 0], [0.6, 4], [2.6, 0]],
- ParamBodyAngleZ: [[0, 0], [0.8, 3], [2.0, 3], [2.6, 0]],
- ParamEyeBallX: [[0, 0], [0.4, 0.5], [2.1, 0.4], [2.6, 0]],
- ParamEyeBallY: [[0, 0], [0.4, 0.35], [2.1, 0.3], [2.6, 0]],
- ParamBrowAngle: [[0, 0], [0.5, -0.7], [2.1, -0.6], [2.6, 0]],
- ParamBrowY: [[0, 0], [0.5, 0.35], [2.1, 0.3], [2.6, 0]],
+ angleZ: [[0, 0], [0.55, 17], [2.0, 15], [2.6, 0]],
+ angleX: [[0, 0], [0.6, 8], [2.0, 7], [2.6, 0]],
+ angleY: [[0, 0], [0.6, 4], [2.6, 0]],
+ bodyAngleZ: [[0, 0], [0.8, 3], [2.0, 3], [2.6, 0]],
+ gazeX: [[0, 0], [0.4, 0.5], [2.1, 0.4], [2.6, 0]],
+ gazeY: [[0, 0], [0.4, 0.35], [2.1, 0.3], [2.6, 0]],
+ browAngle: [[0, 0], [0.5, -0.7], [2.1, -0.6], [2.6, 0]],
+ browY: [[0, 0], [0.5, 0.35], [2.1, 0.3], [2.6, 0]],
// closed mouth: a barely open round mouth read as a squashed blob
},
},
think: {
label: 'Thinking', dur: 3.6,
tracks: {
- ParamAngleX: [[0, 0], [0.7, -11], [3.0, -9], [3.6, 0]],
- ParamAngleY: [[0, 0], [0.7, 9], [3.0, 8], [3.6, 0]],
- ParamAngleZ: [[0, 0], [0.8, 6], [3.0, 5], [3.6, 0]],
- ParamEyeBallX: [[0, 0], [0.35, -0.8], [3.1, -0.7], [3.6, 0]],
- ParamEyeBallY: [[0, 0], [0.35, 0.7], [3.1, 0.6], [3.6, 0]],
- ParamHandAngle: [[0, 0], [0.6, 3], [3.0, 3], [3.6, 0]],
- ParamFingerTap: [[0, 0], [0.9, 0], [1.05, 1], [1.2, 0], [1.4, 1], [1.55, 0], [1.75, 1], [1.9, 0],
+ angleX: [[0, 0], [0.7, -11], [3.0, -9], [3.6, 0]],
+ angleY: [[0, 0], [0.7, 9], [3.0, 8], [3.6, 0]],
+ angleZ: [[0, 0], [0.8, 6], [3.0, 5], [3.6, 0]],
+ gazeX: [[0, 0], [0.35, -0.8], [3.1, -0.7], [3.6, 0]],
+ gazeY: [[0, 0], [0.35, 0.7], [3.1, 0.6], [3.6, 0]],
+ handAngle: [[0, 0], [0.6, 3], [3.0, 3], [3.6, 0]],
+ fingerTap: [[0, 0], [0.9, 0], [1.05, 1], [1.2, 0], [1.4, 1], [1.55, 0], [1.75, 1], [1.9, 0],
[2.3, 0], [2.45, 1], [2.6, 0], [3.6, 0]],
- ParamBrowY: [[0, 0], [0.6, 0.25], [3.0, 0.2], [3.6, 0]],
- ParamBrowAngle: [[0, 0], [0.6, -0.3], [3.0, -0.3], [3.6, 0]],
- ParamMouthForm: [[0, 0], [0.6, 0.4], [3.6, 0]],
+ browY: [[0, 0], [0.6, 0.25], [3.0, 0.2], [3.6, 0]],
+ browAngle: [[0, 0], [0.6, -0.3], [3.0, -0.3], [3.6, 0]],
+ mouthForm: [[0, 0], [0.6, 0.4], [3.6, 0]],
},
},
giggle: {
label: 'Chuckle', dur: 2.2,
tracks: {
eyeOpen: [[0, 1], [0.2, 0], [1.8, 0], [2.2, 1]],
- ParamEyeSmile: [[0, 0], [0.2, 1], [1.8, 1], [2.2, 0]],
- ParamMouthOpenY: [[0, 0], [0.2, 0.5], [0.45, 0.32], [0.7, 0.55], [0.95, 0.34], [1.2, 0.5], [1.8, 0.3], [2.1, 0]],
- ParamMouthForm: [[0, 0], [0.2, -0.8], [2.2, -0.2]],
- ParamCheek: [[0, 0], [0.3, 0.7], [1.8, 0.7], [2.2, 0.1]],
- ParamAngleY: [[0, 0], [0.2, -5], [0.45, -1], [0.7, -6], [0.95, -2], [1.2, -5], [1.6, -2], [2.2, 0]],
- ParamAngleZ: [[0, 0], [0.3, -6], [1.8, -5], [2.2, 0]],
- ParamBodyAngleZ: [[0, 0], [0.25, 2], [0.5, -1], [0.75, 2], [1.0, -1], [1.3, 1.5], [2.2, 0]],
- ParamBrowY: [[0, 0], [0.3, 0.3], [1.8, 0.3], [2.2, 0]],
+ eyeSmile: [[0, 0], [0.2, 1], [1.8, 1], [2.2, 0]],
+ mouthOpen: [[0, 0], [0.2, 0.5], [0.45, 0.32], [0.7, 0.55], [0.95, 0.34], [1.2, 0.5], [1.8, 0.3], [2.1, 0]],
+ mouthForm: [[0, 0], [0.2, -0.8], [2.2, -0.2]],
+ blush: [[0, 0], [0.3, 0.7], [1.8, 0.7], [2.2, 0.1]],
+ angleY: [[0, 0], [0.2, -5], [0.45, -1], [0.7, -6], [0.95, -2], [1.2, -5], [1.6, -2], [2.2, 0]],
+ angleZ: [[0, 0], [0.3, -6], [1.8, -5], [2.2, 0]],
+ bodyAngleZ: [[0, 0], [0.25, 2], [0.5, -1], [0.75, 2], [1.0, -1], [1.3, 1.5], [2.2, 0]],
+ browY: [[0, 0], [0.3, 0.3], [1.8, 0.3], [2.2, 0]],
},
},
surprise: {
label: 'Surprise', dur: 2.0,
tracks: {
- ParamAngleY: [[0, 0], [0.12, 10], [0.5, 6], [1.5, 5], [2.0, 0]],
- ParamAngleX: [[0, 0], [0.12, -4], [2.0, 0]],
- ParamBodyAngleX: [[0, 0], [0.15, -4], [1.5, -3], [2.0, 0]],
+ angleY: [[0, 0], [0.12, 10], [0.5, 6], [1.5, 5], [2.0, 0]],
+ angleX: [[0, 0], [0.12, -4], [2.0, 0]],
+ bodyAngleX: [[0, 0], [0.15, -4], [1.5, -3], [2.0, 0]],
eyeOpen: [[0, 1], [0.1, 1.25], [1.5, 1.2], [2.0, 1]],
- ParamBrowY: [[0, 0], [0.1, 1], [1.5, 0.9], [2.0, 0]],
- ParamMouthOpenY: [[0, 0], [0.12, 0.6], [1.4, 0.45], [2.0, 0]],
- ParamMouthForm: [[0, 0], [0.12, 0.6], [1.5, 0.55], [2.0, 0]], // o
- ParamArmAngle: [[0, 0], [0.15, -4], [1.5, -3], [2.0, 0]],
+ browY: [[0, 0], [0.1, 1], [1.5, 0.9], [2.0, 0]],
+ mouthOpen: [[0, 0], [0.12, 0.6], [1.4, 0.45], [2.0, 0]],
+ mouthForm: [[0, 0], [0.12, 0.6], [1.5, 0.55], [2.0, 0]], // o
+ armAngle: [[0, 0], [0.15, -4], [1.5, -3], [2.0, 0]],
},
},
shy: {
label: 'Shy', dur: 3.2,
tracks: {
- ParamAngleX: [[0, 0], [0.6, 14], [2.6, 12], [3.2, 0]],
- ParamAngleY: [[0, 0], [0.6, -9], [2.6, -8], [3.2, 0]],
- ParamAngleZ: [[0, 0], [0.7, -8], [2.6, -7], [3.2, 0]],
- ParamEyeBallX: [[0, 0], [0.3, 0.8], [1.6, 0.8], [1.9, -0.3], [2.2, 0.8], [2.8, 0.6], [3.2, 0]],
- ParamEyeBallY: [[0, 0], [0.3, -0.5], [2.8, -0.4], [3.2, 0]],
+ angleX: [[0, 0], [0.6, 14], [2.6, 12], [3.2, 0]],
+ angleY: [[0, 0], [0.6, -9], [2.6, -8], [3.2, 0]],
+ angleZ: [[0, 0], [0.7, -8], [2.6, -7], [3.2, 0]],
+ gazeX: [[0, 0], [0.3, 0.8], [1.6, 0.8], [1.9, -0.3], [2.2, 0.8], [2.8, 0.6], [3.2, 0]],
+ gazeY: [[0, 0], [0.3, -0.5], [2.8, -0.4], [3.2, 0]],
eyeOpen: [[0, 1], [0.5, 0.75], [2.7, 0.75], [3.2, 1]],
- ParamEyeSmile: [[0, 0], [0.5, 0.5], [2.7, 0.5], [3.2, 0]],
- ParamCheek: [[0, 0], [0.8, 1], [2.7, 1], [3.2, 0]],
- ParamBrowAngle: [[0, 0], [0.5, -0.6], [2.7, -0.5], [3.2, 0]],
- ParamMouthForm: [[0, 0], [0.5, -0.4], [3.2, 0]],
- ParamHandAngle: [[0, 0], [0.8, 4], [2.6, 4], [3.2, 0]],
+ eyeSmile: [[0, 0], [0.5, 0.5], [2.7, 0.5], [3.2, 0]],
+ blush: [[0, 0], [0.8, 1], [2.7, 1], [3.2, 0]],
+ browAngle: [[0, 0], [0.5, -0.6], [2.7, -0.5], [3.2, 0]],
+ mouthForm: [[0, 0], [0.5, -0.4], [3.2, 0]],
+ handAngle: [[0, 0], [0.8, 4], [2.6, 4], [3.2, 0]],
},
},
no: {
label: 'Shake head', dur: 1.9,
tracks: {
- ParamAngleX: [[0, 0], [0.2, 13], [0.45, -13], [0.7, 12], [0.95, -10], [1.2, 5], [1.5, 0]],
- ParamAngleY: [[0, 0], [0.2, -3], [1.3, -3], [1.9, 0]],
- ParamBodyAngleX: [[0, 0], [0.3, 1.5], [0.6, -1.5], [0.9, 1], [1.3, 0]],
+ angleX: [[0, 0], [0.2, 13], [0.45, -13], [0.7, 12], [0.95, -10], [1.2, 5], [1.5, 0]],
+ angleY: [[0, 0], [0.2, -3], [1.3, -3], [1.9, 0]],
+ bodyAngleX: [[0, 0], [0.3, 1.5], [0.6, -1.5], [0.9, 1], [1.3, 0]],
eyeOpen: [[0, 1], [0.15, 0], [1.4, 0], [1.9, 1]],
- ParamEyeSmile: [[0, 0], [0.15, 1], [1.4, 1], [1.9, 0]],
+ eyeSmile: [[0, 0], [0.15, 1], [1.4, 1], [1.9, 0]],
// closed mouth while shaking the head
- ParamBrowAngle: [[0, 0], [0.2, -0.5], [1.4, -0.5], [1.9, 0]],
+ browAngle: [[0, 0], [0.2, -0.5], [1.4, -0.5], [1.9, 0]],
},
},
wink: {
label: 'Wink', dur: 2.0,
tracks: {
- ParamAngleZ: [[0, 0], [0.35, -13], [1.5, -12], [2.0, 0]],
- ParamAngleX: [[0, 0], [0.35, 9], [1.5, 8], [2.0, 0]],
- ParamBodyAngleZ: [[0, 0], [0.5, -2], [1.5, -2], [2.0, 0]],
+ angleZ: [[0, 0], [0.35, -13], [1.5, -12], [2.0, 0]],
+ angleX: [[0, 0], [0.35, 9], [1.5, 8], [2.0, 0]],
+ bodyAngleZ: [[0, 0], [0.5, -2], [1.5, -2], [2.0, 0]],
eyeOpenL: [[0, 1], [0.25, 1], [0.4, 0], [1.4, 0], [1.6, 1]],
eyeSmileL: [[0, 0], [0.3, 1], [1.5, 1], [1.7, 0]],
- ParamMouthOpenY: [[0, 0], [2.0, 0]], // wink with a closed smile
- ParamMouthForm: [[0, 0], [0.35, -0.8], [2.0, 0]],
- ParamCheek: [[0, 0], [0.4, 0.5], [1.6, 0.5], [2.0, 0]],
+ mouthOpen: [[0, 0], [2.0, 0]], // wink with a closed smile
+ mouthForm: [[0, 0], [0.35, -0.8], [2.0, 0]],
+ blush: [[0, 0], [0.4, 0.5], [1.6, 0.5], [2.0, 0]],
},
},
greet: {
label: 'Greeting', dur: 2.6,
tracks: {
- ParamAngleY: [[0, 0], [0.7, -18], [1.2, -17], [1.9, 2], [2.6, 0]],
- ParamBodyAngleX: [[0, 0], [0.8, 2], [1.8, 0]],
- ParamBodyAngleZ: [[0, 0], [0.8, 1.5], [2.0, 0]],
- ParamArmAngle: [[0, 0], [0.8, 3], [2.0, 0]],
+ angleY: [[0, 0], [0.7, -18], [1.2, -17], [1.9, 2], [2.6, 0]],
+ bodyAngleX: [[0, 0], [0.8, 2], [1.8, 0]],
+ bodyAngleZ: [[0, 0], [0.8, 1.5], [2.0, 0]],
+ armAngle: [[0, 0], [0.8, 3], [2.0, 0]],
eyeOpen: [[0, 1], [0.5, 0], [1.4, 0], [1.8, 1]],
- ParamEyeSmile: [[0, 0], [0.5, 1], [1.6, 1], [2.3, 0.4], [2.6, 0]],
- ParamMouthOpenY: [[0, 0], [1.6, 0], [1.8, 0.3], [2.3, 0.2], [2.6, 0]],
- ParamMouthForm: [[0, 0], [1.6, -0.8], [2.6, -0.3]],
- ParamCheek: [[0, 0], [1.6, 0.3], [2.6, 0]],
+ eyeSmile: [[0, 0], [0.5, 1], [1.6, 1], [2.3, 0.4], [2.6, 0]],
+ mouthOpen: [[0, 0], [1.6, 0], [1.8, 0.3], [2.3, 0.2], [2.6, 0]],
+ mouthForm: [[0, 0], [1.6, -0.8], [2.6, -0.3]],
+ blush: [[0, 0], [1.6, 0.3], [2.6, 0]],
},
},
};
// Idle motions: every one moves several parameters at once (breath, head, body, arm,
-// gaze, lids, brows) so the whole figure takes part, like a Live2D idle.
+// gaze, lids, brows) so the whole figure takes part, like a 2D mesh avatar idle.
// Eyes only go down to ~0.55 open and the mouth stays shut (a single image fakes those worst).
-// ParamBreath tracks replace the automatic breathing while the motion plays.
+// breath tracks replace the automatic breathing while the motion plays.
export const IDLE_MOTIONS = {
lookAround: {
label: 'Look around', dur: 5.2, idle: true,
tracks: {
- ParamEyeBallX: [[0, 0], [0.25, -0.85], [1.5, -0.8], [1.8, 0.1], [2.1, 0.85], [3.4, 0.8], [3.7, 0], [5.2, 0]],
- ParamEyeBallY: [[0, 0], [0.25, 0.15], [1.8, 0.25], [2.1, 0.1], [3.7, 0], [5.2, 0]],
- ParamAngleX: [[0, 0], [0.7, -20], [1.6, -18], [2.5, 19], [3.5, 17], [4.4, 0], [5.2, 0]],
- ParamAngleY: [[0, 0], [0.7, 3], [1.8, 5], [2.5, 3], [4.4, 0]],
- ParamAngleZ: [[0, 0], [0.8, 4], [1.8, 0], [2.6, -4], [4.4, 0]],
- ParamBodyAngleX: [[0, 0], [1.0, -4], [2.8, 4], [4.6, 0]],
- ParamBodyAngleZ: [[0, 0], [1.0, 1.5], [2.8, -1.5], [4.6, 0]],
- ParamHandAngle: [[0, 0], [1.0, -2], [2.8, 2], [4.6, 0]],
- ParamBrowY: [[0, 0], [0.5, 0.35], [3.6, 0.3], [4.4, 0]],
+ gazeX: [[0, 0], [0.25, -0.85], [1.5, -0.8], [1.8, 0.1], [2.1, 0.85], [3.4, 0.8], [3.7, 0], [5.2, 0]],
+ gazeY: [[0, 0], [0.25, 0.15], [1.8, 0.25], [2.1, 0.1], [3.7, 0], [5.2, 0]],
+ angleX: [[0, 0], [0.7, -20], [1.6, -18], [2.5, 19], [3.5, 17], [4.4, 0], [5.2, 0]],
+ angleY: [[0, 0], [0.7, 3], [1.8, 5], [2.5, 3], [4.4, 0]],
+ angleZ: [[0, 0], [0.8, 4], [1.8, 0], [2.6, -4], [4.4, 0]],
+ bodyAngleX: [[0, 0], [1.0, -4], [2.8, 4], [4.6, 0]],
+ bodyAngleZ: [[0, 0], [1.0, 1.5], [2.8, -1.5], [4.6, 0]],
+ handAngle: [[0, 0], [1.0, -2], [2.8, 2], [4.6, 0]],
+ browY: [[0, 0], [0.5, 0.35], [3.6, 0.3], [4.4, 0]],
// curious: a quick inhale, held while looking, let out at the end
- ParamBreath: [[0, 0.2], [0.6, 0.85], [3.6, 0.7], [4.6, 0], [5.2, 0.1]],
+ breath: [[0, 0.2], [0.6, 0.85], [3.6, 0.7], [4.6, 0], [5.2, 0.1]],
},
},
glance: {
label: 'Side glance', dur: 4.6, idle: true,
tracks: {
- ParamEyeBallX: [[0, 0], [0.18, 0.9], [2.6, 0.85], [2.9, 0.15], [3.2, 0], [4.6, 0]],
- ParamEyeBallY: [[0, 0], [0.18, 0.4], [2.6, 0.35], [3.2, 0]],
- ParamAngleX: [[0, 0], [0.6, 13], [2.6, 11], [3.6, 0]],
- ParamAngleY: [[0, 0], [0.6, 6], [2.6, 5], [3.6, 0]],
- ParamAngleZ: [[0, 0], [0.7, -5], [2.6, -4], [3.6, 0]],
- ParamBodyAngleX: [[0, 0], [1.0, 2.5], [2.8, 2], [4.0, 0]],
+ gazeX: [[0, 0], [0.18, 0.9], [2.6, 0.85], [2.9, 0.15], [3.2, 0], [4.6, 0]],
+ gazeY: [[0, 0], [0.18, 0.4], [2.6, 0.35], [3.2, 0]],
+ angleX: [[0, 0], [0.6, 13], [2.6, 11], [3.6, 0]],
+ angleY: [[0, 0], [0.6, 6], [2.6, 5], [3.6, 0]],
+ angleZ: [[0, 0], [0.7, -5], [2.6, -4], [3.6, 0]],
+ bodyAngleX: [[0, 0], [1.0, 2.5], [2.8, 2], [4.0, 0]],
eyeOpen: [[0, 1], [0.3, 1.06], [2.5, 1.05], [2.8, 0.85], [3.4, 1]],
- ParamBrowY: [[0, 0], [0.4, 0.4], [2.5, 0.35], [3.4, 0]],
- ParamBrowAngle: [[0, 0], [0.4, -0.2], [2.5, -0.2], [3.4, 0]],
- ParamBreath: [[0, 0], [0.5, 0.6], [2.6, 0.55], [3.8, 0], [4.6, 0.3]],
+ browY: [[0, 0], [0.4, 0.4], [2.5, 0.35], [3.4, 0]],
+ browAngle: [[0, 0], [0.4, -0.2], [2.5, -0.2], [3.4, 0]],
+ breath: [[0, 0], [0.5, 0.6], [2.6, 0.55], [3.8, 0], [4.6, 0.3]],
},
},
sway: {
label: 'Sway', dur: 7.0, idle: true,
tracks: {
- ParamBodyAngleZ: [[0, 0], [1.6, 6], [3.4, -6], [5.2, 5], [7.0, 0]],
- ParamBodyAngleX: [[0, 0], [1.6, 3], [3.4, -3], [5.2, 2.5], [7.0, 0]],
- ParamAngleZ: [[0, 0], [1.8, -10], [3.6, 10], [5.4, -8], [7.0, 0]],
- ParamAngleX: [[0, 0], [1.8, 6], [3.6, -6], [5.4, 5], [7.0, 0]],
- ParamAngleY: [[0, 0], [0.9, 3], [1.8, 0], [2.7, 3], [3.6, 0], [4.5, 3], [5.4, 0], [7.0, 0]],
- ParamArmAngle: [[0, 0], [1.6, 3], [3.4, -3], [5.2, 2], [7.0, 0]],
- ParamHandAngle: [[0, 0], [1.8, -4], [3.6, 4], [5.4, -3], [7.0, 0]],
- ParamEyeBallX: [[0, 0], [1.8, -0.3], [3.6, 0.3], [5.4, -0.2], [7.0, 0]],
+ bodyAngleZ: [[0, 0], [1.6, 6], [3.4, -6], [5.2, 5], [7.0, 0]],
+ bodyAngleX: [[0, 0], [1.6, 3], [3.4, -3], [5.2, 2.5], [7.0, 0]],
+ angleZ: [[0, 0], [1.8, -10], [3.6, 10], [5.4, -8], [7.0, 0]],
+ angleX: [[0, 0], [1.8, 6], [3.6, -6], [5.4, 5], [7.0, 0]],
+ angleY: [[0, 0], [0.9, 3], [1.8, 0], [2.7, 3], [3.6, 0], [4.5, 3], [5.4, 0], [7.0, 0]],
+ armAngle: [[0, 0], [1.6, 3], [3.4, -3], [5.2, 2], [7.0, 0]],
+ handAngle: [[0, 0], [1.8, -4], [3.6, 4], [5.4, -3], [7.0, 0]],
+ gazeX: [[0, 0], [1.8, -0.3], [3.6, 0.3], [5.4, -0.2], [7.0, 0]],
eyeOpen: [[0, 1], [0.8, 0.82], [6.2, 0.82], [7.0, 1]],
- ParamEyeSmile: [[0, 0], [0.8, 0.35], [6.2, 0.35], [7.0, 0]],
+ eyeSmile: [[0, 0], [0.8, 0.35], [6.2, 0.35], [7.0, 0]],
// slow, even breaths in time with the sway
- ParamBreath: [[0, 0], [0.9, 1], [1.8, 0], [2.7, 1], [3.6, 0], [4.5, 1], [5.4, 0], [6.3, 0.8], [7.0, 0]],
+ breath: [[0, 0], [0.9, 1], [1.8, 0], [2.7, 1], [3.6, 0], [4.5, 1], [5.4, 0], [6.3, 0.8], [7.0, 0]],
},
},
sigh: {
label: 'Sigh', dur: 5.6, idle: true,
tracks: {
- ParamBreath: [[0, 0], [1.3, 1.25], [1.9, 1.25], [3.6, 0], [5.6, 0]],
- ParamAngleY: [[0, 0], [1.3, 9], [1.9, 9], [3.3, -9], [4.6, -6], [5.6, 0]],
- ParamAngleZ: [[0, 0], [1.3, -3], [3.3, 5], [5.6, 0]],
- ParamBodyAngleX: [[0, 0], [1.3, -2.5], [3.3, 2.5], [5.6, 0]],
- ParamBodyAngleZ: [[0, 0], [1.9, 1], [3.3, -1.5], [5.6, 0]],
- ParamArmAngle: [[0, 0], [1.3, -2.5], [3.3, 2], [5.6, 0]],
- ParamEyeBallY: [[0, 0], [1.2, 0.4], [2.0, 0.3], [3.2, -0.4], [4.8, -0.2], [5.6, 0]],
+ breath: [[0, 0], [1.3, 1.25], [1.9, 1.25], [3.6, 0], [5.6, 0]],
+ angleY: [[0, 0], [1.3, 9], [1.9, 9], [3.3, -9], [4.6, -6], [5.6, 0]],
+ angleZ: [[0, 0], [1.3, -3], [3.3, 5], [5.6, 0]],
+ bodyAngleX: [[0, 0], [1.3, -2.5], [3.3, 2.5], [5.6, 0]],
+ bodyAngleZ: [[0, 0], [1.9, 1], [3.3, -1.5], [5.6, 0]],
+ armAngle: [[0, 0], [1.3, -2.5], [3.3, 2], [5.6, 0]],
+ gazeY: [[0, 0], [1.2, 0.4], [2.0, 0.3], [3.2, -0.4], [4.8, -0.2], [5.6, 0]],
eyeOpen: [[0, 1], [1.0, 0.95], [1.9, 0.6], [3.4, 0.6], [4.6, 0.78], [5.6, 1]],
- ParamBrowY: [[0, 0], [1.3, 0.35], [3.2, -0.2], [5.6, 0]],
- ParamBrowAngle: [[0, 0], [1.9, -0.4], [4.6, -0.35], [5.6, 0]],
+ browY: [[0, 0], [1.3, 0.35], [3.2, -0.2], [5.6, 0]],
+ browAngle: [[0, 0], [1.9, -0.4], [4.6, -0.35], [5.6, 0]],
},
},
doze: {
label: 'Drowsy', dur: 7.2, idle: true,
tracks: {
eyeOpen: [[0, 1], [1.8, 0.78], [3.2, 0.62], [4.5, 0.55], [4.75, 1.1], [5.6, 1.05], [7.2, 1]],
- ParamAngleY: [[0, 0], [1.8, -6], [3.2, -9], [4.5, -17], [4.75, 5], [5.6, 2], [7.2, 0]],
- ParamAngleZ: [[0, 0], [2.0, 4], [4.5, 10], [4.75, -2], [7.2, 0]],
- ParamAngleX: [[0, 0], [4.5, -4], [4.75, 3], [5.4, -6], [6.2, 5], [7.2, 0]],
- ParamBodyAngleZ: [[0, 0], [4.5, 3], [4.8, -2], [7.2, 0]],
- ParamBodyAngleX: [[0, 0], [4.5, 2], [4.8, -1.5], [7.2, 0]],
- ParamArmAngle: [[0, 0], [4.5, 3], [4.8, -2], [7.2, 0]],
- ParamHandAngle: [[0, 0], [4.5, 5], [4.8, -1], [7.2, 0]],
- ParamEyeBallY: [[0, 0], [4.5, -0.4], [4.75, 0.2], [7.2, 0]],
- ParamEyeBallX: [[0, 0], [4.8, 0], [5.3, -0.6], [6.1, 0.6], [6.8, 0]],
- ParamBrowY: [[0, 0], [4.5, -0.35], [4.75, 0.8], [5.8, 0.3], [7.2, 0]],
+ angleY: [[0, 0], [1.8, -6], [3.2, -9], [4.5, -17], [4.75, 5], [5.6, 2], [7.2, 0]],
+ angleZ: [[0, 0], [2.0, 4], [4.5, 10], [4.75, -2], [7.2, 0]],
+ angleX: [[0, 0], [4.5, -4], [4.75, 3], [5.4, -6], [6.2, 5], [7.2, 0]],
+ bodyAngleZ: [[0, 0], [4.5, 3], [4.8, -2], [7.2, 0]],
+ bodyAngleX: [[0, 0], [4.5, 2], [4.8, -1.5], [7.2, 0]],
+ armAngle: [[0, 0], [4.5, 3], [4.8, -2], [7.2, 0]],
+ handAngle: [[0, 0], [4.5, 5], [4.8, -1], [7.2, 0]],
+ gazeY: [[0, 0], [4.5, -0.4], [4.75, 0.2], [7.2, 0]],
+ gazeX: [[0, 0], [4.8, 0], [5.3, -0.6], [6.1, 0.6], [6.8, 0]],
+ browY: [[0, 0], [4.5, -0.35], [4.75, 0.8], [5.8, 0.3], [7.2, 0]],
// long, slow, deepening breaths; a sharp inhale on waking
- ParamBreath: [[0, 0], [1.1, 0.7], [2.6, 0], [3.8, 0.6], [4.5, 0.2], [4.8, 1.1], [6.0, 0.2], [7.2, 0]],
+ breath: [[0, 0], [1.1, 0.7], [2.6, 0], [3.8, 0.6], [4.5, 0.2], [4.8, 1.1], [6.0, 0.2], [7.2, 0]],
},
},
stretch: {
label: 'Stretch', dur: 6.2, idle: true,
tracks: {
- ParamAngleZ: [[0, 0], [1.3, -22], [2.3, -21], [3.8, 20], [4.8, 19], [6.2, 0]],
- ParamAngleY: [[0, 0], [1.3, 5], [2.3, 7], [3.1, -3], [3.8, 5], [4.8, 6], [6.2, 0]],
- ParamAngleX: [[0, 0], [1.3, -5], [3.8, 5], [6.2, 0]],
- ParamBodyAngleZ: [[0, 0], [1.3, 4], [3.8, -4], [6.2, 0]],
- ParamBodyAngleX: [[0, 0], [1.3, -2], [3.8, 2], [6.2, 0]],
- ParamArmAngle: [[0, 0], [1.3, 2], [3.8, -2], [6.2, 0]],
+ angleZ: [[0, 0], [1.3, -22], [2.3, -21], [3.8, 20], [4.8, 19], [6.2, 0]],
+ angleY: [[0, 0], [1.3, 5], [2.3, 7], [3.1, -3], [3.8, 5], [4.8, 6], [6.2, 0]],
+ angleX: [[0, 0], [1.3, -5], [3.8, 5], [6.2, 0]],
+ bodyAngleZ: [[0, 0], [1.3, 4], [3.8, -4], [6.2, 0]],
+ bodyAngleX: [[0, 0], [1.3, -2], [3.8, 2], [6.2, 0]],
+ armAngle: [[0, 0], [1.3, 2], [3.8, -2], [6.2, 0]],
eyeOpen: [[0, 1], [0.8, 0.62], [4.9, 0.62], [5.6, 1]],
- ParamBrowAngle: [[0, 0], [1.0, -0.3], [4.9, -0.3], [5.8, 0]],
- ParamBreath: [[0, 0], [1.3, 1.1], [2.3, 0.9], [3.1, 0.2], [3.8, 1.1], [4.8, 0.9], [6.2, 0]],
+ browAngle: [[0, 0], [1.0, -0.3], [4.9, -0.3], [5.8, 0]],
+ breath: [[0, 0], [1.3, 1.1], [2.3, 0.9], [3.1, 0.2], [3.8, 1.1], [4.8, 0.9], [6.2, 0]],
},
},
lean: {
label: 'Peek', dur: 4.8, idle: true,
tracks: {
- ParamBodyAngleX: [[0, 0], [0.9, 6], [3.4, 6], [4.4, 0]],
- ParamBodyAngleZ: [[0, 0], [0.9, -3], [3.4, -3], [4.4, 0]],
- ParamAngleX: [[0, 0], [0.9, 9], [2.0, 7], [2.6, 10], [3.4, 8], [4.4, 0]],
- ParamAngleY: [[0, 0], [0.9, -6], [3.4, -5], [4.4, 0]],
- ParamAngleZ: [[0, 0], [0.9, 10], [2.2, 12], [3.4, 9], [4.4, 0]],
- ParamArmAngle: [[0, 0], [0.9, -3], [3.4, -3], [4.4, 0]],
- ParamHandAngle: [[0, 0], [0.9, 3], [3.4, 3], [4.4, 0]],
- ParamEyeBallY: [[0, 0], [0.6, 0.45], [3.4, 0.4], [4.2, 0]],
- ParamEyeBallX: [[0, 0], [1.5, 0], [1.8, -0.3], [2.3, 0.2], [2.8, 0], [4.2, 0]],
+ bodyAngleX: [[0, 0], [0.9, 6], [3.4, 6], [4.4, 0]],
+ bodyAngleZ: [[0, 0], [0.9, -3], [3.4, -3], [4.4, 0]],
+ angleX: [[0, 0], [0.9, 9], [2.0, 7], [2.6, 10], [3.4, 8], [4.4, 0]],
+ angleY: [[0, 0], [0.9, -6], [3.4, -5], [4.4, 0]],
+ angleZ: [[0, 0], [0.9, 10], [2.2, 12], [3.4, 9], [4.4, 0]],
+ armAngle: [[0, 0], [0.9, -3], [3.4, -3], [4.4, 0]],
+ handAngle: [[0, 0], [0.9, 3], [3.4, 3], [4.4, 0]],
+ gazeY: [[0, 0], [0.6, 0.45], [3.4, 0.4], [4.2, 0]],
+ gazeX: [[0, 0], [1.5, 0], [1.8, -0.3], [2.3, 0.2], [2.8, 0], [4.2, 0]],
eyeOpen: [[0, 1], [0.6, 1.1], [3.4, 1.08], [4.2, 1]],
- ParamBrowY: [[0, 0], [0.6, 0.45], [3.4, 0.4], [4.2, 0]],
- ParamBrowAngle: [[0, 0], [0.6, -0.3], [3.4, -0.3], [4.2, 0]],
- ParamCheek: [[0, 0], [1.2, 0.25], [3.4, 0.25], [4.4, 0]],
- ParamBreath: [[0, 0], [0.8, 0.8], [3.4, 0.6], [4.4, 0], [4.8, 0.2]],
+ browY: [[0, 0], [0.6, 0.45], [3.4, 0.4], [4.2, 0]],
+ browAngle: [[0, 0], [0.6, -0.3], [3.4, -0.3], [4.2, 0]],
+ blush: [[0, 0], [1.2, 0.25], [3.4, 0.25], [4.4, 0]],
+ breath: [[0, 0], [0.8, 0.8], [3.4, 0.6], [4.4, 0], [4.8, 0.2]],
},
},
hum: {
label: 'Listen', dur: 5.6, idle: true,
tracks: {
- ParamAngleY: [[0, 0], [0.45, -5], [0.9, 2], [1.35, -5], [1.8, 2], [2.25, -5], [2.7, 2], [3.15, -5], [3.6, 2], [4.05, -4], [4.8, 0]],
- ParamAngleZ: [[0, 0], [0.9, 8], [1.8, -8], [2.7, 8], [3.6, -8], [4.6, 0]],
- ParamAngleX: [[0, 0], [0.9, 4], [1.8, -4], [2.7, 4], [3.6, -4], [4.6, 0]],
- ParamBodyAngleZ: [[0, 0], [0.9, -3], [1.8, 3], [2.7, -3], [3.6, 3], [4.6, 0]],
- ParamBodyAngleX: [[0, 0], [1.8, 2], [3.6, -2], [4.8, 0]],
- ParamHandAngle: [[0, 0], [0.9, 3], [1.8, -3], [2.7, 3], [3.6, -3], [4.6, 0]],
- ParamFingerTap: [[0, 0], [0.45, 1], [0.9, 0], [1.35, 1], [1.8, 0], [2.25, 1], [2.7, 0], [3.15, 1], [3.6, 0], [5.6, 0]],
- ParamEyeBallX: [[0, 0], [0.9, 0.3], [1.8, -0.3], [2.7, 0.3], [3.6, -0.3], [4.6, 0]],
+ angleY: [[0, 0], [0.45, -5], [0.9, 2], [1.35, -5], [1.8, 2], [2.25, -5], [2.7, 2], [3.15, -5], [3.6, 2], [4.05, -4], [4.8, 0]],
+ angleZ: [[0, 0], [0.9, 8], [1.8, -8], [2.7, 8], [3.6, -8], [4.6, 0]],
+ angleX: [[0, 0], [0.9, 4], [1.8, -4], [2.7, 4], [3.6, -4], [4.6, 0]],
+ bodyAngleZ: [[0, 0], [0.9, -3], [1.8, 3], [2.7, -3], [3.6, 3], [4.6, 0]],
+ bodyAngleX: [[0, 0], [1.8, 2], [3.6, -2], [4.8, 0]],
+ handAngle: [[0, 0], [0.9, 3], [1.8, -3], [2.7, 3], [3.6, -3], [4.6, 0]],
+ fingerTap: [[0, 0], [0.45, 1], [0.9, 0], [1.35, 1], [1.8, 0], [2.25, 1], [2.7, 0], [3.15, 1], [3.6, 0], [5.6, 0]],
+ gazeX: [[0, 0], [0.9, 0.3], [1.8, -0.3], [2.7, 0.3], [3.6, -0.3], [4.6, 0]],
eyeOpen: [[0, 1], [0.4, 0.72], [4.6, 0.72], [5.3, 1]],
- ParamEyeSmile: [[0, 0], [0.4, 0.55], [4.6, 0.55], [5.3, 0]],
- ParamCheek: [[0, 0], [0.8, 0.3], [4.6, 0.3], [5.6, 0]],
- ParamBrowY: [[0, 0], [0.5, 0.25], [4.6, 0.25], [5.4, 0]],
- ParamBreath: [[0, 0], [0.9, 0.9], [1.8, 0.2], [2.7, 0.9], [3.6, 0.2], [4.6, 0.8], [5.6, 0]],
+ eyeSmile: [[0, 0], [0.4, 0.55], [4.6, 0.55], [5.3, 0]],
+ blush: [[0, 0], [0.8, 0.3], [4.6, 0.3], [5.6, 0]],
+ browY: [[0, 0], [0.5, 0.25], [4.6, 0.25], [5.4, 0]],
+ breath: [[0, 0], [0.9, 0.9], [1.8, 0.2], [2.7, 0.9], [3.6, 0.2], [4.6, 0.8], [5.6, 0]],
},
},
tap: {
label: 'Tap', dur: 5.0, idle: true,
tracks: {
- ParamEyeBallX: [[0, 0], [0.3, -0.6], [2.2, -0.5], [2.5, -0.1], [2.8, -0.6], [4.2, -0.5], [4.7, 0]],
- ParamEyeBallY: [[0, 0], [0.3, 0.55], [4.2, 0.5], [4.7, 0]],
- ParamAngleX: [[0, 0], [0.8, -11], [2.4, -9], [3.0, -12], [4.2, -10], [5.0, 0]],
- ParamAngleY: [[0, 0], [0.8, 8], [4.2, 7], [5.0, 0]],
- ParamAngleZ: [[0, 0], [0.8, 6], [2.4, 4], [3.0, 7], [4.2, 5], [5.0, 0]],
- ParamBodyAngleX: [[0, 0], [1.0, -2], [4.2, -2], [5.0, 0]],
- ParamHandAngle: [[0, 0], [0.8, 3], [4.2, 3], [5.0, 0]],
- ParamFingerTap: [[0, 0], [0.9, 0], [1.05, 1], [1.2, 0], [1.4, 1], [1.55, 0], [1.75, 1], [1.9, 0],
+ gazeX: [[0, 0], [0.3, -0.6], [2.2, -0.5], [2.5, -0.1], [2.8, -0.6], [4.2, -0.5], [4.7, 0]],
+ gazeY: [[0, 0], [0.3, 0.55], [4.2, 0.5], [4.7, 0]],
+ angleX: [[0, 0], [0.8, -11], [2.4, -9], [3.0, -12], [4.2, -10], [5.0, 0]],
+ angleY: [[0, 0], [0.8, 8], [4.2, 7], [5.0, 0]],
+ angleZ: [[0, 0], [0.8, 6], [2.4, 4], [3.0, 7], [4.2, 5], [5.0, 0]],
+ bodyAngleX: [[0, 0], [1.0, -2], [4.2, -2], [5.0, 0]],
+ handAngle: [[0, 0], [0.8, 3], [4.2, 3], [5.0, 0]],
+ fingerTap: [[0, 0], [0.9, 0], [1.05, 1], [1.2, 0], [1.4, 1], [1.55, 0], [1.75, 1], [1.9, 0],
[2.6, 0], [2.75, 1], [2.9, 0], [3.1, 1], [3.25, 0], [5.0, 0]],
- ParamBrowY: [[0, 0], [0.6, 0.3], [4.2, 0.25], [5.0, 0]],
- ParamBrowAngle: [[0, 0], [0.6, -0.35], [4.2, -0.3], [5.0, 0]],
+ browY: [[0, 0], [0.6, 0.3], [4.2, 0.25], [5.0, 0]],
+ browAngle: [[0, 0], [0.6, -0.35], [4.2, -0.3], [5.0, 0]],
eyeOpen: [[0, 1], [0.6, 0.9], [4.2, 0.9], [5.0, 1]],
- ParamBreath: [[0, 0], [0.8, 0.7], [2.2, 0.4], [3.2, 0.8], [4.4, 0], [5.0, 0.2]],
+ breath: [[0, 0], [0.8, 0.7], [2.2, 0.4], [3.2, 0.8], [4.4, 0], [5.0, 0.2]],
},
},
readNote: {
label: 'Read script', dur: 2.6, idle: true,
tracks: {
// a quick look down at the notes on the desk and back to the camera
- ParamEyeBallY: [[0, 0], [0.2, -0.85], [1.5, -0.8], [1.75, 0], [2.6, 0]],
- ParamEyeBallX: [[0, 0], [0.2, -0.15], [1.5, -0.1], [1.75, 0]],
- ParamAngleY: [[0, 0], [0.45, -9], [1.5, -8], [2.0, 1], [2.6, 0]],
- ParamAngleZ: [[0, 0], [0.5, 2], [1.6, 2], [2.6, 0]],
+ gazeY: [[0, 0], [0.2, -0.85], [1.5, -0.8], [1.75, 0], [2.6, 0]],
+ gazeX: [[0, 0], [0.2, -0.15], [1.5, -0.1], [1.75, 0]],
+ angleY: [[0, 0], [0.45, -9], [1.5, -8], [2.0, 1], [2.6, 0]],
+ angleZ: [[0, 0], [0.5, 2], [1.6, 2], [2.6, 0]],
eyeOpen: [[0, 1], [0.3, 0.78], [1.5, 0.78], [1.75, 1]],
- ParamBreath: [[0, 0.3], [0.8, 0.5], [1.8, 0.2], [2.6, 0.4]],
+ breath: [[0, 0.3], [0.8, 0.5], [1.8, 0.2], [2.6, 0.4]],
},
},
waiting: {
label: 'Fidget', dur: 6.4, idle: true,
tracks: {
// shifts her weight, checks the viewer, looks away, shifts back
- ParamBodyAngleZ: [[0, 0], [0.9, 5], [2.4, 4], [3.3, -5], [5.2, -4], [6.4, 0]],
- ParamBodyAngleX: [[0, 0], [0.9, 3], [3.3, -3], [5.2, -2], [6.4, 0]],
- ParamAngleZ: [[0, 0], [1.0, -6], [2.4, -4], [3.4, 6], [5.2, 5], [6.4, 0]],
- ParamAngleX: [[0, 0], [1.2, -8], [2.2, 2], [3.6, 12], [5.0, 10], [6.2, 0]],
- ParamAngleY: [[0, 0], [1.2, -3], [2.2, 2], [3.6, -2], [6.2, 0]],
- ParamArmAngle: [[0, 0], [0.9, 3], [3.3, -3], [5.2, -2], [6.4, 0]],
- ParamHandAngle: [[0, 0], [1.2, 3], [3.4, -3], [6.4, 0]],
- ParamFingerTap: [[0, 0], [4.2, 0], [4.35, 1], [4.5, 0], [4.7, 1], [4.85, 0], [6.4, 0]],
- ParamEyeBallX: [[0, 0], [0.9, -0.7], [1.9, -0.6], [2.1, 0], [2.7, 0], [2.9, 0.8], [5.0, 0.7], [5.4, 0], [6.4, 0]],
- ParamEyeBallY: [[0, 0], [0.9, -0.2], [2.1, 0], [2.9, 0.3], [5.4, 0]],
+ bodyAngleZ: [[0, 0], [0.9, 5], [2.4, 4], [3.3, -5], [5.2, -4], [6.4, 0]],
+ bodyAngleX: [[0, 0], [0.9, 3], [3.3, -3], [5.2, -2], [6.4, 0]],
+ angleZ: [[0, 0], [1.0, -6], [2.4, -4], [3.4, 6], [5.2, 5], [6.4, 0]],
+ angleX: [[0, 0], [1.2, -8], [2.2, 2], [3.6, 12], [5.0, 10], [6.2, 0]],
+ angleY: [[0, 0], [1.2, -3], [2.2, 2], [3.6, -2], [6.2, 0]],
+ armAngle: [[0, 0], [0.9, 3], [3.3, -3], [5.2, -2], [6.4, 0]],
+ handAngle: [[0, 0], [1.2, 3], [3.4, -3], [6.4, 0]],
+ fingerTap: [[0, 0], [4.2, 0], [4.35, 1], [4.5, 0], [4.7, 1], [4.85, 0], [6.4, 0]],
+ gazeX: [[0, 0], [0.9, -0.7], [1.9, -0.6], [2.1, 0], [2.7, 0], [2.9, 0.8], [5.0, 0.7], [5.4, 0], [6.4, 0]],
+ gazeY: [[0, 0], [0.9, -0.2], [2.1, 0], [2.9, 0.3], [5.4, 0]],
eyeOpen: [[0, 1], [2.0, 1], [2.2, 1.06], [2.8, 1.05], [3.1, 0.85], [5.4, 0.85], [6.2, 1]],
- ParamBrowAngle: [[0, 0], [0.9, -0.35], [2.0, -0.35], [2.3, 0], [3.1, -0.4], [5.4, -0.35], [6.4, 0]],
- ParamBrowY: [[0, 0], [2.2, 0.4], [2.8, 0.35], [3.2, 0], [6.4, 0]],
- ParamBreath: [[0, 0.3], [0.9, 0.8], [2.0, 0.3], [2.6, 0.9], [3.4, 0.2], [4.4, 0.8], [5.6, 0], [6.4, 0.2]],
+ browAngle: [[0, 0], [0.9, -0.35], [2.0, -0.35], [2.3, 0], [3.1, -0.4], [5.4, -0.35], [6.4, 0]],
+ browY: [[0, 0], [2.2, 0.4], [2.8, 0.35], [3.2, 0], [6.4, 0]],
+ breath: [[0, 0.3], [0.9, 0.8], [2.0, 0.3], [2.6, 0.9], [3.4, 0.2], [4.4, 0.8], [5.6, 0], [6.4, 0.2]],
},
},
spaceOut: {
label: 'Daydream', dur: 7.4, idle: true,
tracks: {
// gaze drifts up and away, breaths get slow and long, one slow blink
- ParamEyeBallX: [[0, 0], [1.4, -0.55], [4.8, -0.6], [5.6, 0.1], [7.0, 0]],
- ParamEyeBallY: [[0, 0], [1.4, 0.6], [4.8, 0.55], [5.6, 0], [7.0, 0]],
- ParamAngleX: [[0, 0], [2.0, -9], [4.8, -10], [6.0, 2], [7.4, 0]],
- ParamAngleY: [[0, 0], [2.0, 7], [4.8, 8], [6.0, -2], [7.4, 0]],
- ParamAngleZ: [[0, 0], [2.0, 9], [4.8, 11], [6.0, 2], [7.4, 0]],
- ParamBodyAngleZ: [[0, 0], [2.2, 3], [4.8, 3.5], [6.4, 0]],
- ParamBodyAngleX: [[0, 0], [2.2, -2], [4.8, -2], [6.4, 0]],
- ParamHandAngle: [[0, 0], [2.2, 4], [4.8, 5], [6.4, 0]],
- ParamArmAngle: [[0, 0], [2.2, 2], [4.8, 2], [6.4, 0]],
+ gazeX: [[0, 0], [1.4, -0.55], [4.8, -0.6], [5.6, 0.1], [7.0, 0]],
+ gazeY: [[0, 0], [1.4, 0.6], [4.8, 0.55], [5.6, 0], [7.0, 0]],
+ angleX: [[0, 0], [2.0, -9], [4.8, -10], [6.0, 2], [7.4, 0]],
+ angleY: [[0, 0], [2.0, 7], [4.8, 8], [6.0, -2], [7.4, 0]],
+ angleZ: [[0, 0], [2.0, 9], [4.8, 11], [6.0, 2], [7.4, 0]],
+ bodyAngleZ: [[0, 0], [2.2, 3], [4.8, 3.5], [6.4, 0]],
+ bodyAngleX: [[0, 0], [2.2, -2], [4.8, -2], [6.4, 0]],
+ handAngle: [[0, 0], [2.2, 4], [4.8, 5], [6.4, 0]],
+ armAngle: [[0, 0], [2.2, 2], [4.8, 2], [6.4, 0]],
eyeOpen: [[0, 1], [1.4, 0.8], [3.0, 0.8], [3.35, 0.56], [3.8, 0.8], [4.8, 0.8], [5.6, 1.04], [6.4, 1]],
- ParamBrowY: [[0, 0], [1.6, 0.15], [4.8, 0.15], [5.6, 0.35], [6.6, 0]],
- ParamBreath: [[0, 0], [1.6, 0.9], [3.4, 0], [5.0, 0.9], [6.2, 0.1], [7.4, 0]],
+ browY: [[0, 0], [1.6, 0.15], [4.8, 0.15], [5.6, 0.35], [6.6, 0]],
+ breath: [[0, 0], [1.6, 0.9], [3.4, 0], [5.0, 0.9], [6.2, 0.1], [7.4, 0]],
},
},
};
diff --git a/src/engine/physics.js b/src/engine/physics.js
index 97219b6..9051f68 100644
--- a/src/engine/physics.js
+++ b/src/engine/physics.js
@@ -68,7 +68,7 @@ export function createPhysics(engine, rig) {
step(P, dt) {
const sub = Math.max(1, Math.ceil(dt / (1 / 240)));
const h = Math.min(dt, 0.05) / sub;
- const roll = -P.ParamAngleZ / 30 * rig.head.maxRoll - P.ParamBodyAngleZ / 10 * rig.body.maxRoll;
+ const roll = -P.angleZ / 30 * rig.head.maxRoll - P.bodyAngleZ / 10 * rig.body.maxRoll;
const g = this.gain;
STRANDS.forEach((cfg, si) => {
diff --git a/src/engine/rig.js b/src/engine/rig.js
index 431f386..0b0b584 100644
--- a/src/engine/rig.js
+++ b/src/engine/rig.js
@@ -1,23 +1,23 @@
export const PARAMS = [
- { id: 'ParamAngleX', label: 'Face angle X', min: -30, max: 30, def: 0, group: 'Head and body' },
- { id: 'ParamAngleY', label: 'Face angle Y', min: -30, max: 30, def: 0, group: 'Head and body' },
- { id: 'ParamAngleZ', label: 'Face roll', min: -30, max: 30, def: 0, group: 'Head and body' },
- { id: 'ParamBodyAngleX', label: 'Body angle X', min: -10, max: 10, def: 0, group: 'Head and body' },
- { id: 'ParamBodyAngleZ', label: 'Body roll', min: -10, max: 10, def: 0, group: 'Head and body' },
- { id: 'ParamBreath', label: 'Breath', min: 0, max: 1, def: 0, group: 'Head and body' },
- { id: 'ParamEyeLOpen', label: 'Left eye open', min: 0, max: 1.25, def: 1, group: 'Eyes and brows' },
- { id: 'ParamEyeROpen', label: 'Right eye open', min: 0, max: 1.25, def: 1, group: 'Eyes and brows' },
- { id: 'ParamEyeSmile', label: 'Eye smile', min: 0, max: 1, def: 0, group: 'Eyes and brows' },
- { id: 'ParamEyeBallX', label: 'Gaze X', min: -1, max: 1, def: 0, group: 'Eyes and brows' },
- { id: 'ParamEyeBallY', label: 'Gaze Y', min: -1, max: 1, def: 0, group: 'Eyes and brows' },
- { id: 'ParamBrowY', label: 'Brow Y', min: -1, max: 1, def: 0, group: 'Eyes and brows' },
- { id: 'ParamBrowAngle', label: 'Brow angle', min: -1, max: 1, def: 0, group: 'Eyes and brows' },
- { id: 'ParamMouthOpenY', label: 'Mouth open', min: 0, max: 1, def: 0, group: 'Mouth and cheeks' },
- { id: 'ParamMouthForm', label: 'Mouth form (i to o)', min: -1, max: 1, def: 0, group: 'Mouth and cheeks' },
- { id: 'ParamCheek', label: 'Blush', min: 0, max: 1, def: 0, group: 'Mouth and cheeks' },
- { id: 'ParamArmAngle', label: 'Arm angle', min: -10, max: 10, def: 0, group: 'Hand' },
- { id: 'ParamHandAngle', label: 'Wrist angle', min: -10, max: 10, def: 0, group: 'Hand' },
- { id: 'ParamFingerTap', label: 'Finger tap', min: 0, max: 1, def: 0, group: 'Hand' },
+ { id: 'angleX', label: 'Face angle X', min: -30, max: 30, def: 0, group: 'Head and body' },
+ { id: 'angleY', label: 'Face angle Y', min: -30, max: 30, def: 0, group: 'Head and body' },
+ { id: 'angleZ', label: 'Face roll', min: -30, max: 30, def: 0, group: 'Head and body' },
+ { id: 'bodyAngleX', label: 'Body angle X', min: -10, max: 10, def: 0, group: 'Head and body' },
+ { id: 'bodyAngleZ', label: 'Body roll', min: -10, max: 10, def: 0, group: 'Head and body' },
+ { id: 'breath', label: 'Breath', min: 0, max: 1, def: 0, group: 'Head and body' },
+ { id: 'eyeLOpen', label: 'Left eye open', min: 0, max: 1.25, def: 1, group: 'Eyes and brows' },
+ { id: 'eyeROpen', label: 'Right eye open', min: 0, max: 1.25, def: 1, group: 'Eyes and brows' },
+ { id: 'eyeSmile', label: 'Eye smile', min: 0, max: 1, def: 0, group: 'Eyes and brows' },
+ { id: 'gazeX', label: 'Gaze X', min: -1, max: 1, def: 0, group: 'Eyes and brows' },
+ { id: 'gazeY', label: 'Gaze Y', min: -1, max: 1, def: 0, group: 'Eyes and brows' },
+ { id: 'browY', label: 'Brow Y', min: -1, max: 1, def: 0, group: 'Eyes and brows' },
+ { id: 'browAngle', label: 'Brow angle', min: -1, max: 1, def: 0, group: 'Eyes and brows' },
+ { id: 'mouthOpen', label: 'Mouth open', min: 0, max: 1, def: 0, group: 'Mouth and cheeks' },
+ { id: 'mouthForm', label: 'Mouth form (i to o)', min: -1, max: 1, def: 0, group: 'Mouth and cheeks' },
+ { id: 'blush', label: 'Blush', min: 0, max: 1, def: 0, group: 'Mouth and cheeks' },
+ { id: 'armAngle', label: 'Arm angle', min: -10, max: 10, def: 0, group: 'Hand' },
+ { id: 'handAngle', label: 'Wrist angle', min: -10, max: 10, def: 0, group: 'Hand' },
+ { id: 'fingerTap', label: 'Finger tap', min: 0, max: 1, def: 0, group: 'Hand' },
];
// Reference algorithms are intentionally retained as JavaScript; the factory's rig input
@@ -181,20 +181,20 @@ export function createRig(rig) {
// Head transform with weight w (0 = body, 1 = fully head). Mutates p.
function applyHead(p, w, P, wTurn = w) {
- const o = turnOffset(p[0], p[1], P.ParamAngleX / 30, P.ParamAngleY / 30);
+ const o = turnOffset(p[0], p[1], P.angleX / 30, P.angleY / 30);
p[0] += o[0] * wTurn; p[1] += o[1] * wTurn;
if (w <= 0) return;
- rotateAround(p, HEAD.pivotX, HEAD.pivotY, -P.ParamAngleZ / 30 * HEAD.maxRoll * w);
+ rotateAround(p, HEAD.pivotX, HEAD.pivotY, -P.angleZ / 30 * HEAD.maxRoll * w);
}
function applyBody(p, restY, P, chest = 0, breathW = 1, shoulder = 0) {
- const b = P.ParamBreath;
+ const b = P.breath;
// inhale: everything above the cut-off rises, shoulders lift more, the chest widens a little
p[1] -= b * (5 * breathW + 4 * shoulder);
p[0] += (p[0] - BODY.chest.cx) * 0.012 * b * chest;
- p[0] += P.ParamBodyAngleX / 10 * (7 + 9 * chest);
+ p[0] += P.bodyAngleX / 10 * (7 + 9 * chest);
// bottom rows stay put so no gap opens at the cut-off edge of the image
- rotateAround(p, BODY.pivotX, BODY.pivotY, -P.ParamBodyAngleZ / 10 * BODY.maxRoll * (1 - sstep(...BODY.rollBand, restY)));
+ rotateAround(p, BODY.pivotX, BODY.pivotY, -P.bodyAngleZ / 10 * BODY.maxRoll * (1 - sstep(...BODY.rollBand, restY)));
}
// Base layer: hair and face-part offsets are added in rest space, then head, then body.
@@ -212,15 +212,15 @@ export function createRig(rig) {
p[0] += (phys.bunL[0] * w.bunL + phys.bunR[0] * w.bunR) * g;
p[1] += (phys.bunL[1] * w.bunL + phys.bunR[1] * w.bunR) * g;
// brows
- p[1] -= P.ParamBrowY * 7 * w.brow;
+ p[1] -= P.browY * 7 * w.brow;
if (w.brow > 0.01) {
- const a = P.ParamBrowAngle * 0.12 * w.brow;
+ const a = P.browAngle * 0.12 * w.brow;
p[1] += (x - rig.face.brow.cx) * Math.sin(a);
}
- p[1] += P.ParamMouthOpenY * 3.5 * w.jaw;
+ p[1] += P.mouthOpen * 3.5 * w.jaw;
// head turn, per part: nose and mouth travel further than the eyes, the far eye
// narrows and the near eye widens, the ears and buns slide the other way
- const ax = P.ParamAngleX / 30, ay = P.ParamAngleY / 30;
+ const ax = P.angleX / 30, ay = P.angleY / 30;
p[0] += ax * (8 * w.nose + 5 * w.mouth) + (x - rig.face.eyeA.cx) * 0.12 * ax * w.eyeA - (x - rig.face.eyeB.cx) * 0.12 * ax * w.eyeB
- ax * 9 * w.earR + ax * 4 * w.earL - ax * 10 * (w.bunL + w.bunR);
p[1] -= ay * (6 * w.nose + 3 * w.mouth);
@@ -273,8 +273,8 @@ export function createRig(rig) {
function deformHand(x, y, w, P, F, out) {
let p = [x, y];
// kept small on purpose: anything the hand uncovers is only a blurry inpaint
- p = rot(p, KNUCKLE, Math.cos(P.ParamFingerTap * 0.07 * w.finger), Math.sin(P.ParamFingerTap * 0.07 * w.finger));
- const ha = -P.ParamHandAngle / 10 * 0.045 * w.wrist, aa = -P.ParamArmAngle / 10 * 0.015 * w.arm;
+ p = rot(p, KNUCKLE, Math.cos(P.fingerTap * 0.07 * w.finger), Math.sin(P.fingerTap * 0.07 * w.finger));
+ const ha = -P.handAngle / 10 * 0.045 * w.wrist, aa = -P.armAngle / 10 * 0.015 * w.arm;
p = rot(p, WRIST, Math.cos(ha), Math.sin(ha));
p = rot(p, ELBOW, Math.cos(aa), Math.sin(aa));
p = F.tr(p);
diff --git a/src/engine/sprites.js b/src/engine/sprites.js
index 1cf7e2d..e64b3d2 100644
--- a/src/engine/sprites.js
+++ b/src/engine/sprites.js
@@ -13,8 +13,8 @@ export function createSpriteModule(engine, rig) {
// Mouth opening area (the region the mouth drawings were painted in): used to squash only
// the inside of the mouth sprite, the skin at its edge stays put.
const MOUTH_AREA = rig.mouth.area;
- // Mouth shapes. ParamMouthForm is the vowel axis: -1 wide (i) .. 0 (a) .. +1 round (u/o);
- // ParamMouthOpenY how far it opens. Each shape names the drawing it uses, the openness that
+ // Mouth shapes. mouthForm is the vowel axis: -1 wide (i) .. 0 (a) .. +1 round (u/o);
+ // mouthOpen how far it opens. Each shape names the drawing it uses, the openness that
// drawing shows at full size, and a width factor (u is a narrowed o).
const MOUTH_SHAPES = {
a: { sprite: 'mouth_a', ref: 0.9, width: 1 },
@@ -122,8 +122,8 @@ export function createSpriteModule(engine, rig) {
for (const it of Object.values(items)) it.layer.visible = false;
const covered = [false, false];
const eyes = [
- [P.ParamEyeROpen, P.ParamEyeSmile],
- [P.ParamEyeLOpen, P.eyeSmileL ?? P.ParamEyeSmile],
+ [P.eyeROpen, P.eyeSmile],
+ [P.eyeLOpen, P.eyeSmileL ?? P.eyeSmile],
];
// the frame is picked by openness; when it changes, the new drawing fades in over
// EYE_FADE_SEC (a time-based cross-fade, so no double image is ever held)
@@ -151,16 +151,16 @@ export function createSpriteModule(engine, rig) {
else { show(st.cur, 1); show(st.prev, 1 - k); }
covered[i] = st.cur !== 'open' && k >= 0.999;
});
- const shape = mouthShape(P.ParamMouthOpenY, P.ParamMouthForm, lastShape);
+ const shape = mouthShape(P.mouthOpen, P.mouthForm, lastShape);
lastShape = shape;
const def = shape && MOUTH_SHAPES[shape];
const mt = def && items[def.sprite];
if (mt) {
mt.layer.visible = true;
// fade in right above the threshold so the closed line hands over softly
- mt.layer.alpha = sstep(MOUTH_OPEN_MIN, MOUTH_OPEN_MIN + 0.04, P.ParamMouthOpenY);
+ mt.layer.alpha = sstep(MOUTH_OPEN_MIN, MOUTH_OPEN_MIN + 0.04, P.mouthOpen);
// never squash a drawing below half its height: flatter looked like a blob
- const squash = Math.min(1.1, Math.max(0.5, P.ParamMouthOpenY / def.ref));
+ const squash = Math.min(1.1, Math.max(0.5, P.mouthOpen / def.ref));
place(mt, P, phys, squash, def.width);
}
return { eyes: covered, mouth: shape };
diff --git a/tests/engine.test.ts b/tests/engine.test.ts
index 844e3a9..a679a9b 100644
--- a/tests/engine.test.ts
+++ b/tests/engine.test.ts
@@ -11,7 +11,7 @@ test('rig instances have isolated coordinates and physics state', () => {
const first = createRig(a);
const second = createRig(b);
const P = Object.fromEntries(PARAMS.map(p => [p.id, p.def]));
- P.ParamAngleX = 30;
+ P.angleX = 30;
const x = [600, 400];
const y = [...x];
first.applyHead(x, 1, P);
diff --git a/tests/regression.test.ts b/tests/regression.test.ts
index 90c6db4..4b57980 100644
--- a/tests/regression.test.ts
+++ b/tests/regression.test.ts
@@ -25,14 +25,14 @@ reference.setEyes(metadata.eyes);
const defaults: Record<string, number> = Object.fromEntries(PARAMS.map(p => [p.id, p.def]));
const poses: Record<string, number>[] = [
{},
- ...[-30, -15, 15, 30].map(ParamAngleX => ({ ParamAngleX })),
- ...[-15, 15].map(ParamAngleY => ({ ParamAngleY })),
- ...[-15, 15].map(ParamAngleZ => ({ ParamAngleZ })),
- { ParamAngleX: -20, ParamAngleY: 10, ParamAngleZ: 15, ParamBodyAngleZ: 8 },
- { ParamBodyAngleX: 10, ParamBreath: 1 },
- { ParamBrowY: 1, ParamBrowAngle: 1, ParamMouthOpenY: 1 },
- { ParamHandAngle: 10, ParamArmAngle: 10, ParamFingerTap: 1 },
- { ParamAngleX: 20, ParamAngleY: -10, ParamEyeLOpen: 0, ParamEyeROpen: 0.5, ParamEyeSmile: 1 },
+ ...[-30, -15, 15, 30].map(angleX => ({ angleX })),
+ ...[-15, 15].map(angleY => ({ angleY })),
+ ...[-15, 15].map(angleZ => ({ angleZ })),
+ { angleX: -20, angleY: 10, angleZ: 15, bodyAngleZ: 8 },
+ { bodyAngleX: 10, breath: 1 },
+ { browY: 1, browAngle: 1, mouthOpen: 1 },
+ { handAngle: 10, armAngle: 10, fingerTap: 1 },
+ { angleX: 20, angleY: -10, eyeLOpen: 0, eyeROpen: 0.5, eyeSmile: 1 },
];
const fixedPhysics = {
gain: 0.8,
@@ -105,11 +105,11 @@ test.skipIf(!samplePresent)('14 poses: every 7px and every layer vertex match ba
});
// Apply every lid mode on the full 7px grid and all fixture vertices as well.
rig.eyes.forEach((eye, eyeIndex) => {
- const open = eyeIndex === 0 ? P.ParamEyeROpen : P.ParamEyeLOpen;
+ const open = eyeIndex === 0 ? P.eyeROpen : P.eyeLOpen;
for (const part of ['ball', 'low', 'crease', 'lash']) {
points.forEach(([x, y], i) => {
- reference.deformBase(x, reference.eyePartY(metadata.eyes[eyeIndex], part, x, y, open, P.ParamEyeSmile), weights[i].old, P, phys, a);
- engine.deformBase(x, engine.eyePartY(eye, part, x, y, open, P.ParamEyeSmile), weights[i].new, P, phys, b);
+ reference.deformBase(x, reference.eyePartY(metadata.eyes[eyeIndex], part, x, y, open, P.eyeSmile), weights[i].old, P, phys, a);
+ engine.deformBase(x, engine.eyePartY(eye, part, x, y, open, P.eyeSmile), weights[i].new, P, phys, b);
compare();
});
}
@@ -144,11 +144,11 @@ test.skipIf(!samplePresent)('all drawn eye and mouth sprite meshes match referen
let maximum = 0;
const seen = new Set<string>();
for (const pose of poses) for (const form of [-1, -0.3, 0, 0.5, 1]) for (const open of [0.25, 0.8]) {
- const P: Record<string, number> = { ...defaults, ...pose, ParamMouthForm: form, ParamMouthOpenY: open };
+ const P: Record<string, number> = { ...defaults, ...pose, mouthForm: form, mouthOpen: open };
for (const eyeOpen of [0, 0.5, 1]) {
- P.ParamEyeLOpen = eyeOpen;
- P.ParamEyeROpen = eyeOpen;
- P.ParamEyeSmile = eyeOpen === 0 ? (form > 0 ? 1 : 0) : 0;
+ P.eyeLOpen = eyeOpen;
+ P.eyeROpen = eyeOpen;
+ P.eyeSmile = eyeOpen === 0 ? (form > 0 ? 1 : 0) : 0;
oldSprites.update(P, fixedPhysics, 0.1);
newSprites.update(P, fixedPhysics, 0.1);
for (const [name, old] of oldRenderer.items) {
@@ -171,7 +171,7 @@ test('physics offsets and tassel joint positions preserve the reference behavior
const current = new Physics();
let maximum = 0;
for (let frame = 0; frame < 120; frame++) {
- const P = { ...defaults, ParamAngleX: Math.sin(frame / 20) * 30, ParamAngleZ: Math.cos(frame / 15) * 15 };
+ const P = { ...defaults, angleX: Math.sin(frame / 20) * 30, angleZ: Math.cos(frame / 15) * 15 };
const a = old.step(P, 1 / 60) as unknown as typeof fixedPhysics;
const b = current.step(P, 1 / 60) as unknown as typeof fixedPhysics;
const flatten = (value: unknown): number[] => {
diff --git a/tests/sensitivity.test.ts b/tests/sensitivity.test.ts
index 759e826..879e6aa 100644
--- a/tests/sensitivity.test.ts
+++ b/tests/sensitivity.test.ts
@@ -25,7 +25,7 @@ for (const item of cases) test(`${item.name} changes the expected region by more
const edited = parseRig(fixture);
item.edit(edited);
const a = createRig(original), b = createRig(edited);
- const P = { ...parameters, ParamAngleX: 30, ParamHandAngle: 10 };
+ const P = { ...parameters, angleX: 30, handAngle: 10 };
const fa = a.handFrame(P), fb = b.handFrame(P);
let maximum = 0;
const [x0, x1, y0, y1] = item.bounds;