browser icon
You are using an insecure version of your web browser. Please update your browser!
Using an outdated browser makes your computer unsafe. For a safer, faster, more enjoyable user experience, please update your browser today or try a newer browser.

Computer Science Blog #4

Posted by on February 24, 2019

My Final Product

Star Trail

 

Procedures & Challenges

The main key of my product is the star trail background. I initially thought two ways to demonstrate this star trail. The first method is using forward(0): set the biggest circle by forward(0) and decrement the pensize with a random color through iteration. The problem of the first method is that I cannot make a gap between each star trail line as the inspiration image shows(Challenge 1), and it is difficult to depict the details of side star trails that the length of each star trail line is different(Challenge 2). What does this problem mean is that if there is no gap between each star trail, it looks so dense and doesn’t show the orange background color, which represents that this occurs at the early morning. Therefore, the final product looks less realistic. In contrast, my second method works perfectly. The second method is using the arc. However, it is now just simple that using the arc code because it starts drawing from itsĀ head, not depend on circles’ center. Thus, the final product will look like this(Challenge 3). I eventually found out the solution: first set the center and make a random variable, next use this variable as a radius and the amount of the turtle moves from its center, then repeat these processes with setting the head of the turtle as 90. However, there was a problem again. This method doesn’t work in Processing for an unknown reason. Therefore, I needed to put some efforts into converting processing codes into Turtle Art(Challenge 4). Luckily, it successfully worked in turtle art. Then, I worked on the green plain. To demonstrate the scenography, I set the shade as proportional to y-coordinate. Therefore, I set the shade as y-coordinate / -17. ‘-17’ is the number that I get over many experiments. The next focus point was the three trees at the front. To highlight the decrement pensize of the tree branches, I needed to use an “if, then” code because there is no pattern to use iteration. To briefly explain what I did, I set the pensize as a certain value and used iteration to decrement and make it stop IF the pensize becomes 0. I, in fact, got inspired by other turtle art with this tree code. However, the other two trees next to the main tree are made by me. Then, I moved on to illustrate the grasses under the three trees. My creative thinking makes this code really simple, which requires numerous random states. I set the coordinate, color, shade, setH, pensize, and amount of forward as a random and just repeat these 170 times. My next goal was to code the trees at the back. My creative codes enable to make these trees very easily. I simply made a tree with arc and forward(random), then repeat those with random coordinates. Then I made a rock since a place in front of the mountain looks so empty. Finally, I achieved coding a 3-D mountain with ices at the top. I first make a scalene quadrilateral, then highlights the boundary that will make the quadrilateral as the 3-D mountain. Through these procedures, my successful inspiration work is done~

 

Look at the descriptions below about each challenge.

Challenge 1

It looks so dense, and the background color, which indicates the time, cannot be seen through this star trail.

Challenge 1

Solution

 

Challenge 2

By using the second method, I could make more realistic star trail.

Challenge 2

Challenge 2 solution

Challenge 2 Solution

 

Problem 3

It is important to know how arc is working.

Challenge 3

Challenge 3 Solution

 

Problem 4

For this problem, the solution is just converting processing codes into turtle art.

Challenge 4

Challenge 4

 

Video of My Codes

Leave a Reply

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