Skip to Content

Meeting in a square

Two friends shake hands and high-five; a third walks over, waves and joins the chat.

Loading the take.

Each person is a chain of typed actions from @automovie/motions. This is what an agent writes for the scene; Composing motion explains the parts.

import type { IAutoMovieMotionHumanBody, IAutoMovieMotionHumanPerformance } from "@automovie/interface";
import { HumanChain, HumanHabit, HumanPerformance } from "@automovie/motions";

// ana: body f1, at (0, -0.6) m, facing 0°, trained
const ana = HumanChain.subject("ana")
  .act("walk", { to: { x: 0, y: 0, z: 1.25 } })
  .act("stand", { seconds: 0.6 })
  .act("handshake", { partner: "ben" }, "mt-shake")
  .act("gesture", { kind: "palmsUp" })
  .act("highFive", { partner: "ben" })
  .act("look", {
      target: { kind: "person", subject: "cal", region: "face" },
      cue: "signal",
      seconds: 1,
    }, "mt-look")
  .act("gesture", { kind: "wave" })
  .act("gesture", { kind: "nod" })
  .act("gesture", { kind: "palmsUp" })
  .act("stand", { seconds: 0.6 });

// ben: body m1, at (0, 2.2) m, facing 180°, trained
const ben = HumanChain.subject("ben")
  .act("look", {
      target: { kind: "person", subject: "ana", region: "face" },
      seconds: 0.8,
    })
  .act("gesture", { kind: "nod" })
  .act("stand", { seconds: 2 })
  .act("handshake", { partner: "ana" })
  .sync({ of: "mt-shake", event: "clasp", align: "clasp" })
  .act("gesture", { kind: "nod" })
  .act("highFive", { partner: "ana" })
  .act("gesture", { kind: "shrug" })
  .act("look", {
      target: { kind: "person", subject: "cal", region: "face" },
      cue: "signal",
      seconds: 1,
    })
  .act("gesture", { kind: "raiseHand" })
  .act("gesture", { kind: "nod" })
  .act("gesture", { kind: "shrug" });

// cal: body m2, at (2.4, -1.5) m, facing 0°, trained
const cal = HumanChain.subject("cal")
  .registered("checkPhone", { seconds: 1.5 })
  .act("approach", {
      target: { kind: "person", subject: "ben", region: "face" },
      at: "social",
    })
  .act("stand", { seconds: 3 })
  .act("gesture", { kind: "wave" })
  .sync({
      of: "mt-look",
      event: "start",
      align: "strokeStart",
      offset: -0.2,
    })
  .act("rest", { left: "pocket", right: "hip", seconds: 1.4 })
  .act("gesture", { kind: "palmsUp" })
  .act("gesture", { kind: "nod" });

const scene = ana.with(ben, cal);

// The lexicon's laws this scene's rows perform, registered with the performance.
const laws = [HumanHabit.checkPhone];

// Each body id's motion body, prepared from the site's measures.
declare const bodies: Record<string, IAutoMovieMotionHumanBody>;

const input: IAutoMovieMotionHumanPerformance.IInput = {
  seed: "meeting",
  performers: [
    { subject: "ana", body: bodies["f1"]!, at: { x: 0, y: 0, z: -0.6 }, yaw: 0, proficiency: { level: "trained" } },
    { subject: "ben", body: bodies["m1"]!, at: { x: 0, y: 0, z: 2.2 }, yaw: 180, proficiency: { level: "trained" } },
    { subject: "cal", body: bodies["m2"]!, at: { x: 2.4, y: 0, z: -1.5 }, yaw: 0, proficiency: { level: "trained" } },
  ],
  composition: scene.node,
  laws,
};
const performance = new HumanPerformance(input);