Midterm Part 1

My inspiration for the project was the background picture on my laptop which is the night sky. Originally, I wanted to create a solar system where the user can interact with it and add stars and constellations. I changed my mind after seeing a picture of a shooting star and decided to implement that idea. In my final sketch, I hope to have a house with a tree in the backyard where the user can create the stars in the sky by clicking their mouse and simulate a shooting star by hitting a key on their keyboard.

I have already created my House, Star, Tree, and Moon classes and I still need to finish the Moon and Star class and create the shooting star effect. Right now, the color of the roof, door, and house change randomly, but I may refine the colors or limit their changes. The color of the tree changes randomly to simulate the changing of the seasons. White represents winter, pale pink represents summer, green represents spring, and orange represents autumn. I have used the mousepressed function to allow the user to add stars in the sky, by next week I would like to have the stars rotate in the sky. I have created multiple classes and used if statements. To finish the project, I need to learn more about arrays and rotation.

 

https://www.openprocessing.org/sketch/512793

Midterm Part I

The basic framework for the sketch I made over the first week is very random. It consists of a character that bounces wall to wall – every time it bounces it’s face and expression change back and forth from a rectangle to an ellipse. The color and general shape change as well, and 8 smaller ellipses are released upon collision with the walls. At any point, the user can take over the character with the arrow keys on the keyboard. Clicking the mouse will produce a spinning “flower” at the point clicked.

Over the next week of this process, I would really like to expand on my current sketch by fleshing out the character a little more. I really don’t know what the final product will look like, but I’d like it to be some sort of game where the character’s expression changes every time an event happens – for instance, a painful expression might appear when it collides with the spinning “flower.”

To do this, I will definitely need to utilize classes and objects, to make all my code efficient and to make user experience easy. After learning arrays and GUIs, I might use them to add to my sketch or even take it to a whole other direction. I mostly draw inspiration from what we do in class, where we do a lot of examples with bouncing balls and I wanted to take that to the next level.

Link to sketch on openprocessing:

https://www.openprocessing.org/sketch/512801

Week 3 Animation Assignment

The animation sketch was fun and it allowed me to explore the different coding principles and processing syntax we have learned so far. For this animation, I was trying to make it so that there was an acceleration effect on the balls. I did this by using some of the physics principles tied to wave. Additionally, using trigonometry, I was able to make it so all the balls meet in the middle. Playing with the mouse pressed function was also a great experience. As of now, I look forward to working with Object Oriented Programming to divide any future program into different objects and classes and just take more control of the program as a whole.

https://www.openprocessing.org/sketch/509935

Week 3 Animation Assignment

For my animation assignment, I tried to explore the animation law of “squash and stretch”. To do this I decided to pay homage to one of my favourite shows growing up, “Dragon Ball Z”. In the show, the main character “Goku” has a signature move called a Kamehameha where a blue burst of chi energy is fired from his outstretched hands. I wanted to emulate the same movement using a similar code to last week’s “bouncing ball against the wall”, but tweaking it so the object can expand as it moves. Additionally, I used a 3d Sphere rather than an ellipse to experiment more with 3d objects in Processing.

Sketch: https://www.openprocessing.org/sketch/510129

Week 3 Animation Assignment

For this project I wanted to create everything myself, without using any of the same code we used in class or trying to make anything similar to what we did in class. The principles of animation/life that I wanted to show were squash and stretch and timing. What I ended up creating was an animation of a ball bouncing from the left side of the screen to the right.

I actually struggled a lot with this project. My code was not very object oriented and I feel that I didn’t go about creating the layout in the best way.

I decided to correlate the xPosition of the ball with frameCount, which I figured was a good idea since in physics, by the laws of projectile motion, the velocity in the x Direction shouldn’t really change unless something acts upon it. However I made the decision to also connect the Y-Velocity to frameCount, thinking only of the first stage of the drop, where the velocity needs to pick up as the force of gravity acts upon it.

