Animating Breathing and Other Subtle Motion

From Second Life Wiki
Jump to navigation Jump to search

Many animators report difficulties with subtle movements. One of the most subtle movements one might need to animate is breathing, and it's also one of the most common tasks a animator will face, since almost every animation should include breathing.

Hopefully this article will clear up some misunderstandings.

Breathing

Breathing is simulated in Second Life by rocking the chest joint along the X axis, since it is impossible to expand and contract the chest and stomach.

Both the depth and rate of breathing varies depending on the activity of the person in question.

Since people don't really breath by rocking back and forth, it's impossible to say what the range of motion should be on the chest joint, but a good upper limit would be about 10 degrees. If you go much beyond that it starts looking too exaggerated.

The respiration rate of an adult human is bounded. Respiration rates of less than 3 or more than 70 breaths per minute are unheard of.

Activity Breaths Per Minute
breathing meditation 5
at rest or sleeping 12
average adults doing strenuous work 40
athletes at peak 65

Breathing meditation is something of a special case. Normally inhalation and exhalation take about the same amount of time, but during breathing meditation the exhalation consumes about 3/4ths of the time. The breaths are also very deep.

Subtle Motion

Second Life lossily compresses animations. This has raised concern about subtle motions being stripped, and questions about how subtle a motion can be before it is removed.

If my understanding is correct, the internal format used for animations could be compared to a music box. Each joint corresponds to a location along the cylinder, and joint changes are like pins along the cylinder. The passage of time is like the rotation of the cylinder, which, in a music box, causes the pins to pluck the notes, and in Second Life, cause the joint values to update.

The compression algorithm seems to remove joint changes of less than 0.001 (degrees or inches) from the last joint position that it retained. Even at 45 frames per second, joint changes of less than 0.001 would be so subtle as to be invisible under normal circumstances. Such changes are so small that they could be caused by rounding errors. 32-bit floating point numbers, which are used for most 3-D operations, only have a significand of about 7 decimal digits. This process is probably necessary to remove duplicate keyframes which consume space but are not visible. Put another way, this is the way the algorithm decides whether a value should be treated as a joint change (like a pin on the cylinder), or ignored (like empty space on the cylinder).

I created a animation for breathing meditation, at 5 breaths per minute, at 45 frames per second. This should be the worst case scenario for a realistic animation, since the rate of change is extremely slow, and the change in values between frames is extremely small, and thus likely to be stripped. I then started reducing the amount the chest joint rocked to see when the motion would be lost. At 3 degrees I found the motion impossible to detect visually. I managed to make the motion visible by sitting on a cube, wearing a pitch black skin, and pressing another, stark white, cube against my back until part of my back clipped through the surface of the white prim. This resulted in slowly moving patterns on the surface of the white prim that looked something like a animated Rorschach test. I was still able to detect the motion at 1 degree. That means a 1 degree change in 405 frames at 45 FPS was retained. I gave up at that point.

Suffice it to say, if you think your animation looks wrong due to lossy compression, that is unlikely to be the case. It is much more likely that your reference frame or priority is wrong. Also be sure you don't have a animation overrider on causing unexpected mixing as you test your animation.

See Also