|
|
发表于 2008-1-11 01:32:00
|
显示全部楼层
Re:.x文件里储存了些什么了
SDK里定义了一系列标准库(standard template)
3D mesh标准库
Animation
AnimationKey
AnimationOptions
AnimationSet
Boolen
Boolean2d
ColorRGB
ColorRGBA
Coords2d
FloatKeys
FrameTransformMatrix
Frame
Header
IndexedColor
Material
Matrix4*4
Mesh
MeshFace
MeshFaceWraps
MeshMaterialList
MeshNormals
MeshTextureCoords
MeshVertexColors
Patch
PatchMesh
Quaternion
SkinWeights
TextureFilename
TimeFloatKeys
Vector
VertexDuplicationIndices
XSkinMeshHeader
上面的标准库用DEFINE_GUID宏定义在rmxfguid.h文件中
给你发个X文件,自己研究一下
一个立方体,有4个红色的面,2个绿色的面
Material RedMaterial{
1000000;0.000000;0.000000;1.000000;;
0.000000;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;
}
Material GreenMaterial{
0.000000;1.000000;0.000000;1.000000;;
0.000000;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;
}
//Define a mesh with 8 vertices and 12 faces(triangles).Use
//optional data objects in the mesh to specify materials, normals,and texture coordinates.
Mesh CubMesh{
8; //8 vertices.
1.000000;1.000000;-1.000000;, //vertex 0.
-1.000000;1.000000;-1.000000;, //vertex 0.
-1.000000;1.000000;1.000000;, //And so on.
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;
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;
12;
0;
0;
0;
0;
0;
0;
0;
0;
1;
1;
1;
1;;
{RedMaterial}
{GreenMaterial}
}
MeshNormals{
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;
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;,
}
MeshTextureCllrds{
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;;
}
(由于分号在英文中“;”不是很清晰 所以,我改成用中文的“;”
这个请注意)
|
|