The Ball Maze

  1. Creation of the Ball Maze

I began first with creating the maze, envisioning the animation I wanted and the way each material would interact with the ball. I realized quickly that I should create a storyboard and drew one out, breaking the animation into four segments.

Storyboard

While sketching my storyboard, I traced over a PNG of my maze setup to give myself an accurate sense of spacing. As I did so I became aware that some objects needed to move down or up, etc, in order for my intended animation to work. So, after completing my storyboard, I went back into Maya and finished creating the scene, re-spacing, and tweaking color and translucency on both the funnel and “trampoline” to allow my animation within the objects to be displayed. I also added a material to the ball once again to view my rotation more easily. 

Ball Maze Setup

Time to get rolling!

  1. First Segment- Day One

Animation 1 was the easiest, as I was expecting. It helped me feel out the space I’d created and the physical characteristics of my little basketball. In this first segment, the ball simply slides down the ramp and whams into the wall on the right. 

I spent some time adding a very small squash/stretch bounce as it reaches the bottom of the ramp, giving it a little momentum from its downhill roll.

The curve I spent the most time on was definitely the Translate-Y curve, as I debated back and forth how noticeable I wanted that little bounce to be. A longstanding goal of mine is to be better at animating from the graph editor and having to rely less on key frames.

As the ball smacks into the wall, you can see that I’ve added a small pause there for the full effect of this exaggerated squash. The next segment will be almost entirely squashes as the ball ricochets off the lower level walls, and this pause creates anticipation.

  1. Second Segment- Day One

This one would be more complicated, and I knew it would require a lot of patience and attention to detail in regards to my squash and stretch as well as timing.

Before anything else, I keyed the Y-Translations, using my storyboard as a guide.

Much timing as well as squashing work will go into this, not to mention the exaggerated stretch of my “trampoline” that will be added in to anticipate launching the ball out in segment 3. Most importantly, though, I needed to make sure that the actual points of contact look convincing and accurately represent the laws of physics- the worst scenario would be to do all that work on each “pose” and then realize the trajectory looks off.

The biggest difficulty I faced when I got started was attempting to make the impacts look realistic. I started off like this, which looked completely incorrect:

But realized quickly after taking a second to think analytically that both impacts must be linear at their peaks. I rewatched the lecture from the ball bounce exercise- we made those points along the ground linear because due to gravity/momentum the ball must come right down and right back up- otherwise it will appear that the ball is floating or being pulled along. The part of the curve that can be changed can only be during the ball’s trajectory. 

I changed both curves to linear, but the effect confused me….

Despite my changes, the ball still appeared to be sailing along in the air, and barely hitting the “ceiling” at all. Experimentally, I attempted to replicate the curve I had on the first bounce (from the wall to the floor), as that one looked more realistic:

This time, the ball certainly popped up noticeably, but it was clipping through the ceiling and pausing oddly. 

Once again I sat and thought for a long while, breaking down the issue rather than just putting a lot of work into random guesses. I came to the conclusion that the entire arc of this bounce must be linear, and in fact it has to happen a lot sooner. The ball moves almost straight upwards, with great momentum from its fall, and travels a much shorter distance than it did on the first bounce. Therefore it must happen a lot faster, with no time for a lazy, bouncy trajectory. Both the second impact and its journey into the “trampoline” are affected by this and must be mostly linear to convey the ball’s weight and the speed it has gathered.

I moved the keyframes up and adjusted the graph accordingly.

Voila, the completion of Segment 2. I allowed the ball to slow a little at the point where it is caught by the trampoline.

  1. Third Segment- Day One

I had intended to leave Segment 3 for another day, as I knew how exhausting Segment 2 would be (it was), but I was so excited to do this short and exaggerated, cartoonish little clip that I decided to plunge into it for fun.

This segment is my favorite part of the ball maze. In this clip, I’m using the secondary action of the “trampoline” to give an emphasis to my basketball’s weight and momentum. I also get to use some overlapping action here as the trampoline snaps back into its original position after the ball has already left its net, not only reminding us of the ball’s weight but giving an idea of the material and weight of the trampoline, too.

V.  Final Segment/Finishing Touches- Day Two

This segment proved to be more challenging but not overly so.

Continuing my personal challenge to use as little key frames as possible and animate from the graph editor, I discovered that I could key only the back-and-forth translation and simply exaggerate the slope in between, in order to cause the ball to appear to be travelling around the curves of the funnel rather than across it. I felt very triumphant in this discovery.

Spiraling down the funnel.

However, as I excitedly showed this to my partner, he pointed out that due to the ball’s momentum, it would not immediately begin spiraling and instead would smack back and forth on the first couple bounces before beginning the spiral. I watched it many times and decided he was right. I sadly deleted my first arc on the graph editor to create this more realistic animation:

And so I decided I was done. I had a lot of fun with this little project, challenged myself, and came out a better animator for it!

Final Product:

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: