青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

天行健 君子當(dāng)自強(qiáng)而不息

Working with skeletal animation(1)

Taking on Skeletal Animation

Skeletal animation−two words that bring to mind thoughts of B−rate horror movies in which the dead have risen from the grave to stalk the living. However, those two words mean something entirely different to programmers. If you're like me, this topic gives you more tingles down your spine than any cheesy horror movie ever could.

Skeletal animation is quickly becoming the animation technique of choice for programmers because it is quick to process and it produces incredible results. You can animate every detail of a character using skeletal animation. It gives you control of every aspect of the character's body, from the wrinkles in his skin to the bulges in his muscles. You can use every joint, bone, and muscle to deform the shape of your character's meshes.

Think of skeletal animation like this: Your body (or at least your skin) is a mesh, complete with an underlying set of bones. As your muscles push, pull, and twist your bones, your body changes shape to match. Instead of thinking of the muscles changing the shape of your body, think of the bones altering the rotation of each body part.

If you lift your arm your shoulder rotates, which in turn causes your entire arm to rotate and your skin to change shape. Your body (the mesh) changes shape to accommodate the changes in the bones. Skeletal animation works the same way. As the underlying skeletal structure changes orientation from the rotating of the joints, the overlaid mesh (appropriately called a skinned mesh) changes form to match.

As you can see, there are two separate entities to deal with when you are working with skeletal animation−the skeletal structure and the skinned mesh. Take a closer look at each entity in more detail to see how they work in unison, starting with the skeletal structure.

 

Using Skeletal Structures and Bone Hierarchies

The skeletal structure, as you can imagine, is a series of connected bones that form a hierarchy (a bone hierarchy, to be exact). One bone, called the root bone, forms the pivotal point for the entire skeletal structure. All other bones are attached to the root bone, either as child or sibling bones.

The word "bone" refers to a frame−of−reference object (a frame object, which is represented in DirectX by the D3DXFRAME structure or a Frame template inside .X files). If you were to examine the D3DXFRAME structure, you would indeed find the linked list pointers (D3DXFRAME::pFrameSibling and D3DXFRAME::pFrameFirstChild) that form the hierarchy. The pFrameSibling pointer links one bone to another on the same level in the hierarchy, whereas the pFrameFirstChild pointer links one bone to another as a child bone, which is one level lower in the hierarchy.

Generally, you would use a 3D−modeling package to create these skeletal structures for your projects. Exporting the bone hierarchy in the form of an .X file is a perfect example. Microsoft has released exporters for 3D Studio Max and Maya that allow you to export skeletal and animation data into .X files, and many modeling programs have the same exporting capabilities. I'll assume you have a program that will export these hierarchies to an .X file for you.

You'll find a number of things inside an .X file that contains skeletal animation data. First (and most important at this point), you'll find a hierarchy of Frame templates, which is your bone hierarchy in disguise.

Now let me show you some contents from .x file named with tiniy.x:

xof 0303txt 0032

template Mesh
{
    
<3D82AB44-62DA-11CF-AB39-0020AF71E433>
    DWORD nVertices;
    array Vector vertices[nVertices];
    DWORD nFaces;
    array MeshFace faces[nFaces];
    []
}

