Chapter 2. Processing: A Programming Language for Artists
Listing 2.1. Organizing code into setup() and draw() function blocks
Chapter 3. The Wrong Way to Draw a Line
Chapter 4. The Wrong Way to Draw a Circle
Listing 4.1. Drawing a circle: first the easy way, then using trigonometry
Listing 4.2. Code changes required to turn a circle into a spiral
Listing 4.3. Adding noise to the spiral
Listing 4.4. 100 spirals, with noise
Chapter 5. Adding Dimensions
Listing 5.1. A two-dimensional noise grid
Listing 5.2. The noise grid, rewritten into neat function blocks
Listing 5.3. Noise grid again, now drawing on the frame loop
Listing 5.4. Noise grid with noise variance added to the movement
Listing 5.5. 2D noise from a 3D perspective
Chapter 6. Emergence
Listing 6.1. Code to draw a few circles at the click of the mouse
Listing 6.3. The Circle class again, with its first method
Listing 6.4. Object-oriented circle-drawing code with movement
Listing 6.5. Circle class’s updateMe method with added collision detection
Listing 6.6. Circle class’s updateMe method again, now with circles
Chapter 7. Autonomy
Listing 7.2. Calculating the next state using GOL rules
Listing 7.3. The Vichniac Vote rule
Listing 7.4. Cell object modified for the three-state Brian’s Brain behavior
Chapter 8. Fractals
Listing 8.1. Coding a fractal structure, step 1
Listing 8.2. updateMe that calculates the end point according to a rotating angle
Listing 8.3. Final listing for the cog fractals
Listing 8.4. Drawing a pentagon using rotation
Listing 8.5. Functions to calculate the midpoints of a set of vertices
Listing 8.6. Functions to extend the midpoints toward the opposite points
Listing 8.7. Varying the strut length of a Sutcliffe Pentagon
18.191.237.194