Skip to Content

Yoga class

Four students follow a teacher through warrior one, warrior two, triangle and tree.

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

// tea: body f1, at (0, 2.4) m, facing 180°, trained
const tea = HumanChain.subject("tea")
  .act("stand", { seconds: 0.8 })
  .registered("warriorOne", { reps: 1, hold: 0.8, stay: true })
  .registered("warriorTwo", { reps: 1, hold: 0.8, stay: true })
  .registered("triangle", { reps: 1, hold: 0.8 })
  .registered("treePose", { seconds: 1 });

// s1: body m1, at (-1.5, 0) m, facing 0°, amateur
const s1 = HumanChain.subject("s1")
  .act("stand", { seconds: 1 })
  .registered("warriorOne", { reps: 1, hold: 0.8, stay: true })
  .registered("warriorTwo", { reps: 1, hold: 0.8, stay: true })
  .registered("triangle", { reps: 1, hold: 0.8 })
  .registered("treePose", { seconds: 1 });

// s2: body f2, at (-0.5, 0) m, facing 0°, novice
const s2 = HumanChain.subject("s2")
  .act("stand", { seconds: 1 })
  .registered("warriorOne", { reps: 1, hold: 0.8, stay: true })
  .registered("warriorTwo", { reps: 1, hold: 0.8, stay: true })
  .registered("triangle", { reps: 1, hold: 0.8 })
  .registered("treePose", { seconds: 1 });

// s3: body m2, at (0.5, 0) m, facing 0°, amateur
const s3 = HumanChain.subject("s3")
  .act("stand", { seconds: 1 })
  .registered("warriorOne", { reps: 1, hold: 0.8, stay: true })
  .registered("warriorTwo", { reps: 1, hold: 0.8, stay: true })
  .registered("triangle", { reps: 1, hold: 0.8 })
  .registered("treePose", { seconds: 1 });

// s4: body f1, at (1.5, 0) m, facing 0°, novice
const s4 = HumanChain.subject("s4")
  .act("stand", { seconds: 1 })
  .registered("warriorOne", { reps: 1, hold: 0.8, stay: true })
  .registered("warriorTwo", { reps: 1, hold: 0.8, stay: true })
  .registered("triangle", { reps: 1, hold: 0.8 })
  .registered("treePose", { seconds: 1 });

const scene = tea.with(s1, s2, s3, s4);

// The lexicon's laws this scene's rows perform, registered with the performance.
const laws = [HumanSportWorkout.warriorOne, HumanSportWorkout.warriorTwo, HumanSportWorkout.triangle, HumanSport.treePose];

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

const input: IAutoMovieMotionHumanPerformance.IInput = {
  seed: "yoga",
  performers: [
    { subject: "tea", body: bodies["f1"]!, at: { x: 0, y: 0, z: 2.4 }, yaw: 180, proficiency: { level: "trained" } },
    { subject: "s1", body: bodies["m1"]!, at: { x: -1.5, y: 0, z: 0 }, yaw: 0, proficiency: { level: "amateur" } },
    { subject: "s2", body: bodies["f2"]!, at: { x: -0.5, y: 0, z: 0 }, yaw: 0, proficiency: { level: "novice" } },
    { subject: "s3", body: bodies["m2"]!, at: { x: 0.5, y: 0, z: 0 }, yaw: 0, proficiency: { level: "amateur" } },
    { subject: "s4", body: bodies["f1"]!, at: { x: 1.5, y: 0, z: 0 }, yaw: 0, proficiency: { level: "novice" } },
  ],
  composition: scene.node,
  laws,
};
const performance = new HumanPerformance(input);