[ODE] movement force conversion
Jon Watte
hplus-ode at mindcontrol.org
Tue Mar 15 09:25:46 MST 2005
> that is what interest me in longer time, but now before any
> research: it is possible to turn stored forward kinemtic animation
> into forward dynamics?
Absolutely.
I'm assuming a rigid skeleton with ball joints, but you can
generalize to any kind of joint that your animation uses:
For each frame, pose your animation skeleton the way the
animation wants it for the NEXT frame in time.
Then, for each body in your dynamics skeleton, measure the
angle relative to its parent, and compare to the animation
skeleton. This gives an angle error in parent-relative space
for each bone.
Now, calculate the torque necessary to move the body to the
desired angle in the next timestep (or in some amount of
future time, of you want a more dampened fit). Optionally
apply maximum joint torque constraints. Apply this torque to
the body. Step the world. Yay, you're done!
For position constraints, substitute "movement" and "force"
for "angle" and "torque".
If you want to support external forces like holding things,
you should also keep an error accumulator, and add in some
multiplied factor of that error to your force, so that you
will compensate for being off in a specific direction for
many steps.
The Wiki says that all pages are read-only, so I can't add
this information here. (It should go in the Tips and Tricks
section).
Cheers,
/ h+
More information about the ODE
mailing list