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

天行健 君子當自強而不息

網格模型高級技術(4)

為了使一個.x文件產生動畫,必須至少提供一個動畫集,每個動畫集都應具有一個對某個框架的引用。模板 AnimationSet用來定義動畫集:

Contains one or more Animation objects. Each animation within an animation set has the same time at any given point. Increasing the animation set's time increases the time for all the animations it contains.

template AnimationSet
{
< 3D82AB50-62DA-11cf-AB39-0020AF71E433 >
[ Animation < 3D82AB4F-62DA-11cf-AB39-0020AF71E433 > ]
}

Where:

  • [ Animation < 3D82AB4F-62DA-11cf-AB39-0020AF71E433 > ] - Optional animation template.

模板Animation的定義如下:

Contains one or more Animation objects. Each animation within an animation set has the same time at any given point. Increasing the animation set's time increases the time for all the animations it contains.

template AnimationSet
{
< 3D82AB50-62DA-11cf-AB39-0020AF71E433 >
[ Animation < 3D82AB4F-62DA-11cf-AB39-0020AF71E433 > ]
}

Where:

  • [ Animation < 3D82AB4F-62DA-11cf-AB39-0020AF71E433 > ] - Optional animation template.

很顯然,Animation是一個完全開放的模板,一般情況下,用模板AnimationKey來填充它,模板AnimationKey的定義如下:

Defines a set of animation keys. A matrix key is useful for sets of animation data that need to be represented as transformation matrices.

template AnimationKey
{
< 10DD46A8-775B-11CF-8F52-0040333594A3 >
DWORD keyType;
DWORD nKeys;
array TimedFloatKeys keys[nKeys];
}

Where:

  • keyType - Specifies whether the keys are rotation, scale, position, or matrix keys (using the integers 0, 1, 2, or 4, respectively).
  • nKeys - Number of keys.
  • keys - An array of keys.

在模板AnimationKey中,keyType可取的值是0、1、2、4。

0表示旋轉鍵,在.x文件中,用一個四元數來實現模型的旋轉,旋轉值使用4個分量w、x、y、z來存儲,也就是說,此時變換數組的大小是4,它依次存儲四元數的4個分量。

1表示縮放鍵,可以使用這種類型的關鍵幀實現模型的縮放,此時變換數組的大小是3,它們分別對應x、y、z軸的縮放值。

2表示平移鍵,使用3個分量實現模型的平移,此時變換數組的大小是3,它們分別對應沿x、y、z軸的平移值。

4表示變換矩陣鍵,此時關鍵幀的變換數組使用16個浮點數來實現該模型的各種變換。因為矩陣可以實現模型的平移、旋轉、縮放以及它們的組合變換。

模板AnimationKey用來定義一組動畫關鍵幀,而模板TimeFloatKeys用來定義每個動畫關鍵幀:

Defines a set of floats and a positive time used in animations.

template TimedFloatKeys 
{
< F406B180-7B3B-11cf-8F52-0040333594A3 >
DWORD time;
FloatKeys tfkeys;
}

Where:

  • tfkeys - See FloatKeys.

Defines an array of floating-point numbers (floats) and the number of floats in that array. This is used for defining sets of animation keys.

template FloatKeys
{
< 10DD46A9-775B-11cf-8F52-0040333594A3 >
DWORD nValues;
array float values[nValues];
}
  • nValues - Number of floats.
  • values[nValues] - Array of float values.

我們在cube_3.x的基礎上添加動畫部分形成cube_4.x,該動畫集定義了立方體繞y軸旋轉,增加部分如下:

