Mini Project 4. Patterns

p5.js Web Editor | Supreme kangaroo (p5js.org)

 

Working process

The assignment in general uses the scale function, the push and pop function, the translate function, and the random function to create abstract shapes.

I divided the image into two parts in general, with central symmetry. The graphs in the first and third quadrants use the line function and the for loop function to create the butterfly shaped image. The second and fourth quadrant images were created using the scale function and triangles.

First thing first, I set the variables and used the random function to achieve a random change in the background color.

Next is the implementation of the butterfly shape, I used the line function and the for loop to draw it. Each butterfly shape is a superposition of three functions like this.

Then, to fill in the gaps in the canvas and add some variation, I used triangles to fill in the gaps and applied the scale function to scale the size to reduce the tedious calculations.

After that, I used the translate function to make all the triangles appear center-symmetric.

At the end, I used transparent circles to achieve the richness of the image.

 

Reflection

Before this work, I did some mini projects to study the combination of for loop and line functions.

mini project

 

After that, I tried more complex variations of the function. 

I used for loops as the main logical framework several times in this work. the use of scale was able to greatly reduce my computational work. The downside is that I did not use the rotate function, which I will probably use in my future dynamic work.

General Looking

Leave a Reply