Ball Bounce Animation

Ball Bounce Final Product

Getting the Ball Rolling

I created the beginning of my ball bounce animation while following along in class, and so when I began to work on my own, I’d already added a translation along the X-axis and Y-axis as discussed (Y-translation 10 at frame 1, 0 at frame 12, 8 at frame 24, 0 at 34, 6 and 44, 0 at 52, and so on and so forth diminishing its height by 2 each bounce and each bounce decreasing in time by 2 frames on each arc).

I was, however, a bit lost on how to adjust my Translate-Y curve in the graph editor, as I seemed to have the wrong tools selected. I went back and reviewed the tutorials and managed to get it figured out.

I edited my translation curve in the graph editor so that it looked like this:

I also added in a couple frames after translation along the Y-axis hit zero, to allow for the ball to slowly stop rolling along the ground (I later changed this from 99 to 108 as it would allow me to work in a less messy 24-frame-divisible format). Happy with the timing of my ball bounce, I decided to move on to the final touches- rotation and squash and stretch.

I. The Squash and Stretch Struggle

Spoiler: I was severely mistaken in thinking of these as “final touches”, as the squash and stretch caused me the most frustration of all and ended up taking many hours.

I easily added the rotation first, keying rotation along the X-axis to 0 and ending it on -900 at frame 108 (a little over 2 and a half complete rolls). However, I quickly realized that by adding rotation first, I made it difficult to add my squash and stretch in afterwards, as my scale tool arrows pointed in different directions each time the ball hit the ground and I would have to go in and messily adjust each keyframe accordingly. So I deleted my rotation curve in the graph editor  and set to work creating the squash and stretch first. I worked for quite a while on it, adjusting it to my liking. When I was finished with my squash and stretch, however, I found it ended up messy anyway…..

I stared at this graph for a while, replaying the animation, before cautiously deciding that I liked the scale anyway and it was safe to move on. All I had to do now was add in my rotation. I keyed 1 for 0 again and 108 for -900. Immediately, problems arose. The ball rolled extremely quickly but only after it had finished bouncing.

I took a look at my graph editor.

It confirmed what I was seeing. It didn’t take me long to realize the cause, though- I have recently gotten into the habit of selecting “key all keyable” on every frame I work on each time I input a new number as a kind of “bookmark”. This prevents me from messing everything up by forgetting to key the movement of one tiny thumb joint- or, God forbid, an entire limb- and having to search endlessly to find which frame this was forgotten on. In theory this works, but I used this practice poorly by keying everything before adding some of the main components of my animation in.

In frame 80, I have Rotate Z set to 0 because everything is keyed. Thus until frame 80 the ball cannot turn.

I went into my graph editor under the Rotate Z curve and began deleting all keyframes except for the first and last. 

So that it looked like this:

Problem solved. Easy peasy. Or so I thought…..

I triumphantly pressed play and the ball rolled along the ground, but unfortunately, I ran into the same exact problem I had anticipated originally. As the ball rolled, my squash and stretch adjustments gave the ball the dreaded football shape and it clipped through the plane/“floor”. 

Football shape.

Football.

Infuriating. 

II. Troubleshooting the Issue

After a brief rage quit I realized part of the reason that it was so hard for me to accurately squash the ball while it was rotating.

I had been working the entire time with my scale pivot point in the middle of the ball. The pivot point needs to be on the top of the ball for a good squash. This is also the reason my original squash and stretch animation was so messy. I moved the pivot point to the top of the ball.

I deleted my entire squash and stretch animation (Scale-X curve) and decided to jump back in. But unfortunately, changing the pivot point also affected the rest of the animation I had already done, and (I believed) there was no way to create my squash and stretch to the best of my ability without changing the pivot point……and so, I ~started over completely~.

Not really so bad, actually- I got the X and Y translation down again in no time as well as adjusting the curve, and it was good practice. Right off the bat I made sure my pivot point wasn’t in the center of the ball. I actually chose the bottom, as it would be easier to ensure that the ball does not clip through the “floor”. This time I also made sure not to let myself automatically select “key all keyable”.

I also edited the X-translation curve so that the ball appears to slow down its rolling towards the end before coming to a stop:

….and came to the conclusion that this was a more effective way to give the appearance of the ball slowing rather than editing the rate at which it rotates, which I kept linear.

But as I got back into the squash and stretch, I realized that it doesn’t matter the order in which I’ve created my animations, the pivot point must stay in the same place throughout the animation or parts of the animation will be damaged. My “revelation” that the pivot point was the source of my problems was either not true or not relevant. I would have to either find a way to rotate the ball without moving the pivot point to the center or I could find a way to create a realistic squash and stretch with the pivot point in the center. I chose the latter, seeing no way to accomplish it the other way around (if the ball were to rotate around a pivot point on its exterior, it would cause unintentional translation along the Y-axis).

III. My Solution

The part of my squash and stretch that was giving me trouble in conjunction with my rotation was the ball clipping through the floor/stretching oddly when it hit, so I decided what I need to do in order to “squash” the ball to the “floor” realistically was make sure the pivot point is always at zero- aka not rotated- when the ball is in contact with the floor. So I went about my rotation differently.

I keyed the Rotate-Z channel to either 360 or -360 for each frame where the ball is on the floor. This way the pivot point stays at its original position, and the ball automatically completes a full rotation during each arc. As the ball slowed down towards its stop, I set the last cycle to go only from 360 to 180, and as the ball rolled to a rest I keyed the last frame for 210.

I intended to assign a simple pattern to the ball so that I could get a good idea of how realistic my rotation looked, but unfortunately, Maya crashed every single time I opened the attribute editor regardless of whether I chose phong, blinn, or lambert.

Disaster.

But, I managed to think of an alternative:

I was able to view the rotation via the direction the pivot was pointing, and this allowed me to learn a lot more about what needed to happen. I went back and alternated the frames between 0, -90, 180, 90, and 0 instead of having the ball complete full cycles between each arc.

It was still hard to see whether this was better without the attribute editor, but when I went to add squash & stretch, I did not encounter the football shape glitching through the floor. I carefully added my scaling following the classic format, as seen in this chart by Richard Roberts:

….applying this to Maya, I set all scale keys to 1 for each peak of the ball’s arc, and “stretched” the ball on each frame before and after the impact, “squashing” it on each frame impact.

Happy with my work, but noticing that the effect became a bit too intense towards the slow-down end of the animation, it was off to the graph editor, where I edited my scale charts, making sure the peaks declined over time.

IV. Final Edits and Peer Help

Thanks to the help of my peers (specifically, Crystal), I was able to get my attribute editor up and running and, as I expected, found that my rotation could use a little work. This is what my project looked like:

As you can see, the rotation clearly reverses briefly on the last half of the second arc and flips again at the end. I suspect this problem was created when I messed around with the curves in the graph editor.

Turns out I was right the first time about the rotation. Rather than completing cycles between 0 to 360 on each arc, the curve on the graph editor should look somewhat like a straight line,

(although those keyframes are necessary as the ball losing momentum + the pause at the top of each arc means that the rotation can’t be linear). Numerically the rotation values are decreasing by 90 at the peak and bottom of each arc, with the first frame being 1, the 12th being -90, the 24th being -180, and so on until -990. I’ve had the ball finish at -1130 as it slowly comes to stop.

The final product looks like this:

Leave a Reply

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