AnimationSet AnimationSet0 {  //動畫集
Animation Animation0 { //動畫
{CubeFrame} //引用上面的立方體框架,表示下面的動畫是針對立方體框架的
		AnimationKey {                //動畫鍵   沿Y軸旋轉網格
0; // Rotation keys
10; // 9 keys
			1000; 4; 0.000000, 0.15643448, 0.000000, 0.98768836;;,
2000; 4; 0.000000, 0.30901700, 0.000000, 0.95105654;;,
3000; 4; 0.000000, 0.45399046, 0.000000, 0.89100653;;,
4000; 4; 0.000000, 0.58778530, 0.000000, 0.80901694;;,
5000; 4; 0.000000, 0.70710671, 0.000000, 0.70710683;;,
6000; 4; 0.000000, 0.80901694, 0.000000, 0.58778530;;,
7000; 4; 0.000000, 0.89100653, 0.000000, 0.45399052;;,
8000; 4; 0.000000, 0.95105654, 0.000000, 0.30901697;;,
9000; 4; 0.000000, 0.98768836, 0.000000, 0.15643449;;,
10000; 4; 0.000000, 1.0000000, 0.000000, 0.00000000;;;
}
}
}

這里一共定義了10個關鍵幀,在第10個關鍵幀時回到初始位置開始新一輪的動畫。{CubeFrame}表示該動畫集是對框架CubeFrame進行的操作。

我們在cube_3.x的基礎上添加縮放動畫形成cube_5.x:

AnimationSet AnimationSet0 {   //動畫集
Animation Animation0 { //動畫
{CubeFrame} // Use the frame containing the cube.
		AnimationKey {                 //動畫鍵, 放大和縮小網格
1; // Scaling keys
9; // 9 keys
			1000; 3; 1.000000, 1.000000, 1.000000;;,
2000; 3; 0.800000, 0.800000, 0.800000;;,
3000; 3; 0.600000, 0.600000, 0.600000;;,
4000; 3; 0.400000, 0.400000, 0.400000;;,
5000; 3; 0.200000, 0.200000, 0.200000;;,
6000; 3; 0.400000, 0.400000, 0.400000;;,
7000; 3; 0.600000, 0.600000, 0.600000;;,
8000; 3; 0.800000, 0.800000, 0.800000;;,
9000; 3; 1.000000, 1.000000, 1.000000;;;
}
}
}

效果圖:

 

我們也可以在cube_3.x的基礎上添加一個沿y軸移動的動畫形成cube_6.x:

AnimationSet AnimationSet0 {   //動畫集
Animation Animation0 { //動畫
{CubeFrame} // Use the frame containing the cube.
		AnimationKey {                 //動畫鍵   沿Y軸方向移動網格
2; // Position keys
19; // 9 keys
1000; 3; 0.000000, -5.000000, 0.000000;;,
2000; 3; 0.000000, -4.000000, 0.000000;;,
3000; 3; 0.000000, -3.000000, 0.000000;;,
4000; 3; 0.000000, -2.000000, 0.000000;;,
5000; 3; 0.000000, -1.000000, 0.000000;;,
6000; 3; 0.000000, 0.000000, 0.000000;;,
7000; 3; 0.000000, 1.000000, 0.000000;;,
8000; 3; 0.000000, 2.000000, 0.000000;;,
9000; 3; 0.000000, 3.000000, 0.000000;;,
10000; 3; 0.000000, 4.000000, 0.000000;;,
11000; 3; 0.000000, 5.000000, 0.000000;;,
12000; 3; 0.000000, 4.000000, 0.000000;;,
12000; 3; 0.000000, 3.000000, 0.000000;;,
13000; 3; 0.000000, 2.000000, 0.000000;;,
14000; 3; 0.000000, 1.000000, 0.000000;;,
15000; 3; 0.000000, 0.000000, 0.000000;;,
16000; 3; 0.000000, -1.000000, 0.000000;;,
17000; 3; 0.000000, -2.000000, 0.000000;;,
18000; 3; 0.000000, -3.000000, 0.000000;;,
19000; 3; 0.000000, -4.000000, 0.000000;;,
}
}
}

效果圖:

 

包含在.x文件中的動畫通常用來實現模型不同部分之間的相對運動,對于一個模型整體上的運動,應該是在程序中通過其世界變換矩陣來實現。

 

蒙皮信息

一個動畫網格模型很多情況下可能涉及到蒙皮信息,模板XSkinMeshHeader僅對于具有蒙皮信息的網格模型有效,它用來記錄網格模型的蒙皮信息,該模板的定義如下:

This template is instantiated on a per-mesh basis only in meshes that contain exported skinning information. The purpose of this template is to provide information about the nature of the skinning information that was exported.

