BVH

From Tech Artists Wiki

Jump to: navigation, search

BioVision Hierarchy file format, commonly abbreivated BVH, is a common intermediary animation file format, especially for motion capture. Because of the variety of BVH 'formats', BVH is being replaced in favor of more flexible intermediary formats, such as FBX.

Contents

BVH File Breakdown

A BVH file has two main parts: the hierarchy, and the motion.

Hierarchy

The hierarchy portion of a BVH describes the skeletal hierarchy. It begins with the ROOT node and continues to nest child bones. OFFSET describes the offset of that joint from the parent joint. The ROOT node is usually at 0,0,0, but any offset describes offset in world space (some programs, such as natural motion's endorphin, require bvh data with the ROOT offset properly). CHANNELS are usually 3 or 6, and describe the available motion data (translation and/or rotation). The order listed here also indicates axis rotation order (the fact that bvh rotations are in Euler instead of quaternion terms is one major drawback of bvh).

Sample Code

HIERARCHY
ROOT Hips
{
  OFFSET 0.0000 0.0000 0.0000
  CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation
  JOINT Chest
  {
    OFFSET 0.0000 4.5700 0.0000
    CHANNELS 3 Zrotation Xrotation Yrotation
    JOINT Chest2
    {
      OFFSET 0.0000 6.5700 -0.0000
      CHANNELS 3 Zrotation Xrotation Yrotation
      JOINT LeftCollar
      {
        OFFSET 1.0600 4.1900 1.7600
        CHANNELS 3 Zrotation Xrotation Yrotation
        JOINT LeftShoulder
        {
          OFFSET 5.8100 0.0000 -0.0000
          CHANNELS 3 Zrotation Xrotation Yrotation
          JOINT LeftElbow
          {
            OFFSET 0.0000 -12.0800 -0.0000
            CHANNELS 3 Zrotation Xrotation Yrotation
            JOINT LeftWrist
            {
              OFFSET 0.0000 -9.8200 -0.0000
              CHANNELS 3 Zrotation Xrotation Yrotation
              End Site
              {
                  OFFSET 0.0000 -7.3700 -0.0000
              }
            }
          }
        }
      }
      JOINT RightCollar
      {
        OFFSET -1.0600 4.1900 1.7600
        CHANNELS 3 Zrotation Xrotation Yrotation
        JOINT RightShoulder
        {
          OFFSET -6.0600 0.0000 0.0000
          CHANNELS 3 Zrotation Xrotation Yrotation
          JOINT RightElbow
          {
            OFFSET 0.0000 -11.0800 0.0000
            CHANNELS 3 Zrotation Xrotation Yrotation
            JOINT RightWrist
            {
              OFFSET 0.0000 -9.8200 0.0000
              CHANNELS 3 Zrotation Xrotation Yrotation
              End Site
              {
                  OFFSET 0.0000 -7.1400 0.0000
              }
            }
          }
        }
      }
      JOINT Neck
      {
        OFFSET -0.0000 4.0500 0.0000
        CHANNELS 3 Zrotation Xrotation Yrotation
        JOINT Head
        {
          OFFSET 0.0000 5.1900 0.0000
          CHANNELS 3 Zrotation Xrotation Yrotation
          End Site
          {
              OFFSET 0.0000 4.1400 0.0000
          }
        }
      }
    }
  }
}

Motion

The second part of a BVH file is the MOTION section. The Frames: keyword indicates how many frames in the animation, while Frame Time: indicates the sampling rate (0.033333 is 30 fps). For info on what the seemingly endless lines of numbers are after that, see the References below.

Sample Code

MOTION
Frames:	388
Frame Time:	0.040000
-5.5083 37.9186 -14.4302 -4.79 0.98 -7.31 6.74 -27.18 7.63 -0.21 4.51 58.08 -2.34 1.98 0.80 3.77 8.57 -8.63 8.60 18.86 -46.25 8.38 -23.42 -0.55 4.60 5.91 1.25 0.00 0.00 2.28 -16.39 3.37 -10.99 29.12 0.75 25.43 -5.83 -7.88 -3.45 12.95 3.08 2.73 20.43 5.03 15.05 -44.30 -1.52 -5.11 15.18 -2.68 64.46 -21.47 -2.37 0.22 0.36 -3.03 3.77 0.60 20.18 3.40 
-5.1196 37.9905 -13.2467 -3.29 1.18 -7.12 5.99 -28.22 8.89 -1.91 8.30 57.09 -2.10 4.58 -0.88 2.72 10.98 -9.98 6.48 16.26 -45.56 8.51 -21.90 -0.98 3.26 5.01 1.07 0.00 0.00 1.78 -17.36 4.67 -15.74 30.92 2.69 26.20 -5.66 -7.33 0.29 12.41 3.54 2.76 20.22 5.21 15.83 -43.15 1.63 -6.58 14.71 -2.19 63.05 -20.40 -2.30 0.28 0.95 -1.63 3.41 -0.42 16.34 3.65 
-4.7064 38.1898 -11.7514 -2.17 1.62 -7.13 6.21 -28.53 11.30 -4.49 11.69 54.48 -2.16 5.71 -0.96 1.15 11.99 -10.85 5.97 16.25 -46.24 9.20 -18.94 -1.36 2.27 4.09 0.84 0.00 0.00 1.31 -17.92 5.33 -17.97 32.68 3.26 27.07 -5.31 -6.58 -1.54 9.86 3.77 2.43 20.49 5.17 15.51 -41.93 4.65 -7.98 14.31 -1.16 62.22 -19.66 -1.78 0.45 1.53 -2.66 3.12 -1.33 13.76 3.82 
-4.3077 38.7065 -10.3695 -1.61 2.02 -7.85 6.08 -26.59 11.48 -6.37 11.49 53.01 -2.40 4.72 1.35 -1.49 10.25 -11.20 7.59 20.16 -49.27 9.55 -14.11 -1.45 1.77 3.60 1.04 0.00 0.00 1.41 -16.46 4.44 -15.45 32.79 0.75 26.24 -5.54 -5.64 -8.46 3.88 1.86 1.81 20.47 5.10 15.30 -40.86 6.59 -8.35 14.41 0.43 61.92 -17.91 -1.62 0.41 1.97 -5.31 2.88 -2.03 13.28 3.88 
-4.0069 39.2555 -9.0531 -1.38 2.15 -8.93 5.02 -23.81 9.53 -6.09 9.71 53.27 -2.56 5.10 2.94 -4.02 9.00 -11.24 9.91 22.63 -52.83 8.91 -8.93 -1.35 1.68 3.32 1.62 0.00 0.00 1.96 -14.64 3.58 -13.00 33.09 -1.98 24.96 -5.95 -4.43 -12.36
etc., etc.,...

References

Personal tools