For this week in computational media, I created a non-interactive sketch that implements for loops.
Link to my sketch: https://editor.p5js.org/nickgran321/sketches/Dx0tawWN2
Code on Github: https://github.com/nickgran321/Nick-Grant/blob/master/Computational%20Media%20Week%204:%20Compositions
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.
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.
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.
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.
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.
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.