Last edited 09may03 by cappuhn@uiuc.edu
Find this document at http://archive.ncsa.uiuc.edu/Classes/MATH198/cappuhn
Jump to public

illiCat: An Articulated Animated Blobby Cat in OpenGL


Here is a picture of my cat. She is my inspiration for this project.

Click here to see my quarterly report.
Click here to see my final proposal.

Abstract

illiCat creates a blobby cat in OpenGL consisting of ellipsoids.
illiCat explores the notions of hierarchy and articulated motion.
The user is able to manipulate this cat. By pressing a number,
a body part is selected. The selected body part changes color.
By pressing the arrow keys, the user alters the position of that body part.
This is accomplished by a change in rotation angles.
The cat also includes a built-in animation designed to mimic the action of a running cat.

Narrative

illiCat started out as a copy of the illiSkel. Now it is obviously quite different.

The first step was to change the torus to an ellipsoid.
In the illiSkel, the torus is constructed by drawing a circle about a point
for each angle theta. In illiCat, each of these points is simply the origin.
While theta ranges from 0 to 360 in the skel, theta ranges only from 0 to 180 in the illiCat.


Here is a picture of illiCat at an early stage of progression.

Next came the issue that took the longest time: the hierarchy.
To make the hierarchy work, first it must be determined which body parts are connected to what.
For the illiCat, the following shows the general breakdown.

Body
--Head
----Mouth
----Right eye
----Left eye
----Right ear
----Left ear
--Tail part 1
----Tail part 2
--Right arm part 1
----Right arm part 2
------Right hand
--Left arm part 1
----Left arm part 2
------Left hand
--Right leg part 2
----Right leg part 2
------Right foot
--Left leg part 1
----Left leg part 2
------Left foot

In order to work properly, the code must generate the cat based on this hierarchy.
This is accomplished through the use of glPushMatrix and glPopMatrix.
glPushMatrix makes a copy of the coordinate system with the origin at the current location.
All commands after glPushMatrix take place in this new world.
All translations, rotations, and object placements are done with respect to the new coordinate system.
glPopMatrix takes you back to the previous world, the one before glPushMatrix.

Here's an example of using these functions:
Suppose that you're in the world of the body and you want to draw the tail.
First use glPushMatrix to enter a new world. Call this the world of the base of the tail.
Translate to the base of the tail and rotate as you want the tail to be rotated with respect to the body.
Use glPushMatrix again to enter the world of tail-part-one.
Translate to the center of tail-part-one and draw tail-part-one.
Use glPushMatrix to enter the world of the tail joint.
Translate to the tail joint and rotate as you want tail-part-two to rotate with respect to the tail joint.
Use glPushMatrix once again to enter the world of tail-part-two.
Translate to the center of tail-part-two and draw tail-part-two.
Finally, use glPopMatrix four times, one for each glPushMatrix.
You have returned to the world of the body.

Click here to see the code segment I use for the hierarchy.
Note that this segment by itself will not compile.

The next important issue was animation. The illiSkel has a built-in
animation in a function called autotymer. To animate the illiCat,
I simply altered the autotymer and renamed it catAnimate.
Within this function, I altered various rotation angles to create
the desired effect of the cat running in place.


Here is a picture of illiCat with hierarchy and animation included.

The last issue to conquer was the coloring of the cat.
This was a matter of texture mapping.


Here is a picture of illiCat in its latest version.

Bibliography and Thanks

As this program is based on the illiSkel, a lot of source code from the illiSkel
is contained in the code for the illiCat, so I should probably include the illiSkel
in my bibliography:

illiSkel-2002 by George Francis, Stuart Levy, Glenn Chappell, and Chris Hartman.
--University of Illinois. 1995-2002.

I would like to thank Professor George Francis for all his help.
I would also like to thank the many students in my Math 198 class for any
comments or input they have made throughout the semester.