List of Listings

Chapter 2. Processing: A Programming Language for Artists

Listing 2.1. Organizing code into setup() and draw() function blocks

Listing 2.2. Drawing with a while loop

Listing 2.3. Concentric circles drawn using traces

Chapter 3. The Wrong Way to Draw a Line

Listing 3.1. Perlin noise

Listing 3.2. Drawing a sine curve

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

Listing 4.5. A circle drawn with a custom noise function

Listing 4.6. Final code for Wave Clock

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

Listing 5.6. Constructing a cube of three-dimensional noise

Listing 5.7. Spiraling around a sphere

Chapter 6. Emergence

Listing 6.1. Code to draw a few circles at the click of the mouse

Listing 6.2. A Circle class

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.1. CA framework

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

Listing 7.5. Custom wave-like 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

Listing 8.8. Sutcliffe Pentagon, not limited to five sides

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.237.194