I decided to break up the animation into 3 stages: 1) the ball drops, 2)while on the ground, the ball experiences vertical compression and a horizontal stretch as it bounces, 3) the ball bounces back up into the air and out of the frame.

The flaws to this approach, at least in my execution was a disregard for later stages when focusing on the current stage, resulting in inconsiderate variable creation and design (i.e. yVelocity being directly correlated to frameCount). Because yVel is in direct correlation to frameCount, the ball exhibits this strange behavior where it bounces and leaves the ground with much more speed than it hit the ground with, as if charged with energy while on the ground.

Some areas for improvement on this project would be making it repeatable (not only executing once, but the animation restarting after completing the bounce), adding more bounces that are progressively lower, and fixing the velocities to mimic reality more closely. It would also be really cool to see this in 3D!

You can see the project here.

Week 3- Animation

For my animation, I tried to make a spinning object move on a sine curve while speeding up and slowing down depending on where it was on the curve. I also wanted to have the shape of the spinning object deform as it sped up, and go back to normal as it slowed down. I was having a tough time trying to get the spinning object to change its shape once it hit a certain y coordinate. I just couldn’t figure out how to have the shape gradually deform, or o have the speed gradually fluctuate. I’m still having a hard time putting everything we learned into practice.

https://www.openprocessing.org/sketch/509976

Week 3 – Animation

For this assignment, I tried to emulate the squash and stretch from the video that we watched in class. It was manageable to figure out how to make the rectangle bounce off at a specific y-coordinate since it was similar to what we worked on in class, except for the fact that I had to find a way to slow down the drop speed after every bounce. I had no idea how to animate a stretch and squash, so initially, I came up with a very choppy animation, in which when the rectangle is ascending, the object would abruptly change its height. However, after playing around with different incrementation operations, I somehow managed to make something more natural. The animation would have been more dynamic if I was able to find a way to change the speed of incrementation. Also, I could not figure out how to stop the bouncing.

https://www.openprocessing.org/sketch/509963

Animation assignment

I chose to make a square block that seems to be rolling and is it rolls it gets bigger. The main difficulty I had with it was trying to get it to rotate and getting the 3d shape. Once I figured that out it wasn’t too difficult asides from the fact that I can’t figure out how to make the box roll in the middle always now it starts off rolling near the top and as it gets bigger goes to the bottom. My animation follows the following rules from the illusion of life. It follows #6 slow in and slows out if you analyze in the middle it becomes a square shape and you cant see its 3d nature. You can then see it again when it is slowly coming in and slowly leaving. It does follow # 7 arc as its rotation does cause it to go in a circular movement. Please see my animation in the link below, thank you.

https://www.openprocessing.org/sketch/509956

Animation assignment

For my animation, I wanted to use realistic physics based on knowledge I learned taking my physics class, so I created an arc.  At first, I used frameCount and frameRate to incorporate them into the equations, but it wasn’t working right. The ball’s movement was highly irregular and bounced back and forth quickly, and I learned that that was because the frameRate is not constant. I then realized I could simply create a new variable called time and change the “Time” manually by using increments.  It was definitely confusing visualizing these equations this way, but It was fine after some time experimenting. One thing I had trouble with was having the “cannon” look more like a cannon by using a rotated rectangle jutting out of the sphere. For the life of me I could not understand why the rotate was not working the way I wanted to. So I simply left it as a circle.

Animation Assignment

For my animation assignment, I decided to make a ball drop. In order to do this, I decided to take what we learned before and apply it. I made my ball drop with almost like a shadow behind it- to make the drop look more realistic. When we see things drop in real life, we do not see the objects as it is while it is dropping. We usually see a fast blur, and that is what I tried to do with my code. I also made the ball bounce, like how it would in real life.
This is the squash and stretch principle from the video, especially the stretch.

I think I could’ve made my ball bounce few more times for more of a realistic animation, but that became a challenge to me. I couldn’t really figure out in time how to make the ball bounce multiple times, so I stayed with one. Having only one bounce makes the animation more timid and unnatural.