template MeshFace
{
    
< 3D82AB5F-62DA-11cf-AB39-0020AF71E433 >
    DWORD nFaceVertexIndices;
    array DWORD faceVertexIndices[nFaceVertexIndices];


template MeshNormals
{
    
< F6F23F43-7686-11cf-8F52-0040333594A3 >
    DWORD nNormals;
    array Vector normals[nNormals];
    DWORD nFaceNormals;
    array MeshFace faceNormals[nFaceNormals];


template MeshTextureCoords
{
    
< F6F23F40-7686-11cf-8F52-0040333594A3 >
    DWORD nTextureCoords;
    array Coords2d textureCoords[nTextureCoords] ;


template Coords2d
{
    
< F6F23F44-7686-11cf-8F52-0040333594A3 >
    
float u;
    
float v;
}

template VertexDuplicationIndices {
 
<b8d65549-d7c9-4995-89cf-53a9a8b031e3>
 DWORD nIndices;
 DWORD nOriginalVertices;
 array DWORD indices[nIndices];
}

template MeshMaterialList
{
    
< F6F23F42-7686-11CF-8F52-0040333594A3 >
    DWORD nMaterials;
    DWORD nFaceIndexes;
    array DWORD faceIndexes[nFaceIndexes];
    [Material 
<3D82AB4D-62DA-11CF-AB39-0020AF71E433>]


template Material
{
    
< 3D82AB4D-62DA-11CF-AB39-0020AF71E433 >
    ColorRGBA faceColor;
    FLOAT power;
    ColorRGB specularColor;
    ColorRGB emissiveColor;
    []


template ColorRGBA
{
    
< 35FF44E0-6C7C-11cf-8F52-0040333594A3 >
    
float red;
    
float green;
    
float blue;
    
float alpha;


template XSkinMeshHeader {
 
<3cf169ce-ff7c-44ab-93c0-f78f62d172e2>
 WORD nMaxSkinWeightsPerVertex;
 WORD nMaxSkinWeightsPerFace;
 WORD nBones;
}

template SkinWeights {
 
<6f0d123b-bad2-4167-a0d0-80224f25fabb>
 STRING transformNodeName;
 DWORD nWeights;
 array DWORD vertexIndices[nWeights];
 array FLOAT weights[nWeights];
 Matrix4x4 matrixOffset;
}

////////////////////////////////////////////////////////////////////////////////////////////////////

Frame Scene_Root {
 
 FrameTransformMatrix {
  
1.000000,0.000000,0.000000,0.000000,
  
0.000000,1.000000,0.000000,0.000000,
  
0.000000,0.000000,1.000000,0.000000,
  
0.000000,0.000000,0.000000,1.000000;;
 }

 Frame body {
  
  FrameTransformMatrix {
   
1.278853,0.000000,-0.000000,0.000000,
   
0.000000,0.000000,1.123165,0.000000,
   
0.000000,-1.470235,0.000000,0.000000,
   
0.135977,2.027985,133.967667,1.000000;;
  }

  Frame {

   FrameTransformMatrix {
    
1.000000,-0.000000,-0.000000,0.000000,
    
-0.000000,1.000000,0.000000,0.000000,
    
-0.000000,0.000000,1.000000,0.000000,
    
-0.142114,0.000023,-49.556850,1.000000;;
   }

   Mesh {
    
4432;            // nVertices: Number of vertices.
    
    
-34.720058;-12.484819;48.088928;,  // vertices[nVertices]: Array of vertices  
 
    
6841;            // nFaces: Number of faces
    
    
3;61,0,4431;;    // faces[nFaces]: Array of faces, each of type MeshFace

    MeshNormals {
     
4432;            // nNormals: Number of normals  
     
     
-0.914875;-0.152402;-0.373869;;    // normals[nNormals]: Array of normals
     
     
6841;            // nFaceNormals: Number of face normals, equal to nFaces in Mesh.
     
     
3;61,0,4431;;    // MeshFace faceNormals[nFaceNormals]:  Array of mesh face normals
    }

    MeshTextureCoords {
     
4432;                    // nTextureCoords: Number of texture coordinates
     
     
0.551922;0.238188;;    // Coords2d textureCoords[nTextureCoords]: Array of 2D texture coordinates
    }

    VertexDuplicationIndices {
     
4432;        // nIndices: Number of vertex indices. This is the number of vertices in the mesh. 
     3420;        // nOriginalVertices: Number of vertices in the mesh before any duplication occurs. 
     
     
0,            // The value indices[n] holds the vertex index that vertex[n] in the vertex array for the mesh 
     1,            // would have had if no duplication had occurred. Indices in this array that are the same, 
     2,            // therefore, indicate duplicate vertices. 
     
     
3418,
     
3419,
     
     
1,
     
62,
     
11,
     
     
3419;
    }

    MeshMaterialList {
     
1;            // nMaterials: A DWORD. The number of materials     
     6841;        // nFaceIndexes: A DWORD. The number of indices.
     
     
0,            // faceIndexes[nFaceIndexes]: An arrray of DWORDs containing the face indices
     
     
0;

     Material {
      
1.000000;1.000000;1.000000;1.000000;;    // faceColor: Face color. A ColorRGBA template.
      0.000000;                                // power: Material specular color exponent.
      1.000000;1.000000;1.000000;;            // specularColor: Material specular color. A ColorRGB template. 
      0.000000;0.000000;0.000000;;            // emissiveColor: Material emissive color. A ColorRGB template.

      TextureFilename {
         
"Tiny_skin.bmp";
      }
     }
    }

    XSkinMeshHeader {
     
2;        // nMaxSkinWeightsPerVertex: Maximum number of transforms that affect a vertex in the mesh
     4;        // nMaxSkinWeightsPerFace: Maximum number of unique transforms that affect the three vertices of any face
     35;    // nBones: Number of bones that affect vertices in this mesh
    }

    SkinWeights {
     
"Bip01_R_UpperArm";    // transformNodeName
     156;                    // nWeights: the number of vertices affected by this bone
     
     
0,                        // vertexIndices[nWeights]: the vertices influenced by this bone
     3449,
     
     
1738;
     
     
0.605239,                // weights[nWeights]: the weights for each of the vertices influenced by this bone
     
     
0.979129;
     
     
// matrixOffset: The matrix matrixOffset transforms the mesh vertices to the space of the bone. 
     
// When concatenated to the bone's transform, this provides the world space coordinates of the mesh 
     
// as affected by the bone. 
     -0.941743,-0.646748,0.574719,0.000000,    
     
-0.283133,-0.461979,-0.983825,0.000000,
     
0.923060,-1.114919,0.257891,0.000000,
     
-65.499557,30.497688,12.852692,1.000000;;
    }   

    

    SkinWeights {
     
"Bip01_Head";    // transformNodeName
     1955;            // nWeights: the number of vertices affected by this bone

     
1746,            // vertexIndices[nWeights]: the vertices influenced by this bone
     
     
3417;

     
1.000000,        // weights[nWeights]: the weights for each of the vertices influenced by this bone
     
     
1.000000;

     
// matrixOffset: The matrix matrixOffset transforms the mesh vertices to the space of the bone. 
     
// When concatenated to the bone's transform, this provides the world space coordinates of the mesh 
     
// as affected by the bone. 
     0.000000,-0.000002,1.278853,0.000000,
     
1.112235,-0.156313,-0.000000,0.000000,
     
0.204616,1.455927,0.000002,0.000000,
     
-61.950306,-62.105236,-0.142288,1.000000;;
    }
   }    
// Mesh
  }        // frame
 }        // Body


 Frame Box01 {  

  FrameTransformMatrix {
   
-1.000000,0.000000,-0.000000,0.000000,
   
-0.000000,0.000000,1.000000,0.000000,
   
0.000000,1.000000,0.000000,0.000000,
   
-88.696747,-246.341751,858.815247,1.000000;;
  }

  Frame Bip01 {
   
   FrameTransformMatrix {
    
0.186552,-0.974653,0.123489,0.000000,
    
0.982171,0.187991,0.000000,0.000000,
    
-0.023215,0.121288,0.992346,0.000000,
    
-88.977890,-857.346008,247.541595,1.000000;;
   }
 }
 
 
}

 

You should find a standard Mesh data object embedded in the Frame data object hierarchy. The Mesh data object contains information about your skeletal animation object and the bones used in your skeletal structure. That's right−the Frame data object and the Mesh object both contain information about your skeletal structure! Whereas the Frame objects define the actual hierarchy, the Mesh object defines which frames represent the bones.

For now, however, the importance of the bone data is irrelevant. Because the bones depend on the frame hierarchy, it's important to concentrate solely on the frames at this point. You simply need to load the hierarchy (from an .X file, for example) and set it up for later use. Read on to see how to load hierarchies from .X.


posted on 2008-04-23 16:52 lovedday 閱讀(686) 評論(1)  編輯 收藏 引用

評論

# re: Working with skeletal animation(1) 2008-10-11 01:00 sky11811

呵呵呵 大段的貼書本啊 有意思嗎 我還以為你寫的呢
  回復(fù)  更多評論   


只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


公告

導(dǎo)航

統(tǒng)計

常用鏈接

隨筆分類(178)

3D游戲編程相關(guān)鏈接

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久综合免费视频影院| 国产主播一区二区| 老司机午夜精品视频| 欧美日韩一区二区欧美激情 | 久久亚洲综合| 国产精品海角社区在线观看| 欧美成人首页| 国产在线国偷精品产拍免费yy| 亚洲精品视频在线看| 在线不卡亚洲| 久久久91精品国产一区二区精品| 亚洲伊人网站| 欧美三区在线视频| 亚洲精品女av网站| 激情另类综合| 久久国产精品久久久久久久久久 | 先锋影音国产精品| 欧美日韩国产成人在线| 亚洲国产欧美日韩另类综合| 一区精品久久| 久久精品亚洲| 免费日韩视频| **欧美日韩vr在线| 美日韩精品免费| 欧美国产91| 亚洲人成网站在线观看播放| 免费欧美在线视频| 欧美激情1区2区| 亚洲免费观看| 欧美日韩中文在线观看| 亚洲视频999| 欧美一区视频在线| 国产一区二区电影在线观看| 欧美一区国产一区| 美国十次成人| 亚洲人成网站精品片在线观看| 久久亚洲国产精品日日av夜夜| 狼狼综合久久久久综合网| 在线成人欧美| 欧美日本免费| 亚洲女人av| 免费观看成人网| 99综合电影在线视频| 欧美日韩一级黄| 午夜欧美精品| 你懂的国产精品| 亚洲毛片在线观看| 国产精品乱子乱xxxx| 欧美中文字幕视频| 亚洲国产精品国自产拍av秋霞| 一区二区国产日产| 国产日韩在线视频| 久久久久久夜精品精品免费| 亚洲日本aⅴ片在线观看香蕉| 亚洲性线免费观看视频成熟| 国产欧美日韩精品一区| 麻豆久久婷婷| 亚洲淫性视频| 亚洲国产黄色| 久久成人久久爱| 亚洲精品午夜| 国产一区二区日韩精品欧美精品 | 久久九九久久九九| 日韩午夜中文字幕| 久久婷婷国产综合精品青草| 99re6热在线精品视频播放速度| 国产精品美女久久久久久久 | 男人插女人欧美| 亚洲深夜福利| 亚洲国产精品ⅴa在线观看| 亚洲欧美日韩国产成人| 亚洲黄色成人久久久| 欧美四级在线| 欧美高清视频| 久久久女女女女999久久| 一区二区三区视频免费在线观看 | 亚洲一级在线观看| 欧美激情欧美狂野欧美精品| 性欧美大战久久久久久久免费观看| 亚洲第一页中文字幕| 国产精品入口福利| 欧美激情一区二区三区成人 | 国产精品白丝jk黑袜喷水| 久久综合伊人77777麻豆| 亚洲欧美日产图| 亚洲靠逼com| 欧美激情视频在线播放| 久久三级视频| 久久精品在线播放| 亚洲欧美视频在线观看视频| 日韩午夜在线| 亚洲欧洲一二三| 在线观看一区视频| 国产主播一区二区三区| 国产欧美日韩亚洲一区二区三区| 欧美日韩国产综合视频在线观看中文 | 国产亚洲精品高潮| 欧美日本免费| 欧美日韩精品免费在线观看视频| 老**午夜毛片一区二区三区| 久久精品国内一区二区三区| 亚洲尤物在线| 亚洲欧美日韩国产一区二区| 日韩视频第一页| 亚洲精品欧美日韩| 亚洲黑丝在线| 最新亚洲电影| 亚洲欧洲日产国产网站| 亚洲日本中文字幕区| 欧美国产日韩一区| 最新中文字幕一区二区三区| 亚洲国产小视频在线观看| 亚洲国产一区二区三区a毛片| 亚洲国产精品视频| 亚洲国产视频一区二区| 亚洲精选久久| 亚洲婷婷在线| 欧美一区二区三区在线播放| 久久精品官网| 免费观看在线综合| 欧美日韩免费观看一区| 国产精品久久久久久亚洲调教| 国产精品黄页免费高清在线观看| 国产精品免费一区豆花| 国产亚洲aⅴaaaaaa毛片| 激情五月***国产精品| 一区二区三区在线看| 亚洲激情综合| 亚洲天堂免费观看| 久久国产一区二区| 欧美成人在线免费观看| 亚洲风情亚aⅴ在线发布| 亚洲乱码精品一二三四区日韩在线 | 欧美精品综合| 国产精品入口麻豆原神| 尤物九九久久国产精品的特点| 亚洲精品自在在线观看| 亚洲欧美变态国产另类| 久久综合狠狠综合久久综青草| 欧美黑人多人双交| 亚洲无限av看| 久久久综合视频| 欧美视频福利| 狠狠入ady亚洲精品经典电影| 亚洲人线精品午夜| 欧美一级免费视频| 亚洲高清一区二| 亚洲综合欧美| 嫩草成人www欧美| 国产精品视区| 亚洲日本中文| 久久男人av资源网站| 亚洲每日在线| 久久久www成人免费无遮挡大片| 欧美激情亚洲自拍| 狠狠色综合一区二区| 亚洲伊人伊色伊影伊综合网| 欧美成人国产| 亚洲欧美日韩综合国产aⅴ| 欧美国产视频在线观看| 国产综合一区二区| 亚洲欧美电影在线观看| 欧美电影在线观看完整版| 亚洲欧美日韩视频二区| 欧美裸体一区二区三区| 黑人操亚洲美女惩罚| 午夜精品福利电影| 91久久久久久| 男人插女人欧美| 激情欧美国产欧美| 欧美自拍偷拍午夜视频| av成人福利| 欧美日韩国产综合一区二区| 在线观看视频免费一区二区三区| 午夜精品久久久久久久蜜桃app| 亚洲精品一区二区三区99| 麻豆成人综合网| 在线观看日韩www视频免费| 久久精品导航| 亚洲欧美日韩在线播放| 国产精品午夜国产小视频| 亚洲一品av免费观看| 日韩视频一区二区三区在线播放| 美女精品在线观看| 亚洲国产小视频在线观看| 久久久一区二区三区| 欧美在线视频观看免费网站| 国产精品永久免费观看| 欧美一区二区三区免费看| 亚洲免费在线观看| 国产精品捆绑调教| 欧美亚洲一区| 西西裸体人体做爰大胆久久久| 国产精品一区二区久久| 性做久久久久久免费观看欧美| 亚洲午夜高清视频| 国产精品永久在线| 久久精品在线| 久久亚洲精品伦理| 亚洲伦理在线免费看|