Last edited 12May06 by eecheva2 AT uiuc PERIOD edu
HorseWalk: An Exploration into Animation 2006
The University of Illinois's CAVE and CUBE provide two unique virtual environments. Among the various applications for the CAVE and CUBE, animation examples never cease to amaze and entertain. While modeling and sculpting avatars require sophisticated software and careful detailing, constructing blobby avatars is relatively quick and efficient. A hierarchy of objects in a blobby can easily connect the joints of an avatar but leaves the animation of the blobby for some means of creative implementation. In consequence, my project will develop a way to animate blobby figures.
Professional computer animation of horses, as in the Lord of the Rings film trilogy utilized a motion capture system, which quickly and easily calculates angles and rates of change in the movements of the parts of a horse but there are cases in which motion capture is not applicable. For example, a museum wanted to display a digitally animated Tyrannosaurus Rex. The animators of such a project had to animate the T-Rex by moving its opposable joints with the degree of rotation desired to simulate a conjectured gait for the T-Rex. Because of such physical limitations (no one can strap motion capture devices to a fossilized species and expect to get a digital animation of it!) and financial limitations that reduce the practicality of motion capture animation, easily implemented program designs to be used in conjunction with any standard graphics library is highly desirable.
My Motivation for this Project
My interest in 3-D graphics quickly grew after experiencing and enjoying 3-D graphics on my Nintendo 64 system. CGI animation for movies such as Toy Story and STAR WARS also fueled my interest in 3-D graphics. I have always had an unexercised artistic interest in animation in general. To work on an application that could potentially be in the CAVE or CUBE was a thrilling chance for me to dabble in artistic design, and I am quite pleased with how visually satisfying an animation would be.
My Inspiration for the Blobby Horse
From an early age I developed an unbridled love for horses as gorgeous creatures with fiery inspiring spirits. Pouring over photographs of horses and absorbing horse dictionaries by the bookshelf load, I quickly expanded my knowledge on the various breeds of horses, their gaits, and their traits. I spent many a day doodling horses on notebooks, trying to capture the essence of what I enjoyed so much about this animal. But this 2-D static medium was a poor representation of my beloved animal because its beauty came from not only its physical features but also its movements. As a result, to construct an articulated model for animating would finally fulfill my long standing hope.
My first task was to understand the hierarchy of a blobby man. To investigate this I examined William Baker's Blobby Man and Ryan Mulligan's Blobby Man and Blobby Dog. I modified the Blobby Man program, to construct a horse by correctly linking the frames (each frame represented a joint in the horse) and the body parts of the horse to the appropriate frames. The next task was to generate image frames that would effectively animate the horse's movements. The most basic of Vpython animations was in the example program bounce.py. In this program a sphere object was declared and an attribute of the sphere was velocity. It was feasible to assume that the velocity attribute called upon a function to animate the object with a velocity by stepping through frames that have the ball's position at an incremental distance away from its previous position dependent on the value of the velocity variable. To move a horse's legs the leg would have to be rotated at each joint in a different direction and a different angle. Vpython had a predefined rotate function for frame objects, but this yielded crude, choppy animation. It was necessary to split the rotations so that the transition of the leg from one position to the next was smooth.
The secret behind a successful animation came in a function that encapsulated python's rotate function (a function that multiplies a frame by a rotation matrix). I have called this function bendjoint() and implemented the function to allow several parameters to be passed in so that the needs of bendjoint() for a particular animation task can be easily accommodated. bendjoint() will animate a series of rotations simultaneously by accepting a list of frames and angles. The rotation angle for each frame is divided by the number of image frames desired. (A higher number image frames slows the animation because the illustration of the rotation is more gradual.) To animate lateral movement the central frame of the blobby must also be incremental moved during the rotations so that the movements of the joints appear to propel the blobby forward.
With the success of animating the motion of the horse, the addition of a human blobby as a rider would explore the realm of attaching two puppets together so that they may move with each other, and then separating the movements of the puppets. This task would require attaching the frames of the two blobby puppets initially, and then separating the frames from each other by detaching one and reattaching it to a stationary frame. The difficulty that arises from this is that several translation and rotation matrices are multiplied onto the central frame of both puppets, and these matrices are lost when reattaching a puppet to a different frame.
The walk gait is very realistic on the horse, and the rider can be made to fall off the horse. The function bendjoint() can be easily altered to fit any animation's needs. Because of bendjoint() it is possible to create more lists of frames and angles to further animate the horse to step through several gaits.
Description of the final program HorseWalk.py:
HorseWalk.py is a real-time animation of blobby horse walking in the virtual environment that can be paused by the push of a button. Through a series of rotation and translation matrices the blobby horse walks back and forth while carrying a cyan rider on its back. After a while the horse tires of its human passenger and bucks the rider off by rearing on its hind legs. After lightening its load, the horse changes its color every time it turns. This is truly one AMAZING Horse of a Different Color!!! ^-^
The anatomy of the horse lends itself to natural naming of parts and joints in the blobby horse puppet and helps define a natural hierarchy for the joints. Creating puppets that have easily understood names helps debug any erroneous behavior of the puppet and assists in the upkeep of the problem. Understanding the basics of animation as a series of image frames was central to generating the smooth rotation of the legs of the horse. By knowing the beginning and ending frames of a particular animation the angles of rotation can be discerned and then the bendjoint() function will divide up the over the course of a set number of image frames. The number of image frames can be altered to alternately speed up and slow down the animation.
To be improved upon
To create more gaits for the horse a different set of arrays of frames and angles would have to be added to the program and a feature to toggle between the various gaits. Another area for possible improvement would be to develop a function that can compute the number of frames and the lateral movement offset for a real-numbered speed. In this way, bendjoint() can be more user friendly by only having to change a parameter for the speed of the horse and adjusting the variables that the speed affects in the animation.
Click pictures to enlarge
See it walk!
Click the pics!
Here is a link to the documentation
Here is a link to the source code
I <3 horses!