Michael Leyden
username: mleyden
Final Project
Walk Cycle Animation
For my final project, I wrote a program that generates animated walk cycles for a three-dimensional character. A walk cycle is the pattern that a characters body moves when it is walking. A foot is lifted off the ground and firmly set in place as another foot is lifted. In addition to moving legs the characters head makes adjustments to keep balance. For this program the user is be able to specify how big the character is in relation to the distance being walked. This will affect the amount of motion per step needed to cover the distance. The character performs distinctly different motions depending on the speed the user defines. If the character is moving faster then it will take fewer steps with longer strides. If the character is walking a particularly short distance then it will take short strides.
For realistic motion by using a relation between the distances traveled in a step and the actual position of the characters feet. The joints connected to the feet align themselves in relation to the foot planted on the ground. The body is realigned when another foot is placed ahead of the first one. The variable of the time it takes to switch to the other foot is be used in determining the rhythm of a walk cycle.
The user interface gets values for how to scale the characters legs, the distance walked and the time taken to cover the distance. To change the distance traveled move the slider marked distance. To change the time spent walking move the slider marked velocity. With this input the program should be able to figure out what every step will be like. The user has controls lighting variables and the camera position. I do not plan on allowing the user to specify a three-dimensional path for the character to walk. When the user is ready a button is pushed to start walking. This button calls a function that plans out how the character will fulfill the given parameters and initiate the animation process.
In two-dimensional cel animation, walk cycles are made up of key frames drawn mostly independent of each other. The position of characters feet, hands and head follows oscillating paths. Motion generated by a three-dimensional program retains the same geometric proportions from frame to frame and makes changes in precise increments. A program is capable of setting key frames and following paths for many different joints and limbs at once. The program is able to give realism to walk cycles by handling more complexity in what a moving character is doing.
class CGL_Window :
private:
double rtx rtz values to move the camera
double ltx, lty, ltz
int started
int wait
float length, distance, progress, target
int duration
walk *figure
leg * up, *down
void draw_obj(void)
void
step()
legs:
leg
float upper;
float lower
float length
float foot[3]
float hip[3]
walk
float size
float distance
int duration
int steps
int transition
int run
leg *left
leg *right
float stride
float hip[2]
float pelvis[3]
float lhip[3]
float rhip[3]
This function
contructs a new walk cycle.
walk *makewalk(float
l, float d, int span)
void walkinit(walk
*cycle)
void sethip(float
x, float z, walk *cycle)
This function uses
inverse kinematics to rotate the leg so that it points at the foot.
void moveleg (leg
*bone, float x, float y)
This function
constructs a leg
leg *makeleg(float
x, float y, float z, float scale, float ox, float oy)
leg *getleft(walk
*cycle)
leg *getright(walk *cycle)