Transition between traditional animation and physics based

vagr
Posts: 13
Joined: Tue Mar 18, 2008 1:08 am

Transition between traditional animation and physics based

Post by vagr »

Hi

I want to build the animation in games blended with traditional animation and physics based one: here is my plan with ragdoll effect:

Pipeline or procedure is:

1. Traditional animation with collision detection check.
2. Once collision happens, switch to Ragdoll
3. RagDoll will drive the skeleton now.

My question is in step 2, once we need to switch, we are given information is skeleton structure, which is composed of several joints (not physics joints / constraints), which are described by transformations. Once we baked local matrices. We met problem how to set the rigid body transformation. Because we can not set rigid body on those joints but have to between them. (For example, rigid body has to be aligned with bone)

My 2 cents here is just based on translation of two joints:

1. Compute vector V from joint 1 to joint 2
2. Use the mid point between joint 1 and joint 2 as mass center of rigid body. (Translation in the transformation of rigid body have been finished.)
3. We need to build rotation part of transformation. How to build it?

Could anyone help me with that?

Thanks a lot in advance!
binofet
Posts: 20
Joined: Fri Jun 15, 2007 5:03 pm

Re: Transition between traditional animation and physics based

Post by binofet »

We have a 1 frame animation in 'jesus pose' we place all the rigid bodies we where we want them, then we compute the difference between rotations between rigid bodies and the animation joints we want to link them to. then when you want to pose your ragdoll all you have to do is get the animation rig bone matrices and multiply by your differnce matrix.

Best way to really do this is to allow the artists to graphically link rigid bodies to a rig. (This is quite a big project in its self). But this allows you to have many different ragdolls for you various characters, all with appropriate rigid bodies and limits. And it gives the artists the ability to really get it perfect (hard coded ragdolls are not fun to work with at all).

Hope this helps

Bino
vagr
Posts: 13
Joined: Tue Mar 18, 2008 1:08 am

Re: Transition between traditional animation and physics based

Post by vagr »

Thanks for describing the pipeline here and I agree with you. I assume that difference matrix here is defined as M_dif.
binofet wrote:We have a 1 frame animation in 'jesus pose' we place all the rigid bodies we where we want them, then we compute the difference between rotations between rigid bodies and the animation joints we want to link them to. then when you want to pose your ragdoll all you have to do is get the animation rig bone matrices and multiply by your differnce matrix.
You are right that artist will be able to create this for initial state of RagDoll. While later, we need the RagDoll to drive the skeleton. This time given the world transformation M_rb (rigid body), how could we compute the world transformation M_joint for joints in skeleton?

It is possible to use the inverse of M_dif, however, will there be some artifact in that? A possible example is that when character twisted his arm (by some external force?) it is possible that elbow is fixed (in real world it may be twisted a little bit) but if we simply apply this twist on elbow, then we will have elbow rotated and may bring wired effect on skinning?)

Thanks a lot in advance.
binofet wrote: Best way to really do this is to allow the artists to graphically link rigid bodies to a rig. (This is quite a big project in its self). But this allows you to have many different ragdolls for you various characters, all with appropriate rigid bodies and limits. And it gives the artists the ability to really get it perfect (hard coded ragdolls are not fun to work with at all).

Hope this helps

Bino
binofet
Posts: 20
Joined: Fri Jun 15, 2007 5:03 pm

Re: Transition between traditional animation and physics based

Post by binofet »

I may not be entirely clear on how you need your system to work.

After a second read it seems like you are after a animation/ragdoll system that works together to keep an animation from ever causing a part of the model to penetrate a world object? This is a much tougher problem than just releasing a ragdoll on death.

It's not too tough to extract inertia from the animation to feed the ragdoll, but it seems like a real tough problem to gather collision data while animating a model and use that data to do some kind of IK to get the models arm out of collision (while keeping the rest of the model in some fluid animation). If that is what you're after, I can't help you too much because I'm a long way off from that myself! If that isn't what you're after, I'm sorry for being confused. :)

Other than that, I don't see how the arm example you give comes up. The constraints you give the physics ragdoll are defined to keep the bodies from doing anything wierd with the mesh. The only time I notice anything wierd happening with our ragdolls is when a force is great enough to violate said constraints (takes quite a bad frame rate or a ridiculous force, bullet is pretty stable ;))

Our system is pretty simple.
We have a capsule that surrounds the character. When we want the character to ragdoll, we remove that and add the joints/rigid bodies for the ragdoll to the collision world. Apply some impulses to the bodies and you've got pure magic. Beyond that sounds difficult to implement and expensive.

Wish I could be of more help!

Bino