Skip to Content

Pool lanes

Two swimmers switch strokes: crawl to backstroke, and breaststroke to crawl.

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, HumanPerformance } from "@automovie/motions";

// wil: body m2, at (-0.8, 0) m, facing 0°, trained
const wil = HumanChain.subject("wil")
  .act("swim", { kind: "frontCrawl", cycles: 6 })
  .act("swim", { kind: "treadWater", cycles: 1 })
  .act("swim", { kind: "backstroke", cycles: 4 });

// xia: body f2, at (0.8, 0) m, facing 0°, trained
const xia = HumanChain.subject("xia")
  .act("swim", { kind: "treadWater", cycles: 2 })
  .act("swim", { kind: "breaststroke", cycles: 5 })
  .act("swim", { kind: "frontCrawl", cycles: 4 });

const scene = wil.with(xia);

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

const input: IAutoMovieMotionHumanPerformance.IInput = {
  seed: "pool",
  performers: [
    { subject: "wil", body: bodies["m2"]!, at: { x: -0.8, y: 0, z: 0 }, yaw: 0, proficiency: { level: "trained" } },
    { subject: "xia", body: bodies["f2"]!, at: { x: 0.8, y: 0, z: 0 }, yaw: 0, proficiency: { level: "trained" } },
  ],
  composition: scene.node,
};
const performance = new HumanPerformance(input);