xof 0303txt 0032//文件类型 版本&格式 数值表示方法(32位浮点)
template XSkinMeshHeader {//
<3cf169ce-ff7c-44ab-93c0-f78f62d172e2>//模板 UUID
WORD nMaxSkinWeightsPerVertex;
WORD nMaxSkinWeightsPerFace;
WORD nBones;
}
template VertexDuplicationIndices {
<b8d65549-d7c9-4995-89cf-53a9a8b031e3>
DWORD nIndices;
DWORD nOriginalVertices;
array DWORD indices[nIndices];
}
template SkinWeights {
<6f0d123b-bad2-4167-a0d0-80224f25fabb>
STRING transformNodeName;
DWORD nWeights;
array DWORD vertexIndices[nWeights];
array FLOAT weights[nWeights];
Matrix4x4 matrixOffset;
}
Frame Scene_Root {//框架 名称
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.000000,0.000000,0.000000,1.000000;;
}
Frame body {
FrameTransformMatrix {
1.278853,0.000000,-0.000000,0.000000,0.000000,0.000000,1.123165,0.000000,0.000000,-1.470235,0.000000,0.000000,0.135977,2.027985,133.967667,1.000000;;
}
Frame {
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.142114,0.000023,-49.556850,1.000000;;
}
Mesh {
4432;点的个数
-34.720058;-12.484819;48.088928;,
.....//4432 行,对应每一个点坐标
-30.350075;-31.719879;45.630089;;
6841;面的个数
3;28,62,1;,
.....//6841行,对应每一个面的组成点
3;61,0,4431;;
MeshNormals {
4432;//点的法向量
-0.989571;-0.011953;-0.143551;,
-0.914875;-0.152402;-0.373869;;
6841;//面的法向量,给出计算索引
3;28,62,1;,
......
3;61,0,4431;;
}
MeshTextureCoords {
4432;//纹理坐标,每个点的
0.551713;0.158481;,
.... //共4432行,对应4432点的纹理坐标,因为有可能一个点可能有多个面共享,所有就有多个纹理坐标
0.551922;0.238188;;
}
VertexDuplicationIndices { //重复点索引
4432;//总点数
3420;//实际点数
0,
1,
2,
......//共4432行,每行对应的实际点
3419;
}
MeshMaterialList {
1; //材质数量
6841;//面数量
0,
.....共6841行,对应6841个面的材质
0;
Material { //材质
1.000000;1.000000;1.000000;1.000000;;
0.000000;
1.000000;1.000000;1.000000;;
0.000000;0.000000;0.000000;;
TextureFilename {//纹理贴图
"Tiny_skin.bmp";
}
}
} //网格定义结束
XSkinMeshHeader {//蒙皮头
2; //影响一个点最大骨骼数(变换矩阵)
4;//影响一个面最大骨骼数(变换矩阵),一个面有3个点,可能是3*上面的数
35;//骨骼数量,(变换矩阵的数量)
}
SkinWeights {//骨骼重量
"Bip01_R_UpperArm";//名称,与Frame对应
156;//影响点的个数
1
..... //156个点
1738;
0.605239,
..... //156个骨重
0.979129;
.. //骨骼变换矩阵
-0.941743,-0.646748,0.574719,0.000000,-0.283133,-0.461979,-0.983825,0.000000,0.923060,-1.114919,0.257891,0.000000,-65.499557,30.497688,12.852692,1.000000;;
}
.......共35个SkinWeights
}
}
}
Frame Box01 {
FrameTransformMatrix {
-1.000000,0.000000,-0.000000,0.000000,-0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,-88.696747,-246.341751,858.815247,1.000000;;
}
Frame Bip01 {
FrameTransformMatrix {
0.186552,-0.974653,0.123489,0.000000,0.982171,0.187991,0.000000,0.000000,-0.023215,0.121288,0.992346,0.000000,-88.977890,-857.346008,247.541595,1.000000;;
}
Frame Bip01_Footsteps {
FrameTransformMatrix {
0.186552,0.982171,-0.023215,0.000000,-0.974653,0.187991,0.121288,0.000000,0.123489,-0.000000,0.992346,0.000000,-31.624149,0.000000,-254.128143,1.000000;;
}
}
}
.........余下省略
.......框架矩阵,支撑mesh,与骨骼变换矩阵联合完成蒙皮效果.
}
AnimationSet {
Animation {
AnimationKey {
4; //变换类型 0-旋转 1-放缩 2-平移 4-变换矩阵
2; //动画数量
0;16;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.000000,0.000000,0.000000,1.000000;;,
4960;16;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.000000,0.000000,0.000000,1.000000;;;
}
{ Scene_Root }
}
Animation {
AnimationKey {
4;
2;
0;16;1.278853,0.000000,-0.000000,0.000000,0.000000,0.000000,1.123165,0.000000,0.000000,-1.470235,0.000000,0.000000,0.135977,2.027985,133.967667,1.000000;;,
4960;16;1.278853,0.000000,-0.000000,0.000000,0.000000,0.000000,1.123165,0.000000,0.000000,-1.470235,0.000000,0.000000,0.135977,2.027985,133.967667,1.000000;;;
}
{ body }
}
Animation {
AnimationKey {
4;
62;
0;16;-1.000000,0.000000,-0.000000,0.000000,-0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,-88.696747,-245.951797,351.625824,1.000000;;,
....共62行,动画转换矩阵
4960;16;-1.000000,0.000000,-0.000000,0.000000,-0.000000,0.000000,1.000000,0.000000,0.000000,1.000000,0.000000,0.000000,-88.696747,-245.951797,351.625824,1.000000;;;
}
{ Box01 }
}
Animation {
AnimationKey {
4;
62;
0;16;0.215193,-0.969920,0.113783,0.000000,0.976260,0.216600,-0.000000,0.000000,-0.024646,0.111082,0.993506,0.000000,-88.995270,-350.280182,247.734116,1.000000;;,
....共62行,动画转换矩阵
4960;16;0.215193,-0.969920,0.113783,0.000000,0.976260,0.216600,-0.000000,0.000000,-0.024646,0.111082,0.993506,0.000000,-88.995270,-350.280182,247.734116,1.000000;;;
}
{ Bip01 }
.........余下省略
}