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

天行健 君子當自強而不息

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精品在线观看| 亚洲精美视频| 一区二区三区中文在线观看| 一区二区国产日产| 国产视频欧美| 亚洲婷婷在线| 亚洲一区二区三区精品视频| 国产精品久久久久久久app| 亚洲欧美在线网| 免播放器亚洲一区| 亚洲精品免费网站| 久久亚洲一区| 亚洲国产成人91精品| 国产一区二区中文字幕免费看| 欧美亚洲一级| 亚洲黑丝一区二区| 欧美国产欧美综合 | 中文在线资源观看网站视频免费不卡 | 亚洲无线视频| 欧美日韩国产小视频| 亚洲高清三级视频| 亚洲激情视频网站| 亚洲东热激情| 国产精品欧美日韩| 欧美精品福利视频| 亚洲人人精品| 亚洲电影中文字幕| 亚洲一区免费在线观看| 国产精品一二一区| 亚洲天堂av电影| 亚洲精品美女在线观看播放| 一区二区成人精品 | 免费在线观看成人av| 亚洲精品午夜精品| 黄色影院成人| 亚洲人午夜精品免费| 亚洲精品九九| 影音先锋欧美精品| 韩国女主播一区二区三区| 一区二区在线看| 在线欧美日韩国产| 国产一区二区三区久久 | 亚洲国产免费| 国产综合视频在线观看| 亚洲欧洲精品一区二区三区不卡 | 欧美一区二区视频在线观看2020 | 欧美国产日韩xxxxx| 国产精品久久久久久久久久免费 | 午夜精品亚洲| 亚洲天堂视频在线观看| 亚洲国产欧美一区| 亚洲精品乱码久久久久| 亚洲一区免费观看| 久久精品国产亚洲高清剧情介绍| 久久高清免费观看| 美国成人直播| 亚洲人成绝费网站色www| 亚洲欧美日韩成人| 欧美日韩一区国产| 亚洲欧美国产高清va在线播| 亚洲一区欧美二区| 久久亚洲综合网| 性欧美精品高清| 欧美1区免费| 激情小说另类小说亚洲欧美| 久久国产精品电影| 欧美激情五月| 在线观看欧美日本| 日韩视频不卡中文| 国产欧美一区二区在线观看| 欧美在线观看你懂的| 久久国产精品久久久久久电车| 欧美日韩午夜剧场| 欧美一区不卡| 香蕉乱码成人久久天堂爱免费 | 午夜日韩视频| 久久精品在线| 国内精品久久久久影院 日本资源| 午夜日韩视频| 性欧美激情精品| 99精品国产在热久久下载| 久久综合色天天久久综合图片| 亚洲久色影视| 99热在线精品观看| 亚洲第一精品久久忘忧草社区| 久久久亚洲影院你懂的| 国产精品专区h在线观看| 欧美综合国产精品久久丁香| 亚洲永久精品大片| 亚洲日本一区二区三区| 国产亚洲欧美另类一区二区三区| 亚洲男人的天堂在线| 99国内精品久久| 国模精品一区二区三区色天香| 亚洲第一黄色| 国产主播精品| 欧美成人在线网站| 亚洲精品乱码| 午夜天堂精品久久久久| 伊人精品成人久久综合软件| 另类国产ts人妖高潮视频| 亚洲欧美日韩在线| 国产日韩亚洲| 亚洲制服av| 日韩视频在线永久播放| 亚洲一区二区在线播放| 亚洲精品一区二区三区av| 欧美精品自拍偷拍动漫精品| 亚洲欧美三级在线| 伊大人香蕉综合8在线视| 久久久99精品免费观看不卡| 欧美在线免费播放| 最新中文字幕亚洲| 国产老肥熟一区二区三区| 久久精品日韩欧美| 亚洲娇小video精品| 91久久在线视频| 国产欧美一区二区视频| 欧美激情一区二区| 欧美一区二区性| 免费永久网站黄欧美| 99精品福利视频| 国产夜色精品一区二区av| 国产精品va在线播放我和闺蜜| 欧美在线视频一区二区| 午夜精品一区二区在线观看 | 国产精品系列在线| 亚洲欧洲精品一区二区三区不卡 | 亚洲一区www| 国产日韩一区在线| 美女免费视频一区| 久久久久亚洲综合| 欧美成人国产| 性色av香蕉一区二区| 一本久道久久久| 亚洲欧美日本日韩| 亚洲精选在线| 亚洲裸体俱乐部裸体舞表演av| 欧美视频在线一区二区三区| 国产精品成人一区二区网站软件| 欧美日产国产成人免费图片| 欧美激情网友自拍| 国产精品久久久久免费a∨大胸| 欧美福利精品| 国产伦精品一区二区三区在线观看 | 久久精品最新地址| 亚洲精品综合| 亚洲人成毛片在线播放| 国产婷婷色综合av蜜臀av| 欧美特黄一区| 欧美不卡一区| 欧美精品久久久久a| 国产欧美综合在线| 99re热精品| 午夜精品短视频| 久久精品国产清自在天天线| 欧美精品日韩| 国产日韩欧美综合一区| 亚洲高清不卡av| 久久国产精品久久久| 欧美v国产在线一区二区三区| 亚洲一区二区免费在线| 亚洲视屏在线播放| 欧美在线视频a| 在线亚洲欧美| 欧美日本网站| 亚洲国产高清自拍| 久久国产精品一区二区| 亚洲国产美女| 欧美女同在线视频| 一本色道久久综合亚洲精品不卡 | 制服丝袜激情欧洲亚洲| 久久艳片www.17c.com| 亚洲日本理论电影| 蜜臀av一级做a爰片久久| 国产亚洲电影| 亚洲欧美日韩一区在线| 亚洲婷婷国产精品电影人久久| 欧美成人精品在线| 亚洲理伦在线| 一区二区免费在线视频| 欧美视频精品在线观看| 一本大道久久a久久精二百| 日韩午夜三级在线| 欧美成人激情视频| 欧美噜噜久久久xxx| 性欧美18~19sex高清播放| 亚洲一区二区综合| 韩国成人理伦片免费播放| 久久爱另类一区二区小说| 久久尤物电影视频在线观看| 欧美视频在线免费| 欧美1区2区| 国外成人性视频| 亚洲黄色有码视频| 在线观看视频日韩| 91久久久久久久久|