Ibrahim Riaz Project 5
This project builds upon the previous project and animates the scenes we created in Project 4. In this project we create a python file scene.py which imports other files to use functions we utilized in the previous project. In scene.py we create 3 sets of codes as I understand it. The end goal is to create an animation scene however that was a tall order so as a CS student, I decided to exercise top down design and broke the large complex problem into smaller parts. Instead of starting of by moving mountains, I simply created a design document to envision what I wanted to create. Then I created the first part of the project which was just the simple and complex shapes that created the objects such as trees or skies or sea which were the background for my scene. The second part was writing code that created the objects that I needed for my scene. As I was creating a racing scene, I created a rocket, a ship, a truck and an air balloon. The last part was writing a function to animate these using different rates of change in x values to demonstrate the rockets supremacy over other forms of transport. The project quite simply put helped us exercise our understanding of the Zelle Graphics package and improved our problem solving approach by helping break down problems into smaller parts.
Created 2 new complex shapes.
For my first task, I constructed two new complex shapes. The first is a truck that was inspired by Cars the Pixar movie and the other was a hot air balloon from around the world in 80 days. These will later be used in my scene. While testing the functions, I use a for loop to see if multiple images would work and Im happy to see that they did.
For part 2 I created a design document for my animation. I decided I was going to create a scene that depicted an all out race of different forms of transport.
Like any good race that has build up I imagined having three stages to my race. The announcement of 3 2 1 .. Go indicating the start and the end telling us who won.
In terms of a timeline, I start off with an intro which take places and updates at I = 25,26, 50,51, 75, 76 and 100.
After that up until the frames are less than 250 my objects race against each other and once they cross over out of the scene which depicts a finish line, the screen automatically goes to declare the winner.
For my third part, I learn how to animate objects to incorporate into my scenes that animate.
I have both my rocket and ship race each other as you can see in the videos.
For my final task, I animate and create the entire scene.
The scene incorporates my extensions which I will elaborate on further but specifically my scene is an animation of the great race and takes place over land, sea and air. There is a rocket racing a hot air balloon, a ship and a truck upon a gravely road set in a picturesque 2030 victorian race track. The scene starts with a cool Ready, Steady, Apple, GO to create suspense and at the end of the race there is a winner announced.
As many of my extensions were incorporated into the main video I thought it best to list all the extensions and explain them as opposed to creating different subheadings especially as many of them relate with one another. All these can be viewed in my complexhapes, scene python file or in my videos.
For my first extension, I thought it would be cooler to have more complex shapes so I created additional shapes like stars or skies which users can access using command line arguments. Entering 3 digits will create a night sky with stars or 2 digits which is just midnight or 1 which is a sunset. Moreover, I created roads for my truck.
For my second extension, I tried to give sense to my animation and animate more than the required 2. I also animate an air balloon and my trucks. Moreover I use the tracks and the flag at the end and the starting to give a coherent story to my scene. By using the race commands, I prepare the viewer for a race which I then animate.
For my third extension, I utilize text and import images to create different scenes to create two things any nice video needs. A start and an end. The scene starts by hyping up the viewer and ends by announcing the winner of the race which of course is the rocky Rocket. Both these are things I explored outside of class and learnt in my own.
For my last extension, I want to create some randomization so I use a list of colors that randomly colors my truck and air balloon (which moves in two dimensions, x and y) to simply add to the depth of my scene. The opening screens are also randomized to display different colors each time the simulation is run. The colors of the balloons also change throughout the animation to add some color to our scene.
- What role does the time module play in this project?
The time module controls the time aspect of the animation. It causes our functions to speed up or slow down using different options. Example: The time.sleep() controls the interval at which the code would sleep therefore letting us see and visualize the change being enacted during lets say a movement of an object on x y plane.
- What method of graphics objects returns the coordinates of the middle of the object?
- If you have a list of graphics objects shapes, how would you loop over the list and move each object 5 in the x-direction? Please show code.
for a in shapes:
- What is your favorite animated movie or TV show?
The legendary cars movie has always been my favorite and probably a reason I obsess over racing and other forms of transport so much.
This project was probably the first time that I understood the need for multiple files and the ease that comes with top down design. The idea of creating files with simple functions and just continually calling them using loops allows so much flexibility and control but also creates unlimited opportunities for collaboration. Another big takeaway was the importance of time management, with midterms nearly every other day of the week and Bruce not being at Monday TA hours, I really learnt the importance of debugging and using stack overflow to understand roadblocks and how to get through them.