Friday, April 10, 2009

How to accelerate and decelerate masses for character animation in povray

Oftentimes in making character animation, I've received or heard criticisms about wooden, unrealistic movement. In many 3D applications, it is very easy to make a character move to and fro. The temptation is usually to make the "curve" look like a sawtooth. The character's body part (arm, leg, hand, etc.) moves in one direction for a while and then suddenly reverses in an instant. In most 3D apps, you have the option of tweaking the curves. Problem is, it's quite tedious in the more advanced 3D apps, and not at all obvious how to do in povray.

Note the animation below. The character on the left moves in the stereotypical "sawtooth" fashion. The acceleration and deceleration are instantaneous. The next one has a little more acceleration, increasing up to the fifth one. The sixth character moves in a sin curve fashion.

The way I derived these equations was to integrate x to the n times one minus x to the n. I did this for 1, 2, 3, and 4. The result of these integrations is shown in the formulas below.

I hope this will help someone in povray at some time.

No comments: