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

天行健 君子當自強而不息

Working with skeletal animation(4)

Working with Skinned Meshes

In the first half of this chapter, you learned how to manipulate a hierarchy of bones that forms the basis of skeletal animation. That's all fine and dandy, but playing with imaginary bones isn't going to cut the mustard. Your game's players need to see all your hard work in the form of rendered meshes, which is where skinned meshes come in.

Skinned meshes are almost like the standard meshes with which you are already familiar. Using a D3DXMESHCONTAINER_EX object, you can store your mesh's data, from the vertices and indices to the materials and texture data, all wrapped up in one convenient ID3DXMesh object. As for the actual skinned mesh data, that information is contained in a special object called ID3DXSkinInfo.

I'll skip the ID3DXSkinInfo introductions for the moment and instead explain what makes a skinned mesh unique to other meshes. A skinned mesh deforms to match the orientation of the underlying skeletal structure. As the bones twist and turn, so do the mesh's vertices. The mesh−s vertices make the skinned mesh unique. You'll be dealing with the changing positions of the vertices when it comes to skinned meshes.

Take a look at Figure 4.3, which shows a skeleton surrounded by a simplistic mesh.

In Figure 4.3, each vertex is connected to a bone. As a bone moves, so do the vertices that are attached to it. For example, if you were to rotate the bone 45 degrees about the x−axis, the attached vertices would rotate 45 degrees as well, with the bone's joint acting as the pivot point or the origin of the rotation.

Now take a closer look at Figure 4.3, and you'll see that a couple vertices are attached to more than one bone. That's right−you're not limited to attaching a vertex to a single bone. In fact, you can connect a vertex to as many bones as you want with DirectX. Whenever one of the bones to which the vertex is attached moves, the vertex inherits a percentage of the motion. For example, if a bone rotates 60 degrees about the z−axis, an attached vertex may inherit only 25 percent of the motion, meaning the vertex will rotate only 15 degrees about the z−axis.

The exact percentage of motion the vertex inherits is called the vertex weight. Each vertex in the skinned mesh is assigned one vertex weight per bone to which it is attached. Those weights are typically 1.0 for vertices that are attached to only one bone, meaning that the vertex inherits the full motion of the bone. The weights are divided among the bones for vertices attached to multiple bones, and are usually calculated by taking into consideration the vertex's distance from each bone. (Most 3D modeling programs will graciously
calculate this for you.) For example, suppose a vertex is attached to two bones, meaning that both weights are set to 0.5. The vertex will inherit 50 percent of the motion from each bone. Notice that the total of all weights summed must always equal 1.

The purpose of using skin weights is quite ingenious. By allowing certain bones to influence specific vertices, you can have awesome effects such as wrinkling skin, bulging muscles, and stretching clothes−all in real time as your characters animate!

The way DirectX treats the vertex weights is quite simple. After you've loaded a mesh to use as your skinned mesh and you've loaded the vertex weights (also called skin weights), you can transform the vertices to match the bones' orientations using the following steps.

1. Iterate all vertices. For each vertex, proceed to Step 2.

2. For each bone to which the current vertex is connected, get the bone transformation. For each bone transformation, multiply the matrix by the vertex's weight and apply the result to a combined transformation for the vertex.

3. Repeat Step 3 for each bone connected, and repeat Steps 2 through 4 for each vertex. When you're finished, apply the combined transformation matrix to the specific vertex being iterated (from Step 1).

How exactly do you obtain these skin weights? With the help of the ID3DXSkinInfo object I mentioned earlier, you can load the weights from an .X file. The skin weights are stored within a Mesh data object, usually at the end of the Mesh object's data.

For each bone in your skeletal structure, there is a matching SkinWeights data object. Inside the SkinWeights object is the name of the bone, followed by a number of vertices attached to it. A skinned mesh header determines the number of bones to which each vertex in the mesh can be connected. If some of the vertices are attached to two bones, then all vertices must be attached to two bones. To get around the oddity of having vertices that connect to different numbers of bones, you can assign a weight of 0 to the second bone.