template XSkinMeshHeader 
{
< 3CF169CE-FF7C-44ab-93C0-F78F62D172E2 >
WORD nMaxSkinWeightsPerVertex;
WORD nMaxSkinWeightsPerFace;
WORD nBones;
}

Where:

  • nMaxSkinWeightsPerVertex - Maximum number of transforms that affect a vertex in the mesh.
  • nMaxSkinWeightsPerFace - Maximum number of unique transforms that affect the three vertices of any face.
  • nBones - Number of bones that affect vertices in this mesh.

在一個具有蒙皮信息的網格模型中,可能出現模板SkinWeights的n個實例,n等于該網格模型中骨骼的數量。該模板的每個實例都定義了一個具體的骨骼對于相應頂點的影響權重,該模板的具體定義如下:

This template is instantiated on a per-mesh basis. Within a mesh, a sequence of n instances of this template will appear, where n is the number of bones (X file frames) that influence the vertices in the mesh. Each instance of the template basically defines the influence of a particular bone on the mesh. There is a list of vertex indices, and a corresponding list of weights.

template SkinWeights 
{
< 6F0D123B-BAD2-4167-A0D0-80224F25FABB >
STRING transformNodeName;
DWORD nWeights;
array DWORD vertexIndices[nWeights];
array float weights[nWeights];
Matrix4x4 matrixOffset;
}

Where:

  • The name of the bone whose influence is being defined is transformNodeName, and nWeights is the number of vertices affected by this bone.
  • The vertices influenced by this bone are contained in vertexIndices, and the weights for each of the vertices influenced by this bone are contained in weights.
  • 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.

 

下載cube_1.x ~ cube6.x


posted on 2008-05-27 15:44 lovedday 閱讀(2028) 評論(1)  編輯 收藏 引用

評論

# re: 網格模型高級技術(4) 2013-09-06 17:29 abc

