随笔 - 505  文章 - 1034  trackbacks - 0
<2008年4月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910


子曾经曰过:编程无他,唯手熟尔!

常用链接

留言簿(94)

随笔分类(649)

随笔档案(505)

相册

BCB

Crytek

  • crymod
  • Crytek's Offical Modding Portal

Game Industry

OGRE

other

Programmers

Qt

WOW Stuff

搜索

  •  

积分与排名

  • 积分 - 894614
  • 排名 - 14

最新随笔

最新评论

阅读排行榜

评论排行榜


用的是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.0000000.0000000.0000000.000000,
  
0.0000001.0000000.0000000.000000,
  
0.0000000.0000001.0000000.000000,
  
0.0010000.0010000.0010001.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
        100040.0000000.156434480.0000000.98768836;;, // 重剑注:这儿的值具体什么意思要对照AnimationKey的定义来看
        
200040.0000000.309017000.0000000.95105654;;,
        
300040.0000000.453990460.0000000.89100653;;,
        
400040.0000000.587785300.0000000.80901694;;,
        
500040.0000000.707106710.0000000.70710683;;,
        
600040.0000000.809016940.000000,  0.58778530;;,
        
700040.0000000.89100653,  0.0000000.45399052;;,
        
800040.0000000.95105654,  0.0000000.30901697;;,
        
900040.0000000.98768836,  0.0000000.15643449;;,
        
1000040.0000001.0000000,  0.0000000.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:

  • tfkeys - See FloatKeys.

=============

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

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理