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

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

網(wǎng)格模型高級(jí)技術(shù)(4)

為了使一個(gè).x文件產(chǎn)生動(dòng)畫(huà),必須至少提供一個(gè)動(dòng)畫(huà)集,每個(gè)動(dòng)畫(huà)集都應(yīng)具有一個(gè)對(duì)某個(gè)框架的引用。模板 AnimationSet用來(lái)定義動(dòng)畫(huà)集:

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是一個(gè)完全開(kāi)放的模板,一般情況下,用模板AnimationKey來(lái)填充它,模板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表示旋轉(zhuǎn)鍵,在.x文件中,用一個(gè)四元數(shù)來(lái)實(shí)現(xiàn)模型的旋轉(zhuǎn),旋轉(zhuǎn)值使用4個(gè)分量w、x、y、z來(lái)存儲(chǔ),也就是說(shuō),此時(shí)變換數(shù)組的大小是4,它依次存儲(chǔ)四元數(shù)的4個(gè)分量。

1表示縮放鍵,可以使用這種類(lèi)型的關(guān)鍵幀實(shí)現(xiàn)模型的縮放,此時(shí)變換數(shù)組的大小是3,它們分別對(duì)應(yīng)x、y、z軸的縮放值。

2表示平移鍵,使用3個(gè)分量實(shí)現(xiàn)模型的平移,此時(shí)變換數(shù)組的大小是3,它們分別對(duì)應(yīng)沿x、y、z軸的平移值。

4表示變換矩陣鍵,此時(shí)關(guān)鍵幀的變換數(shù)組使用16個(gè)浮點(diǎn)數(shù)來(lái)實(shí)現(xiàn)該模型的各種變換。因?yàn)榫仃嚳梢詫?shí)現(xiàn)模型的平移、旋轉(zhuǎn)、縮放以及它們的組合變換。

模板AnimationKey用來(lái)定義一組動(dòng)畫(huà)關(guān)鍵幀,而模板TimeFloatKeys用來(lái)定義每個(gè)動(dòng)畫(huà)關(guān)鍵幀:

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.

我們?cè)赾ube_3.x的基礎(chǔ)上添加動(dòng)畫(huà)部分形成cube_4.x,該動(dòng)畫(huà)集定義了立方體繞y軸旋轉(zhuǎn),增加部分如下:

