## Assignment 2

Concept:

For this project I really wanted to experiment with geometry and adding chaos to a shape which is commonly deemed as stable, the humble rectangle. I chose to have the rectangles rounded and translucent to further add to the playful nature of the artwork. The randomness in size, color, and movement makes each play through unique, creating a sense of spontaneity every time the code runs. The fact that they only begin to move  when the mouse is hovered is meant to mimic the human ability to see art even if any isn’t there. If a tree falls in a forest and no one is there to hear it, does it still make a sound? (If your mouse is hovering over it, then sure)

Code Highlight:

The part of this code that I’m really proud of is the way the rectangles handle hitting the edges of the screen:

```if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) {
//if statement checks whether mouse is inside the canvas by analyzing       x and y positions
//if inside the canvas, the x and y values of each rectangle is changed based on its speed and direction value which was assigned in the setup function
rect_object.x += rect_object.speed_x * rect_object.dir_x;
rect_object.y += rect_object.speed_y * rect_object.dir_y;

//this checks whether the object is hitting the horizontal border by analyzing if the left or right side of the rectangle have exited the canvas, it then reverses the rectangle's direction to ensure it stay on screen
if (rect_object.x <= 0 || rect_object.x + rect_object.w >= width) {
rect_object.dir_x *= -1; // Reverse horizontal direction
}
//this checks whether the object is hitting the vertical border by analyzing if the top or bottom side of the rectangle have exited the canvas, it then reverses the rectangle's direction to ensure it stay on screen
if (rect_object.y <= 0 || rect_object.y + rect_object.h >= height) {
rect_object.dir_y *= -1; // Reverse vertical direction```

It’s a small section, but it’s key to making the animation feel fluid and continuous. Each time a rectangle hits a boundary, it bounces back in the opposite direction, keeping each rectangle within the bounds of the canvas. This adds to the randomness of their movement and ensures the canvas is not slowly emptied throughout a run.

Final Product:

Reflections:

Looking ahead, I think there’s a lot of potential to make this interaction even more engaging.  I want to add a feature where clicking on a rectangle changes its size or color. Another idea would be to incorporate deceleration/acceleration effects to make the motion more organic, and make it seem as if the rectangles have weight. I’d also love to experiment with sound or other visual effects that react to the movement, turning this simple animation into something that engages multiple senses.

## Assignment 1 Self Portrait

Concept:

For my self portrait I wanted to do something slightly unconventional. Joan Miro is an artist that I really like and I thus decided to do my self portrait in his unorthodox surrealist style. I wanted to have fun background elements commonly seen in his artwork such as the crescent moon and a star.

Something I’m proud of:

Something I’m proud of for this assignment are the random curves across the whole portrait, and especially drawing the crescent moon. These aspects took me the longest time to figure out and are thus the ones I am most proud of.

```function details() {

fill(255,255,0);//drawing a crescent moon shape by drawing two intersecting circles and having one of them be the color of the background
//this effect makes it so that the second circle cuts the first one to make the moon shape
noStroke();
ellipse(150,630,100,100);
fill(240, 248, 255);
ellipse(170,630,100,100);

//drawing the diagonal lines for the eyebrows
stroke(0);
strokeWeight(4);
line(300, 300, 450, 400);
line(500, 400, 650, 300);

//drawing the yellow curve around the mouth
noFill();
stroke(255, 215, 0);
strokeWeight(8);
beginShape();
vertex(250, 550);
bezierVertex(350, 500, 450, 700, 550, 550);
endShape();
}```

Final Product:

Reflections:

I enjoyed working on this assignment quite a lot, it was a fun experience juggling between taking inspiration from Miro and then also trying to add my own personality into the portrait so I could make something I could be truly proud of. An aspect that I would like to work on in the future is adding some sort of interactivity maybe with eye movement or some background features morphing into others to further portray the dreamlike essence of Joan Miro.