diff --git a/content/03_oscillation.html b/content/03_oscillation.html index 500ceb0..d1ce2f9 100644 --- a/content/03_oscillation.html +++ b/content/03_oscillation.html @@ -691,6 +691,7 @@

Exercise 3.11

Exercise 3.12

+

To create more complex waves, you can add multiple waves together. Calculate the height (or y) values for several waves and add those values together to get a single y value. The result is a new wave that incorporates the characteristics of each individual wave.

diff --git a/content/05_steering.html b/content/05_steering.html index 7176519..11a0b37 100644 --- a/content/05_steering.html +++ b/content/05_steering.html @@ -222,6 +222,7 @@

Exercise 5.2

Exercise 5.3

+

Implement a seeking behavior with a moving target, often referred to as pursuit. In this case, your desired vector won’t point toward the object’s current position, but rather its future position as extrapolated from its current velocity. You’ll see this ability for a vehicle to “predict the future” in later examples. The solution is covered in the “Pursue & Evade” video on the Coding Train website.

@@ -1174,8 +1175,8 @@

Combining Behaviors

let steer = p5.Vector.sub(desired, this.velocity); steer.limit(this.maxforce); - this.applyForce(steer); - //{!1} Instead of applying the force, return the vector. + this.applyForce(steer); + //{!1} Instead of applying the force, return the vector. return steer; }

This change is subtle but incredibly important: it allows the strength of these forces to be weighted all in one place.

@@ -1479,6 +1480,7 @@

Example 5.12: Bin-Lattice S

The quadtree expands the spatial subdivision strategy by dynamically adapting the grid according to the distribution of the boids. Instead of a fixed grid, a quadtree starts with a single large cell that encompasses the entire space. If too many boids are found within this cell, it splits into four smaller cells. This process can repeat for each new cell that gets too crowded, creating a flexible grid that provides finer resolution when and where it’s needed.

Example 5.13: Quadtree

+
diff --git a/content/08_fractals.html b/content/08_fractals.html index 8e009a8..58be0bd 100644 --- a/content/08_fractals.html +++ b/content/08_fractals.html @@ -591,6 +591,7 @@

Exercise 8.7

Exercise 8.8

+

Re-create the tree by using a Branch class and an array to keep track of the branches. (Hint: You’ll want to keep track of the branch directions and lengths by using vector math instead of p5.js transformations.) Can you animate the tree’s growth? What about drawing leaves at the ends of the branches?