Cole LaPlante's Project 3
Skip to end of metadata
Go to start of metadata

Cole LaPlante Project 3

Abstract:

The purpose of this project was to create surrealist artwork using turtle. In order to do this, we had to incorporate loops and conditionals into our functions, and we had to create concise code that can be imported later for re-use. Furthermore, we had to practice creating functions that aren't extremely long and have parameters that can be altered with a command-line argument.

Task 1:

I tried to create floating trees to replicate this painting by surrealist artist Rafal Olbinski. I tried to create three clusters of trees in the sky to show that I set parameters on the scene function that can change its location and size. However, this scene looks much better with just one cluster of trees that is more spread across the whole screen. I created a function called rafaScene1 that has parameters x, y, and scale.

Task 2:

I created a cluster of larger floating trees that is much more aesthetically pleasing because it covers the majority of the screen. I also added a stars function to create stars in the sky. I wanted to do clouds, but I don't think I could make a shape that would actually look like a cloud, so I chose stars. Overall, I don't think this looks very good with a white background, but it seems surrealist in nature.

 

Task 3:

I first decided to add a fill color to the trees, and then I also decided that if I was going to input a number of trees and stars, I would have to randomize the location of each object so that I could loop it. I also randomized the fill colors of each shape in each tree. I then decided to add parameters on the tree and star functions so that it would choose the number to create of each with a command-line argument. The first number decides how many trees to create, and the second number is for the stars. In the first picture, the command line read: "python3 task2.py 5 20" and the second read: "python3 task2.py 10 15"

Extensions:

Extension 1:

Two paintings in one

For my extension, I further compounded the scene. I tried to make the majority of the trees stay inside the star, but I couldn't figure out an effective way to guarantee it. I added two new functions to create this scene. I added a function called blackScreen that would draw a box around the screen and fill in the box dark blue, to represent the night sky. Then I made a function called starBorder to create the 6 pointed star filled in with lavender to represent a daytime sky. Then I called on the previous function I had created for the original painting, with the window of the random coordinates for each tree reduced so that they would mostly be inside the central star. I thought it would make sense for stars to exist in the outer night sky, but I also didn't really know how to make it so there were multiple different star location windows so stars wouldn't show up inside the central star. Overall, I think this looks fairly cool, but if I could set the trees to only exist in the perimeter of the central star and vice versa for all the other stars, it would look much better.

Questions:

  1. Command line arguments are useful because you can input a parameter outside of TextWrangler. You can use one python file/function for many different purposes without creating a new file to alter it.
  2. An "if" statement creates a conditional for python, because if what comes after "if" isn't true, then python will not perform the next task and just move on. If the statement is true, it will carry it out like normal.
  3. = means assignment. If I want to set any variable to a value, I use =. == is more for conditionals, because it just represents equal values. If x==5, they have the same value, but if you wanted x to be defined as 5, you would need one equal sign.
  4. In my function, I set N = int(sys.argv[1]), and then the next line had N as the parameter for the range function. Thus, whatever my command line argument is becomes N, and then N decides the number of times to repeat the function.
  5. I chose Rafal Olbinski, because I thought his paintings had fairly simple concepts sometimes, and the majority of them included the sky, which I saw as a possibility for a scene. I really could have chosen anyone, but I found two of Rafal's paintings that I really wanted to try and recreate pretty early on in my search for surrealist art.

Conclusion:

I learned a lot about how to synthesize all of what we are learning about python. We have learned range/loops, random, sys arguments, and we have imported previous functions, but this is the first time we have had to do it all at once, which made the experience fairly difficult. I learned how to use these types of functions together to create a complex image. 

Acknowledgements:

https://images.artbrokerage.com/artthumb/olbinski_110998_1/625x559/Rafal_Olbinski_Sea_Lavender_36x26.jpg

https://images-na.ssl-images-amazon.com/images/I/91i1TWgi06L._AC_SY741_.jpg

https://pynative.com/python-get-random-float-numbers/

https://matplotlib.org/3.1.0/gallery/color/named_colors.html

Labels