NotesProcedural locomotion for Three.js

Stopping and turning like a person

A single closing step on arrival, and 2–3 step turns when the destination is behind.

Two situations gave away that it was procedural: arriving and turning.

  • On arrival, the character took little steps to square its feet. Now it accepts one foot slightly ahead, with the body centred between them, and the arms no longer whip when it stops.
  • With the destination behind, it took four little steps almost in place that tripped over each other. Now it slows down and turns towards it in 2–3 big steps that already move in the new direction, as in the CMU captures (2–3 steps of about 100–140°), pivoting on the planted foot.

Along the way I fixed the swinging leg, which could stretch sideways to get around the planted foot.