Skip to content

Multi-point paths explanation improvements #1084

Open
@shiffman

Description

@shiffman

The leap from single segment path to multi-segment is a bit trickier than the simplified explanation in Chapter 5. Example 5.8 relies on the path moving from left to right and having its start and end points on the edges of the canvas.

This is a quick demonstration of how the code fails when the path doesn't follow this format:

https://editor.p5js.org/natureofcode/sketches/ZnQRpvMLr-

The vehicles are instantly stuck at the corner:

Image

Some things to think about:

  • explicitly mention this limitation
  • examine the code to be more general purpose (re-read Craig Reynolds explanation, maybe I missed something important!)
  • record a follow-up video to https://youtu.be/rlZYT-uvmGQ

There is also additional code for handling multi-segment paths in Exercise 5.13 that relates to this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions