Tim Green

CMPS 161

Final Project Report

Due 03/18/02

"Virtual Creature"

 

My final project allows the user to control a virtual creature by typing in commands. The simulation starts out with a creature in a room by itself. He will only do something when the user tells him to. For instance, if the user types "walk", then the creature will start walking. On a more advanced level, if the user types "jump", then the creature will first crouch down, then jump then crouch again, then continue whatever it was doing before. This process contains three different sets of key frames. The main idea behind my program is combining sets of key frames.

The commands in the user prompt will control everything the creature does. The notation will be for the most part, ( <action verb> the <noun> ), and you can also simply state some commands as only an action verb. The commands I plan on adding are as follows. "Walk", will make the creature start walking. "Run" is the same as walk but faster and different motion. "Face" (noun) as in "face ball1" will make the creature turn around until he is facing the object. "Sit" will make the creature crouch down. "Stand" will make the creature stand up. "Jump" will make the creature jump in the air. If the creature is doing something before you type jump, it will continue doing that thing after it jumps. Also note that pressing 'h' at any time will show all of the help information.

The environment that the creature lives in will consist of only two other balls. This is to give perspective to the creature. Typing "face ball1" or "face ball2" will make the creature change its angle. This is to give a new perspective. Also at any time in the simulation you can use the arrow keys to move the camera around. Up key is to zoom in. Down key is to zoom out. Left and Right key are to rotate about the y axis. Page up and Page down are to rotate about the x axis. Home and End key are to rotate about the z axis. The graphics of the creature and the balls are somewhat advanced. I've used multiple polygons for the creature and balls. All of them have texture mapping and lighting added to them. This light emanates from the camera so you always see the bright side of an object. I have also interpolated normals between each polygon to add a continuous look to the objects instead of being blocky. You can turn this on and off with the space bar if the animation starts to get slow. You can also turn alpha blending on/off with the 'b' key. And you can turn on/off line rendering with the 'l' key.

The animation of the creature is based on key frames. So let's say there are key frames for walking. Then when he is walking the motion will interpolate between these key frames. Now if the user tells the creature to start running. It will continuously be picking between at least two key frames and interpolating between them. But if it isn't finished going through a set of frames and the user types crouch then it will start interpolating between three frames. This gives a very fluid and realistic animation to the creature. Here is a short clip of the creature running.

 

 

 

Figure 1. The creature is jumping.

 

Figure 2. The creature is running.

 

Figure 3. The creature is sitting.

 

Figure 4. Combination of three key frames: standing, running and sitting.