Concept:
With this art piece, I tried to explore the idea of excitement. The color palette chosen for the piece was meant to represent a “dormant” state. The excitement is then catalyzed by the clicking of a mouse, which makes the colors brighter and makes the square turn in a different direction.
Coding process:
While thinking of the idea of excitement and how I could visually represent that, I know I wanted to use the concept of rotation and the change of direction to represent some sort of change. The colored lines, which were coded using the “for()” loop were meant to remain static. However, due to a “happy accident”, I put the “strokeWeight” in my “if” loop that was supposed to change the direction of rotation of the square when the mouse was clicked. When I did that, the strokes for the lines became thicker too, creating the visual sensation of lighting up. Accidentally, the result of my mistake perfectly tied back to the idea that I wanted to convey.
The piece of code I’m particularly proud of is
if (mouseX < 235 && mouseX > 165 && mouseY < 235 && mouseY > 165 && mouseIsPressed) {
stroke(166, 245, 237);
strokeWeight(4); //increasing the thickness of the borders of the square and the lights when the mouse is clicked
angle = angle – 1;
rotate(angle);
rect(0,0,70,70);
}
//rotating the square in the anti-clockwise direction when the mouse is clicked
Not only was I able to solve the issue I was facing with my previous assignments where I make the mouse click within certain bounds trigger something, but I was also able to code it in a way that allowed me to change the direction of rotation of the square. On top of that, this was the piece of code that let me somewhat visually represent the concept of excitement.
The code: