This is the link to my week2 assignment: Click here
In this assignment, we are asked to create a simple sketch (a static image or animation) using at least 3 User-Defined Functions and Transformation functions. In my work, I explored the functions and created an interesting aesthetic experience.
This is the video showing how it looks:
The work is consisted of 3 user-defined functions:
- void MyOwnSquare: used to create the blue square arrays in the background
To create this blue square arrays, I use two nested for loops so that the squares can be arranged in an ordered way. Also, the blue squares themselves are rotating, which is easy to achieve in rotate(radians(frameCount)) function.
2. void MyOwnRect: used to create the rotating squares following the mouse
This part is a little bit tricky, at first I want to create the effect that, once the user mouseclick, then appears a rotating square at (mousex, mousey), and if the user click elsewhere, more and more rotating squares come up. However, I didn’t achieve it cause I have no idea how to combine void draw() and void mouseClick() together. So I changed my way and create a line of squares. Also, I added a semitransparant rectangle as the background, so there are shadows as I move the mouse.
3. void MyOwnLine: used to create the black lines in the background
I add the third function to create more effects. I also make use of for loops here, so that the line can duplicate in the gap distance I set.