This project focuses on the creation of aggregate images. The key is to understand parameters and how relative location functions work. Calculation of relative location is crucial for this project, as this is what makes each scene proportionate. I made simple aggregate shapes, such as flowers (made from triangles) and cactus, for which a "for" loop is used since a cactus is symmetrical. More complicated aggregate shapes include Christmas tree (made from triangles of different scales, rectangle, and a star), painting (made from a rectangle picture frame and random number of flowers as objects), chandelier (made from rectangles of decreasing size downwards and crosses as decorations).
As for aggregate shapes, random package is imported. For example, flowers are made from random number of triangles (i.e. petals), I limited the number of triangles within the range of 3-12 so as not to make flowers too dense with petals, and here, a "for" loop is also introduced to repeat the process of rotating the triangle according to whatever number of triangles that the turtle intends to draw. When I made the paintings, random package is imported again so that I can draw the random number of flowers on each painting. The location at which the flowers are drawn is also within a certain range (i.e. the side length of the picture frame).Therefore, the more complex aggregate shape "painting" involves two levels of randomness-the number of petals in a single flower and the number of flowers in a single painting.Also worth mentioning is the shape "table". I managed to create a 2D image by using parallelogram and rectangles to create the perspective. All of my aggregate shape functions work properly as shown in image2.They were tested at different locations and of different sizes.
Creating scenes are more complicated, since I have to gauge the size of every objects and add color. The one problem I encountered is that the coloring would follow the path by which the turtle moves to the next (x,y) position. To solve this problem, for example, in my "chandelier" shape, I added "beginfill" and "endfill" in the basic shape "block" so that the turtle knows when to fill colors in the aggregate shapes.
The museum scene, as shown by image 3, has a chandelier, two paintings, two tables, and one Christmas tree. I did not use random package for the number of paintings, since doing so would make the scene messy and packed.
The desert scene, as shown by image 3, has 7 cactuses and 100 stars which are dispersed randomly. I set the range of the position of stars within (-300*size,300*size). A "for" loop was also introduced.
The idea is to build aggregate shapes from basic shapes and to build a complete scene involving aggregate shapes so that the level of complexity increases. One things that happens a lot is that the computer does not take the step that I intended to take. The problem still lies in the barrier between human minds and computational language. To be precise, one should be detail-oriented, and this project is an example of how small objects can affect the whole scene.
I would like to thank lab TAs Yixuan Qiu and Bingya Liu for debugging my code and also my friends who have taken CS151 before--Roujia Zhong, Di Luo, Luhang Sun–for helping figuring out problems associated with locations and size of the images.