As I mentioned, the SkinWeights object includes the number of vertices that are connected to the bone. It lists an array of vertex index numbers. After the array of vertex indices, there is an array of vertex weight values. Finally, there is an inversed bone transformation to help you orient the vertices around the bone's joint.

Take a look at this sample SkinWeights template data object:

SkinWeights {
"Bip01_R_UpperArm";
4;
0, 3449, 3429, 1738;
0.605239, 0.605239, 0.605239, 0.979129;
−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;;
}

In this data object, a bone called Bip01_R_UpperArm is used. There are four vertices attached to the bone, and the vertex indices are 0, 3449, 3429, and 1738. Vertex 0 has a weight of 0.605239, vertex 1 has a weight of 0.605239, and so on. A transformation matrix aligns the vertices listed around the bone's joint. This matrix is very important. Without it, the vertices will rotate around the origin of the world instead of the bone's joint.

Thankfully, you don't have to deal directly with the SkinWeights templates. The data is handled for you while you are loading the skinned mesh from an .X file using the D3DX helper functions.


posted on 2008-04-23 18:42 lovedday 閱讀(472) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


公告

導航

統計

常用鏈接

隨筆分類(178)

3D游戲編程相關鏈接

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            免播放器亚洲一区| 欧美激情视频在线播放| 一区二区三区免费看| 亚洲伦理在线| 亚洲精品国产视频| 亚洲国产天堂久久国产91| 91久久精品国产| 亚洲一区二区三区免费在线观看 | 亚洲一区999| 亚洲综合首页| 久久网站免费| 亚洲高清不卡在线观看| 亚洲激情影视| 欧美一区亚洲| 欧美激情一区二区三区在线视频 | 久久精品官网| 欧美激情国产日韩精品一区18| 亚洲日本aⅴ片在线观看香蕉| 中文欧美日韩| 久久在线免费| 国产精品视频自拍| 在线精品国产成人综合| 亚洲一区久久久| 牛夜精品久久久久久久99黑人 | 狠狠综合久久av一区二区小说| 亚洲国产乱码最新视频| 性色av一区二区三区| 亚洲视频欧洲视频| 亚洲免费成人| 久久亚洲风情| 国产精品人人爽人人做我的可爱| 国产精自产拍久久久久久蜜| 黑人一区二区| 欧美一区国产二区| 亚洲三级免费| 美女诱惑一区| 老鸭窝毛片一区二区三区| 你懂的国产精品永久在线| 国产日产欧产精品推荐色| 99ri日韩精品视频| 久久色在线播放| 亚洲在线一区二区| 欧美人牲a欧美精品| 亚洲影音一区| 亚洲精品麻豆| 欧美sm极限捆绑bd| 影音先锋久久资源网| 欧美中在线观看| 宅男精品导航| 欧美三区在线视频| 99热这里只有精品8| 亚洲第一精品久久忘忧草社区| 欧美一区免费| 国产区日韩欧美| 国产精品电影观看| 欧美电影免费观看网站| 欧美日韩国产探花| 久久精品午夜| 国产一级久久| 久久国产精品黑丝| 亚洲欧美日韩在线| 国产农村妇女精品一区二区| 久久不射2019中文字幕| 欧美日韩蜜桃| 亚洲国产综合在线看不卡| 免费观看日韩av| 久久人91精品久久久久久不卡| 国产欧美精品久久| 欧美在线观看视频| 欧美在线看片| 黄色成人在线观看| 暖暖成人免费视频| 亚洲欧美日韩国产成人| 亚洲在线观看视频网站| 亚洲欧美制服中文字幕| 欧美影院午夜播放| 亚洲精品网站在线播放gif| 亚洲国产日韩在线一区模特| 欧美激情aⅴ一区二区三区| 亚洲欧美日本视频在线观看| 欧美中文在线视频| 亚洲欧美综合网| 亚洲欧美日韩综合aⅴ视频| 国产精品ⅴa在线观看h| 欧美日韩小视频| 亚洲精品之草原avav久久| 欧美日韩国产在线一区| 久久久久久亚洲精品杨幂换脸| 性久久久久久久久| 在线日韩日本国产亚洲| 亚洲美女中出| 国内精品久久久久久影视8| 久久久久国产精品厨房| 在线日韩欧美视频| 99精品国产一区二区青青牛奶 | 亚洲精品欧美一区二区三区| 欧美无砖砖区免费| 美女视频黄 久久| 国产精品va在线播放| 久久综合一区二区| 欧美四级在线观看| 欧美插天视频在线播放| 国产精品色婷婷| 91久久中文字幕| 国产在线精品二区| 一本色道久久88综合亚洲精品ⅰ| 狠狠操狠狠色综合网| 亚洲视屏一区| 亚洲精品一二| 久久免费99精品久久久久久| 亚洲欧美激情在线视频| 欧美高清视频免费观看| 久久久久一区| 国产精品美女999| 亚洲三级观看| 亚洲人成欧美中文字幕| 久久精品国产69国产精品亚洲| 亚洲男人的天堂在线观看| 免费的成人av| 久久亚洲国产精品日日av夜夜| 亚洲国产精品成人一区二区| 欧美日韩精品在线| 久久久久国内| 亚洲一区二区三区涩| 免费成人黄色片| 亚洲影视在线播放| 亚洲国产精品久久久久婷婷老年 | 免费亚洲一区二区| 国产精品久久久久77777| 亚洲国产电影| 亚洲黄网站在线观看| 久久久久久亚洲精品不卡4k岛国| 欧美影院视频| 国产伦精品一区二区三区免费迷 | 亚洲一区二区三区中文字幕在线| 久久9热精品视频| 亚洲图片欧美日产| 麻豆av一区二区三区久久| 欧美亚洲免费在线| 欧美日韩三级在线| 欧美成人视屏| 国产专区一区| 一区二区三区四区精品| 亚洲图色在线| 99热免费精品| 欧美国产免费| 欧美激情1区2区| 精品电影在线观看| 欧美亚洲一区| 午夜欧美电影在线观看| 欧美日本高清一区| 亚洲国产美女精品久久久久∴| 亚洲第一久久影院| 欧美顶级艳妇交换群宴| 99pao成人国产永久免费视频| 亚洲在线中文字幕| 国产日韩专区| 欧美日韩久久不卡| 亚洲人人精品| 久久夜色精品国产亚洲aⅴ| 久久这里有精品15一区二区三区| 久久躁日日躁aaaaxxxx| 亚洲精品一区二区网址| 性欧美暴力猛交69hd| 欧美激情一区二区三区在线 | 国产日产亚洲精品系列| 亚洲精品在线三区| 亚洲国产一区二区三区a毛片 | 老妇喷水一区二区三区| 亚洲精品久久久久久久久久久久 | 欧美在线一区二区| 欧美激情麻豆| 亚洲一区在线免费观看| 国内久久婷婷综合| 欧美日韩大片| 欧美一级视频免费在线观看| 欧美国产成人在线| 午夜在线不卡| 亚洲精品中文字幕女同| 国产精品日本一区二区| 欧美.www| 久久精品青青大伊人av| aⅴ色国产欧美| 免费观看亚洲视频大全| 亚洲欧美激情四射在线日| 最近中文字幕日韩精品 | 久久精品国产亚洲aⅴ| 一区二区三区欧美在线| 在线欧美日韩国产| 国产女优一区| 国产精品yjizz| 欧美激情中文字幕一区二区| 久久国产一区二区| 亚洲免费视频观看| 狠狠色狠狠色综合人人| 午夜视频久久久久久| 99热免费精品在线观看| 午夜精品成人在线| 国产精品欧美一区二区三区奶水| 99ri日韩精品视频|