講的太好了  回復  更多評論   


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   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>
            国产日韩在线看片| 久久精品国产在热久久 | 亚洲欧美久久| 欧美高清一区二区| 老牛影视一区二区三区| 国产欧美1区2区3区| 一区二区三区鲁丝不卡| 亚洲黄色成人网| 久久精品免费看| 久久久久久国产精品一区| 国产午夜精品久久久久久免费视| 亚洲午夜久久久久久久久电影网| 99精品国产热久久91蜜凸| 欧美成人国产| 欧美第一黄色网| 亚洲三级国产| 欧美日韩国产在线观看| 国产精品看片资源| 亚洲欧美另类在线| 欧美一区二区三区啪啪| 国产欧美一区二区三区在线看蜜臀 | 欧美日韩免费区域视频在线观看| 亚洲欧洲在线一区| 亚洲国产免费看| 欧美激情一区三区| 亚洲精品永久免费| 亚洲视频日本| 国产精品腿扒开做爽爽爽挤奶网站| 在线中文字幕日韩| 亚洲一区影音先锋| 国产精品伊人日日| 这里只有精品视频| 欧美午夜精品一区| 免费av成人在线| 亚洲精品日韩在线| 欧美激情a∨在线视频播放| 亚洲美女av在线播放| 在线亚洲激情| 国产一区二区三区不卡在线观看 | 久久成人在线| 亚洲国产欧美精品| 亚洲一区在线播放| 久久影音先锋| 99精品久久久| 亚洲自拍偷拍麻豆| 一色屋精品视频免费看| 毛片av中文字幕一区二区| 99国产精品久久久久久久成人热 | 欧美喷潮久久久xxxxx| 亚洲一本大道在线| 久久久www成人免费无遮挡大片 | 久久精品国产亚洲aⅴ| 毛片一区二区三区| 亚洲天堂网站在线观看视频| 国产精品日韩欧美一区二区| 玖玖玖国产精品| 亚洲理伦在线| 一区二区三区高清在线观看| 国产精品女主播在线观看| 久久精品2019中文字幕| 亚洲二区视频在线| 亚洲国产一区二区a毛片| 欧美色视频日本高清在线观看| 久久精品成人一区二区三区| 91久久精品国产91性色| 在线精品一区二区| 国产精品久久久爽爽爽麻豆色哟哟| 午夜在线精品| 夜夜夜久久久| 久久一区中文字幕| 香蕉久久a毛片| 亚洲国产精品悠悠久久琪琪| 国产日韩一区欧美| 欧美美女日韩| 欧美电影在线观看完整版| 亚洲一卡久久| 麻豆精品在线视频| 久久精品国产久精国产爱| 日韩视频一区二区在线观看| 激情国产一区| 国产精品羞羞答答xxdd| 欧美午夜一区二区三区免费大片| 久久精品视频在线| 欧美一区二区在线| 在线一区亚洲| 亚洲视频在线观看| 91久久极品少妇xxxxⅹ软件| 亚洲欧美日韩国产综合在线 | 91久久夜色精品国产九色| 国产精品免费一区二区三区观看| 欧美日本高清| 久久夜色精品| 久久亚洲精品网站| 欧美一区二区三区久久精品 | 欧美一区二区三区在线观看| 一道本一区二区| 99成人精品| 91久久黄色| 亚洲精品色图| 亚洲黄色成人| 999在线观看精品免费不卡网站| 黄色国产精品| 在线观看一区视频| 国产亚洲精品一区二555| 国产三区精品| 国产伦精品免费视频| 国产日韩av高清| 国产精品美女| 国产小视频国产精品| 国产精品永久| 另类尿喷潮videofree| 亚洲午夜久久久久久尤物 | 国产精品久久久对白| 欧美激情亚洲视频| 欧美黄色大片网站| 欧美成人一区二区三区在线观看 | 亚洲精品日韩在线| 亚洲视频一区二区| 一区二区三区日韩欧美| 亚洲欧美国产不卡| 亚洲欧美日韩国产一区| 久久久免费观看视频| 久久资源在线| 亚洲激情视频在线观看| 91久久精品一区二区别| 99视频在线观看一区三区| 亚洲精品综合| 亚洲欧美日韩直播| 性欧美精品高清| 久久这里有精品视频| 欧美成年网站| 欧美午夜视频在线观看| 国产精品一区二区三区成人| 欧美日韩在线直播| 国产视频一区欧美| 伊人激情综合| 中文精品视频| 久久国产乱子精品免费女 | 亚洲人在线视频| 亚洲神马久久| 欧美一级视频| 亚洲国产成人av在线| 亚洲人精品午夜| 欧美一区二区三区啪啪| 久久aⅴ国产欧美74aaa| 欧美精品免费观看二区| 国产精品xxxxx| 欧美午夜视频网站| 国外视频精品毛片| 亚洲丝袜av一区| 久久精品日韩| 一区二区三区日韩精品| 久久国产精彩视频| 欧美日韩午夜剧场| 狠狠色狠狠色综合日日小说| 这里只有精品电影| 久久中文字幕一区二区三区| 免费av成人在线| 午夜精品福利电影| 欧美在线观看一区| 国产精品盗摄久久久| 国产精品网曝门| 亚洲精选大片| 久久福利精品| 亚洲视频在线观看三级| 久久久水蜜桃| 国产精品地址| 亚洲精品系列| 久久久久久久综合色一本| 亚洲黄色高清| 久久影视三级福利片| 国产精品午夜视频| 亚洲一区免费| 欧美激情亚洲综合一区| 久久精品亚洲| 国产精品大片免费观看| 一区二区欧美亚洲| 久久综合精品国产一区二区三区| 亚洲视频综合在线| 欧美成人免费在线观看| 依依成人综合视频| 午夜精品一区二区三区电影天堂 | 久久疯狂做爰流白浆xx| 日韩视频一区二区三区在线播放免费观看 | 尤物视频一区二区| 亚洲免费一在线| 亚洲国产高清在线| 久久伊人一区二区| 国产日韩精品一区| 亚洲尤物视频网| 亚洲国产精品成人久久综合一区| 欧美在线视频a| 国产精品色在线| 亚洲深夜影院| 亚洲麻豆一区| 欧美成人中文字幕在线| 一区二区三区自拍| 久久综合激情| 久久本道综合色狠狠五月| 国产精品美女在线|