用的是March2008的DirectX,以前裝的那個版本看不了,具體是哪個忘了



Cube_4.x如下:
xof 0302txt 0064
Header {
1;
0;
1;
}
Material RedMaterial { //第一塊材料
1.000000;0.000000;0.000000;1.000000;; // R = 1.0, G = 0.0, B = 0.0
0.000000;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;
TextureFilename { "Tex1.jpg"; } //紋理文件名
}
Material GreenMaterial { //第二塊材料
0.000000;1.000000;0.000000;1.000000;; // R = 0.0, G = 1.0, B = 0.0
0.000000;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;
TextureFilename { "Tex2.jpg"; } //紋理文件名
}
Frame CubeFrame { //框架
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.001000, 0.001000, 0.001000, 1.000000;;
}
Mesh Cube { //網格
8; //8個頂點,以下為8個頂點的坐標
1.000000;1.000000;-1.000000;,
-1.000000;1.000000;-1.000000;,
-1.000000;1.000000;1.000000;,
1.000000;1.000000;1.000000;,
1.000000;-1.000000;-1.000000;,
-1.000000;-1.000000;-1.000000;,
-1.000000;-1.000000;1.000000;,
1.000000;-1.000000;1.000000;;
12; // 12個面, 以下為每個面三個頂點的索引
3;0,1,2;,
3;0,2,3;,
3;0,4,5;,
3;0,5,1;,
3;1,5,6;,
3;1,6,2;,
3;2,6,7;,
3;2,7,3;,
3;3,7,4;,
3;3,4,0;,
3;4,7,6;,
3;4,6,5;;
//網格材質列表
MeshMaterialList {
2; //使用材質的數量:2塊材質
12; //為12頂點指定材質
0, //為前6個面使用第一塊材質
0,
0,
0,
0,
0,
1, //為后面的6個面使用第二塊材質
1,
1,
1,
1,
1;;
{RedMaterial} //第一塊材質,引用前面定義的RedMaterial材質
{GreenMaterial} //第二塊材質,引用前面定義的GreenMaterial材質
}
//頂點法線
MeshNormals {
8; //定義8個法線向量
0.333333;0.666667;-0.666667;,
-0.816497;0.408248;-0.408248;,
-0.333333;0.666667;0.666667;,
0.816497;0.408248;0.408248;,
0.666667;-0.666667;-0.333333;,
-0.408248;-0.408248;-0.816497;,
-0.666667;-0.666667;0.333333;,
0.408248;-0.408248;0.816497;;
12; //為12個面的每個頂點指定法線
3;0,1,2;,
3;0,2,3;,
3;0,4,5;,
3;0,5,1;,
3;1,5,6;,
3;1,6,2;,
3;2,6,7;,
3;2,7,3;,
3;3,7,4;,
3;3,4,0;,
3;4,7,6;,
3;4,6,5;;
}
//紋理坐標
MeshTextureCoords {
8; //定義8對紋理坐標
0.000000;1.000000;
1.000000;1.000000;
0.000000;1.000000;
1.000000;1.000000;
0.000000;0.000000;
1.000000;0.000000;
0.000000;0.000000;
1.000000;0.000000;;
}
}
}
AnimationSet AnimationSet0 { //動畫集
Animation Animation0 { //動畫
{CubeFrame} //引用上面的立方體框架,表示下面的動畫是針對立方體框架的
AnimationKey { //動畫鍵 沿Y軸旋轉網格
0; // Position keys
10; // 9 keys
1000; 4; 0.000000, 0.15643448, 0.000000, 0.98768836;;, // 重劍注:這兒的值具體什么意思要對照AnimationKey的定義來看
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;;;
}
}
}
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 3, respectively).
- nKeys - Number of keys.
- keys - An array of keys.
=======
TimedFloatKeys
Defines a set of floats and a positive time used in animations.
template TimedFloatKeys
{
< F406B180-7B3B-11cf-8F52-0040333594A3 >
DWORD time;
FloatKeys tfkeys;
}
Where:
=============
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.
posted on 2008-04-02 21:48
七星重劍 閱讀(513)
評論(0) 編輯 收藏 引用 所屬分類:
Game Graphics