[ODE] Can't edit the Wiki

Jon Watte hplus-ode at mindcontrol.org
Tue Mar 15 09:25:46 MST 2005


I can't add anything to the Wiki, so please someone with access 
add the following text to tips-and-tricks:


How to turn an animation into dynamics forces:

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.


Cheers,

			/ h+



--
  "Unix and C are the ultimate computer viruses."
                               -- Richard Gabriel

 




More information about the ODE mailing list