Nick Grant


Week 4: Repetition with Variation

Introduction to Computational Media

For this week in computational media, I created a non-interactive sketch that implements for loops.

Link to my sketch:
Code on Github:
My first sketch

I started small with squares and ellipses that change color each time the sketch is run. In my for loops I created an initialization condition, the Boolean expression, and the incrementation operation for the x and y coordinates of my rectangles and ellipses.

My second sketch

I experimented more by creating ellipses that appear so long, they created unique white paths in my demonstration. My sketch appeared more modern than before. Instead of ellipses to create the white paths, I could have used rectangles. The widths of the ellipses are incredibly stretched in my for loop as they continuously repeat.  

I desired to challenge myself more. I realized that the combination of rotate with for loops has the ability to produce very unique artwork. As the object repeats in a pattern, they may be manipulated to create very special designs.

For loop with a rotation

Initially I rotated with the parameter PI, but then I realized that rotating with my for loop variable would create a design in which the shapes overlap with each other.

Rotation that divides my for loop variable i

I quickly learned that I needed translate and scale in order to control the size of my pattern. I created a habit of surrounding my code with push and pop in order to avoid mixing up colors. In this example, I accidentally created two pushes.

A spiral design

By increasing the rotation and playing with the y-coordinate, length, and width of my rectangle, my sketch began to take shape. I noticed that altering the Boolean expression inside my for loop changed the amount of rectangles in my spiral pattern, which I found to be very interesting. Translate allowed me to move the shape in the directions I desired.

My final sketch

For the last part of my assignment, I created a comical sketch. By heavily increasing the denominator of my scale, I turned my spirals into seashells. I increased the value in the Boolean expression in my for loops and decreased the denominator in my rotations. I assigned a random color to my seashells that changes each time the sketch is run. I implemented a for loop to create sand particles. For example, when y is less than or equal to height, the y value is incremented by 15. Sometimes when I create lots of variables, I develop long lists. I am interested in learning how to shorten them.