The Escalator Button

Link to my code: https://editor.p5js.org/jiawen21/sketches/7ZiNzQBYg

Description:

This is a picture of an escalator bottom on my floor in my dorm. It has the up and down buttons and a number one written in yellow. It has some of the basic geometric shapes. It looks pretty easy to code but as a beginner, it took me a while to figure out the programming for number one and the coordinates of each shape.

picturesketchesoutcome

Coding:

code

This is the part where I struggle with. This is one snippet of the code for the number 1. I didn’t know how to rotate the rectangle  to create a slanted rectangle. I had to search up the reference for it and study it. At first, I copy and pasted the reference from the p5.js website and then I changed the number one by one to see what function the code does. I think the code rotate() was the most useful here because I can adjust how slanted I want my rectangle to be. At first I put 3 for the rotate, but it was too slanted and then I put 1 and 2 and it didn’t fit. I ended up putting 4 because it was the perfect angle for the rectangle to be hanging on the number 1.

Reflection:

1) For right now, I think I prefer using the reference over the exploratory programming because I just started learning how to code so exploratory programming would be quite a hard task for me. I wouldn’t know where to start if I do exploratory programming.  After using the reference, I saw a pattern/language in coding, which I feel like could be very useful in the future when I want to do exploratory programming. I feel like I would use exploratory programming in my free time where there isn’t a time limit for me to finish the work.

2) Drawing on paper involves no specific patterns or language. All I need to do is pick up  a pencil and a paper and my hand would start moving from what my brain tells them to do.  It reminds me of how when we’re little, we had to learn how to use a pencil to draw or write. I think programming is also something that we need to learn from the start just like how a toddler learns how to write or draw. Learning how to program is like learning a new language and putting it to use.

3) One part where programming is easier than drawing on a piece of paper is that the object looks more realistic and looks almost very similar to the object in real life. In programming, if I want a certain color, I could just google the color numbers online and it’ll give me an exact color that matches the colors in real life. For drawing, sometimes it’s hard to find the right color that best matches the one in real life. It would involve a lot of work where one color has to mix with another color and it’ll take some time to finally get the right color for it. In addition, in programming it’s easy to input a straight line or a perfect circle. I could do  calculations and the program will know exactly where the middle for this object is. In drawing, I could only do estimations for everything.

 

 

Leave a Reply

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