Friday, 20 May 2011

Crazy golf- animation

It's not quite complete just yet due to the fact that I am experiencing some problems, however the majority of my crazy golf animation is done! One of the best things about CG animation has to be the ability to animate select objects at a time, meaning that even though the golf ball was giving me trouble, I was free to continue animating the rest of the scene.

As with all our projects so far, the principles of animation were important to include. Though they are a little tricky to implement in some cases, I have taken the chance where appropriate to add elements of squash and stretch, exaggeration, anticipation/reaction and timing and spacing, which as you can imagine is crucial throughout.

Firstly, here is a simple video I created some weeks ago during a tutorial session at university. It features a bouncing ball, and was a quick exercise to get us acquainted with the timeline and 'keying' (the process of adding key frames by saving the positions, rotations etc. of an object at that given time). It also served as an introduction to the Graph Editor, whereby you can edit the paths and velocities of the objects. Oh, how I hate the Graph Editor...

video

Moving on to my crazy golf task, there were several important things to do before I began animating, helping to set up the scene so the rest could go unhindered. The first of these was rigging the golf ball; since it has a texture, you will notice whether it rolls correctly or not, unlike a plain ball. After looking at the animation tutorials on the VTC training website, I found a technique whereby I could make the ball automatically roll when a parented object is moved. This process used expressions. Unfortunately (and rather infuriatingly I might add), I could only get this to work in the one direction. As a result, and realising I would need some help, I made the choice to continue with the other elements and return to the golf ball later. Timing has been no problem since I knew exactly what timing I wanted from my initial storyboards, gauging it correctly with the camera movements. So far I have parented the golf ball with a locator:


Now for something that worked! Again using expressions, and thanks to this easy YouTube tutorial, I was able to make my windmill constantly rotate at a steady speed without the need to manually animate it.


Naturally, I needed to substitute the object names I am using for the ones in the video. My expression was as follows:


As said previously, I made sure to add squash and stretch to numerous elements of my crazy golf course, including the small flag. This was an important aspect since the flag needed to move a little in order to knock into the purple ball, initiating a chain reaction. To do this, I made use of the 'non-linear deformers', in particular the 'bend' deformer, which enabled me to, well, bend the flag!


Pretty much everything in Maya can be keyed as part of an animation. For deformations such as 'bend' and 'squash', you need to right-click the curvature (or equivalent) setting in the attribute editor, and set key (see image below). The image above shows the flagpole greatly distorted for the purposes of demonstrating its use. In the animation, it is a little more subtle.


The other non-linear deformer I utilised was the 'squash' deformer, which I applied to the purple ball. When it is hit by the flag, and when it hits the golf ball, it squashes slightly with the impact helping to give it a sense of mass thus increasing the believability of the animation. Applied in the same way as the bend deformer, the squash effect also requires being keyed via the slider that determines its level. 

I should also mention that each deformer has a set of 'handles' with which to manipulate the object. I knew the purple ball would have to squash on multiple occasions, therefore it was important to parent the handles with the ball, so that the two would move together.


As you can see above, the angle of the handle determines which direction the ball will squash. I positioned this such that the ball squashes side-on, as would happen with the side-on impact of the flag. The golf ball will also impact side-on of course, but from a different side- thus it was necessary to animate the ball to turn 90 degrees before it comes in contact with the golf ball. Conveniently, the rocky ramp obscures the ball from view for a brief moment, so I used this time to turn the ball so it will go unnoticed.


My first real animating exercise came in the form of the camera. Originally, I had planned to 'film' the animation through the default perspective view camera, but it dawned on me recently that this was impractical- I needed to move around in perspective view to modify the many objects, therefore I would lose all positioned camera angles. It was much more effective to add a new camera to my scene. You will no doubt have noticed the split-screen view in the last few images. This is a two pane layout featuring perspective view on the left and the new camera on the right. This way I could move objects etc. on the left, and at the same time keep a track of my scene to match my storyboards on the right. This process was very effective.

Unfortunately this is where my second major problem has occurred. When I render through perspective view, the quality is great (just like my previous rendered images). Without changing any settings however, when I render the scene through the new camera, the image is highly saturated, with ridiculously high contrast and a dark yellow tinge. I shall need to find a solution to this before I render my animation!

On the whole, animating my camera view was very successful. I achieved the basic movement with key frames, and then used the Graph Editor to smoothen out the motion. I have already said how I hate the Graph Editor! Joking aside, I am being honest when I say I find it very counterintuitive, and very unclear as to what changes will actually be made with any graph alterations. This is most likely evidence that I need to learn more about it. Below, you can see the graphs for my camera before and after my modifications:



Strangely enough, whilst I managed to understand the graphs for the camera eventually, I was not so fortunate with graphs for the purple ball and mallet later on, which I found very difficult to grasp. Things like slowing the movement down and speeding it up were not what I would have expected. I was particularly confused when moving a node in the X axis yielded the same results as moving in the Y axis. 

So, all that remains now is to animate the golf ball. Which in turn means finding solutions to my two problems! Nevertheless, here is a 'playblast' work-in-progress video of my animation running in real-time. Look out for the deformers as mentioned previously. Oh, and just try to imagine the golf ball rolling alongside the camera for now!

video

On a final note, You will have seen that I lengthened the beginning of the animation. Whereas my initial plans began with the golfer simply hitting the ball, I thought for some time about realism and reactions. I decided that it would be best to take a few practice swings first, complete with the golfer taking a step forward and adjusting his stance. In my opinion, this helps to set the scene, provides a short amount of time for the viewer to understand what is happening, and shows off my setting for a little while longer.

No comments:

Post a Comment