Sunday, 21 December 2008

Chunk16 - Overview

In Processing the draw function will loop until the program is stopped. When the application reaches the end of draw, any work done in the method is copied to the screen and then the draw method is entered again. The amount of patterns to draw for each pass through of draw is controlled by a for loop. Inside this loop are 9 case statements, which are controlled by the 'design' switch. The design switch is a random number between 1 and 9 inclusive.
Each case statement uses different functions to draw it's own pattern.


Case 1 - Draws circles while the interval variable is less than the width of the screen, interval is incremented by a random number with each iteration of the while loop. Uses drawCircles(gap) method.
Case 2 - Uses the drawCircles(gap) method to draw a random amount of circles, depending on the gap.
Case 3 - Draws circles while the interval variable is less than the width of the screen, interval is incremented by 20 with each iteration of the while loop. Uses the drawCircle2(diameter) method.
Case 4 - Draws circles while the interval variable is less than the width of the screen, interval is incremented by 20 with each iteration of the while loop. Uses the drawCircle2(diameter) method.

Using only the first 5 cases produces circles that contain variable moires. This is interesting for a short while but it soon gets a bit boring. After carrying out the modifications some cases use the repeatShapes function and the patterns produced are slightly different.

case 5: The doLines function draws lines diagonally using a for loop but sometimes it doesn't Iook very symmetrical.


In the standalone program the doLines function has been improved and leaves a randomized gap, before and after each iteration of the for loop.


case6: Here the drawCircle2 function is called while Fill is used to colour in the circles. NoFill is used to turn off fill after the function has completed. The effect can be changed by changing colours less frequently, or using the alpha parameter in color().

The drawSectors function uses arrays to draw shapes in a 3x3 grid. The grid is divided into 3 groups - corners, sides and centre. Each iteration can draw a square or circle in none, some or all of the groups.

cases 8 and 9 use the drawSquares function to draw filled or unfilled squares. When used with alpha this can create a transparent, coloures filter on top of some of the patterns.

Chunk 16 has 3 basic versions:
Before modifications:
After Modifications:
Standalone:

The standalone version has an improved doLines function but uses the same functions as used in the text. The functions have just been tweaked a little.

No comments:

Post a Comment