rwijtman
W1131612

Bone and Muscle Animation

By Robbert Wijtman

Description:
This project will model a very basic form of Ragdoll physics (Wikipedia). It will simulate the bone and muscle structure the human body in order to animate realistic motion of limbs. The "physics" aspect will slightly less complicated than a full ragdoll physics engine would require. There will be no gravity to affect movement, or pull down on limbs. Motion will be acheived by contracting the muscles, which will in turn pull tendons which will then move the bones. These movements can be set in a pre-defined sequence or triggered by the user.

Goals:
Pretty simple:

  1. Realistic movement of a skeleton using muscles and tendons
  2. Proper rendering and animation of said skeleton

Implementation:
The first goal, realistic movement of a skeleton, will be accomplished by using bones, muscles, and tendons. As indicated above, the muscle will recieve a contract or release command, which it will then translate to pulling on a tendon. This pull on the tendon will move the bone that the tendon is attached to on the other end, thus accomplishing motion.

A muscle will have a limit to how much it can contract. This limit will likely have to be set manually while building the structure. Tendons will grow or shrink as the muscle is loosened or tightened. I do not know if this is how tendons operate in reality, but it is the simplest way to get them to move a bone. Once the length of the tendon has changed, the bone it is attached to will attempt to maintain that distance, and will be forced to rotate around its "joint" in order to do so.

The tendon is "attached" to the midpoint of a bone. To figure out the required rotation of the bone in order to maintain the proper tendon distance we use the following formula:
let tPoint be the new endpoint of the tendon
let mPoint be the old endpoint of the tendon, the midpoint of the target bone
let sPoint be the starting point of the target bone, the point which we are rotating along

// normalize vectors so that "sPoint" is the 0,0 origin let adj_tPoint = tPoint-sPoint
let adj_mPoint = mPoint-sPoint

// use arctan2 function to calculate the angle between the two vectors
let angle = atan2(adj_tPoint)-atan2(adj_mPoint)

The target bone is then "rotated" around its startpoint by the angle using this formula:
It's impossible to explain this formula without an image, which I don't have right now. I do have the formula though.

Children of the target bone must be rotated using a slightly different formula:
Again, impossible to explain without an image.

Rendering the skeleton is slightly trickier. The only structure that actually "exists" is the bone. The tendons have both a startpoint and an endpoint, and so can also be rendered easily. However the muscle doesn't actually exist at all in the 3D world. I plan to render it using gluSphere, but gluSphere can't take in two coordinate points and draw a sphere between them. It needs rotation, translation, and scale.
For scale I simply use half the euclidean distance between the startpoint and endpoint. This scale is applied to the x-axis.
For translation I use the midpoint of the bone.
Rotation is only done on the y and z axis, since the stretched sphere will be symetrical on the x-axis.
I obtain the rotations by the following formulas:
I have not completed this formula

Timeline:
I have broken the project down into the following parts:

  1. Muscle class: 2/6/11
  2. Bone class: 2/10/11
  3. Tendon class: 2/14/11
  4. Skeleton class: 2/15/11
  5. Rendering: 3/1/11
Since rendering the animation will be the most complicated part of this algorithm, I have given it the most time.