ICM Week 2


In last week, the drawing exercise was hard to let me understand what coding can do. After this week's class, I feel like coding gives more ways and opportunities for users to interact with the browser, and coding is more like setting up rules for users when they are going into the browser. I strongly feel that the process of coding is very similar to math; finding patterns, geometric, and spatial imagination is required when I am trying to think about the logic of coding. When I was coding, I enjoyed using my brain, but I think when it gets more complicated and more complicated, it is going to bother me a lot.   Now I understand one of my friends said he doesn't want to do coding anymore because he thinks he is not intelligent enough. Coding is hard! 

In this week's assignment, I met many problems; first of all, I want to add max to my favorite mouse X. In the beginning, I am trying to use maxValue() to my mouse X, but it doesn't work because it requires more parameters, and also I think I do have some misunderstandings about it. I ended up setting up a left wall and right wall, which is way easier for me to understand. 



My hat is also a variable element; I want it to control by mouse Y. It was a little more complicated. I tried to use rotate() first, but I was confused by how to change the center of the rotation and the direction to turn, so I changed it to let the hat lift. In this part, it kind of needs some little math because an ellipse and an arc combined my hat, so they need to be sync.

The hardest part was setting up a random element; it was easy to add random. The first problem I met was that when the random was under the draw, it kept showing up and looked like a mistake, so I brought it under setup. But once it goes to set up, the background underdrawing will cover the random object because the background keeps writing, so I decided to bring the background to set up and before the ellipse(the random object) when I think everything will be fine the problem shows up.
 


 Due to the background is not looping, my subject is controlled by mouse X, and mouseY will keep in the frame for every movement. I came up with several ideas. First, I tried to bring the random object back under draw, but put pop() and push() also noloop(), so maybe the random object won't looping, but it filed. Then I am thinking of putting a rect() that covers the mouse and hat but not the random object, but the weird thing is that if I don't have background under draw, the rect shows up like two rects, it still confused me why it happens like that.



And at the end, my solution is to change the rectMode (it was center before) to Conor, and the problem is solved. But I am still confused by why the rectMode(center) created two rect when there is no background() under draw. Also if the way that covers half the frame is the only way to do that? Are there any other ways to solve this image ghosting thing?

Comments

Popular posts from this blog

Week3

week4

Week 1 Blog