用的是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 
七星重剑 阅读(525) 
评论(0)  编辑 收藏 引用  所属分类: 
Game Graphics