AnimationSet AnimationSet0 {  //動(dòng)畫(huà)集
Animation Animation0 { //動(dòng)畫(huà)
{CubeFrame} //引用上面的立方體框架,表示下面的動(dòng)畫(huà)是針對(duì)立方體框架的
		AnimationKey {                //動(dòng)畫(huà)鍵   沿Y軸旋轉(zhuǎn)網(wǎng)格
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個(gè)關(guān)鍵幀,在第10個(gè)關(guān)鍵幀時(shí)回到初始位置開(kāi)始新一輪的動(dòng)畫(huà)。{CubeFrame}表示該動(dòng)畫(huà)集是對(duì)框架CubeFrame進(jìn)行的操作。

我們?cè)赾ube_3.x的基礎(chǔ)上添加縮放動(dòng)畫(huà)形成cube_5.x:

AnimationSet AnimationSet0 {   //動(dòng)畫(huà)集
Animation Animation0 { //動(dòng)畫(huà)
{CubeFrame} // Use the frame containing the cube.
		AnimationKey {                 //動(dòng)畫(huà)鍵, 放大和縮小網(wǎng)格
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的基礎(chǔ)上添加一個(gè)沿y軸移動(dòng)的動(dòng)畫(huà)形成cube_6.x:

AnimationSet AnimationSet0 {   //動(dòng)畫(huà)集
Animation Animation0 { //動(dòng)畫(huà)
{CubeFrame} // Use the frame containing the cube.
		AnimationKey {                 //動(dòng)畫(huà)鍵   沿Y軸方向移動(dòng)網(wǎng)格
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文件中的動(dòng)畫(huà)通常用來(lái)實(shí)現(xiàn)模型不同部分之間的相對(duì)運(yùn)動(dòng),對(duì)于一個(gè)模型整體上的運(yùn)動(dòng),應(yīng)該是在程序中通過(guò)其世界變換矩陣來(lái)實(shí)現(xiàn)。

 

蒙皮信息

一個(gè)動(dòng)畫(huà)網(wǎng)格模型很多情況下可能涉及到蒙皮信息,模板X(qián)SkinMeshHeader僅對(duì)于具有蒙皮信息的網(wǎng)格模型有效,它用來(lái)記錄網(wǎng)格模型的蒙皮信息,該模板的定義如下:

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.

在一個(gè)具有蒙皮信息的網(wǎng)格模型中,可能出現(xiàn)模板SkinWeights的n個(gè)實(shí)例,n等于該網(wǎng)格模型中骨骼的數(shù)量。該模板的每個(gè)實(shí)例都定義了一個(gè)具體的骨骼對(duì)于相應(yīng)頂點(diǎn)的影響權(quá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 閱讀(2029) 評(píng)論(1)  編輯 收藏 引用

評(píng)論

# re: 網(wǎng)格模型高級(jí)技術(shù)(4) 2013-09-06 17:29 abc

講的太好了  回復(fù)  更多評(píng)論   


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


公告

導(dǎo)航

統(tǒng)計(jì)

常用鏈接

隨筆分類(lèi)(178)

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

搜索

最新評(píng)論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            欧美久久一级| 国产精品三上| 亚洲电影免费在线观看| 久久av资源网| 久久成人资源| 亚洲大片一区二区三区| 欧美成人综合| 欧美激情第10页| 亚洲先锋成人| 亚洲一区二区视频在线| 国产亚洲精品高潮| 男女av一区三区二区色多| 欧美**人妖| 亚洲欧美综合国产精品一区| 欧美一区二区成人6969| 亚洲高清一二三区| 99re国产精品| 国模私拍一区二区三区| 欧美高清视频| 国产精品国产三级欧美二区| 久久久久中文| 欧美精品二区| 久久国产66| 欧美激情精品久久久久久黑人 | 国产精品自拍网站| 欧美91精品| 国产精品久久9| 模特精品在线| 国产精品亚洲人在线观看| 乱码第一页成人| 欧美三区视频| 久久米奇亚洲| 欧美亚日韩国产aⅴ精品中极品| 久久精品国产精品亚洲| 欧美极品在线观看| 久久精品亚洲精品国产欧美kt∨| 男女激情久久| 久久久福利视频| 欧美午夜电影在线| 欧美激情1区| 国产最新精品精品你懂的| 一区二区三区久久| 99视频精品在线| 久久亚洲国产精品日日av夜夜| 午夜精品久久| 欧美三级精品| 亚洲黄色有码视频| 一区在线影院| 亚洲免费视频成人| 日韩视频免费| 美女网站久久| 久久一区二区视频| 国产婷婷色一区二区三区四区| 日韩午夜激情| 99国产精品久久久| 欧美电影免费观看大全| 免费不卡中文字幕视频| 国产又爽又黄的激情精品视频| 亚洲一级在线观看| 亚洲一区二区毛片| 欧美日韩国产首页在线观看| 欧美激情一级片一区二区| 亚洲电影在线看| 久久久久一区二区三区| 久久久五月婷婷| 国产一区二区激情| 久久成人免费网| 久久久天天操| 在线观看欧美日本| 久久久噜噜噜久久| 欧美不卡三区| 亚洲精品免费在线播放| 欧美乱人伦中文字幕在线| 亚洲区欧美区| 一区二区三区免费看| 欧美日韩中国免费专区在线看| 日韩视频精品在线| 香蕉久久夜色精品国产使用方法| 国产精品人人做人人爽| 亚洲欧美999| 久久在线免费| 91久久国产综合久久| 欧美激情一区二区久久久| 亚洲人成久久| 午夜视频一区| 影音先锋久久资源网| 女同一区二区| 日韩午夜免费| 欧美中文字幕在线视频| 在线国产日韩| 欧美日本网站| 亚洲欧美一级二级三级| 欧美成人中文| 亚洲视频一区二区免费在线观看| 国产精品国产亚洲精品看不卡15| 午夜精品视频| 最新日韩欧美| 久久aⅴ国产欧美74aaa| 亚洲国产精品999| 欧美午夜精品久久久| 欧美一级黄色网| 亚洲欧洲精品一区二区| 欧美亚洲视频在线观看| 最新中文字幕一区二区三区| 欧美三级欧美一级| 久久先锋影音| 一本色道久久综合亚洲精品婷婷| 久久久999精品免费| 99国产精品99久久久久久粉嫩 | 麻豆av一区二区三区久久| 99av国产精品欲麻豆| 久久亚洲综合网| 亚洲一区不卡| 亚洲国产一区二区三区在线播| 欧美视频1区| 老司机免费视频一区二区三区| 99视频在线精品国自产拍免费观看| 久久性色av| 午夜精品免费| 一区二区不卡在线视频 午夜欧美不卡'| 国产精品入口麻豆原神| 欧美成人福利视频| 久久久美女艺术照精彩视频福利播放| 亚洲精品视频一区二区三区| 卡一卡二国产精品| 久久黄色网页| 亚洲一区二区影院| 日韩西西人体444www| 亚洲电影中文字幕| 好看不卡的中文字幕| 国产精品社区| 国产精品推荐精品| 欧美日韩综合在线| 欧美日韩国产综合一区二区 | 亚洲图片欧洲图片日韩av| 亚洲国产一区二区在线| 免费中文字幕日韩欧美| 蜜桃av综合| 你懂的国产精品| 美腿丝袜亚洲色图| 久久在线91| 美国十次成人| 欧美jizz19hd性欧美| 久久夜色精品国产| 免费成人性网站| 欧美成年网站| 亚洲高清久久久| 亚洲国产精品成人va在线观看| 欧美成年人视频网站| 欧美激情小视频| 91久久国产综合久久蜜月精品| 欧美国产高清| 亚洲黄色在线视频| 9久草视频在线视频精品| 这里只有精品视频在线| 亚洲免费在线观看视频| 欧美一区日本一区韩国一区| 久久av一区二区三区亚洲| 久久久久久久综合日本| 免费视频一区| 欧美日韩免费在线| 国产精品一区免费在线观看| 国产日本欧美一区二区三区| 国自产拍偷拍福利精品免费一| 精品999久久久| 亚洲精品一区在线观看香蕉| 99精品视频免费全部在线| 亚洲制服av| 久久蜜桃资源一区二区老牛| 欧美激情第二页| 日韩视频一区| 欧美一区二区视频在线观看2020| 久久一区欧美| 欧美三级电影一区| 狠狠色综合网站久久久久久久| 亚洲国产三级网| 亚洲欧美久久久| 久热精品视频在线观看| 亚洲国产第一| 亚洲欧美日韩综合| 欧美成人性网| 国产精品一区二区久激情瑜伽| 影音先锋欧美精品| 亚洲一区二区三区精品动漫| 久久综合色一综合色88| 夜夜夜久久久| 狼狼综合久久久久综合网| 国产精品美女午夜av| 亚洲高清二区| 午夜亚洲性色视频| 亚洲人成高清| 久久一二三区| 国产女主播视频一区二区| 亚洲精品一区久久久久久| 久久久久久久尹人综合网亚洲 | 久久久精品日韩| 99国产精品久久久久久久| 久久免费精品视频| 国产乱理伦片在线观看夜一区| 亚洲精品国产无天堂网2021|