I was inspired to replicate some of the animation techniques found in David Rosen's 2014 Game Developer Conference presentation on procedural animations in video games:
I wanted to implement full "walk" and "run" animation cycles from a few keyframes. I was surprised that reasonable-looking character motion could result from interpolation alone. I also wanted to create blends between animation cycles; Such blends are essential to matching animations with player input in video games.
I first needed a walk, run, and idle animation. I selected a few suitable ones from mixamo.com.
I was building from our Assignment 2 on linear skin blending that used world space skeleton information. Dr. Sueda instructed that I would need to interpolate between the local space joint angles of the character skeleton to produce plausible blends. To do this, I used his fbx-extract utility to generate hierarchical character skeleton information from the mixamo.com data.
Once I was animating using the bone hierarchy, I selected 9 keyframes that roughly matched the poses in Rosen's GDC video: 2 "pass" and 2 "reach" frames each for walk and run and 1 idle keyframe.
I next worked to create a sparse intermediate "jog" animation. I determined a rate for the animations to play based on player input. If the rate was between the full walk speed animation and the full run animation, I would interpolate the joint angles proportionally to the rate.
Since the joint angles made extreme transitions, I used GLM's spherical linear interpolation on the local space joint quaternions. It was also important to have the character's feet roughly match locations in the keyframes (depending on which foot was moving forward), which I established in my keyframe selection.
I now had very sparse animations. Next, I needed to interpolate intermediate frames. The ratio of the player speed to the application frame rate gave me the rate at which I should transition the interpolation factor for each frame.
I could now generate several animations from a hand full of frames.
I had hoped to give the player control over moving with the associated animations, and I will implement that feature next.