Assignment due Monday October 16: Self-portrait & loop

For this assignment, we are asked to draw a self-portrait using Processing and to use for() to draw 5 different rectangles in 5 different places.

  1. Using for() to draw 5 rectangles

I find it hard for me to come up with good calculations for the position of the x and y coordinates, width, and height, in order to draw the rectangles separately from each other. The numbers I came up with in my code are just trial and error.

2. Self-portrait

In my self-portrait, I apply the for() loop into creating a color fading effect for my hair. I also use a circle to run across the canvas to paint the background, as it runs, the circle changes its color. 

I also learn to use arc to draw my eyes, here is the link to the arc() reference page . 

What took me the most time to draw is the shapes that uses translate() and rotate(), as it is hard to bring the shape to the desired position. After a lot of trial and error, I have figured out that it is best to change the coordinates in translate() to move the shape around, not the coordinates in rect(). 

Leave a Reply

Your email address will not be published. Required fields are marked *