I am programming a 3D game. I develop the meshes using Blender and export .x files from it. I have to parse the .x file and write it's data into a file that has a bit different structure, so my program gets the data a little bit faster. Because of it I need to know the meaning of the following detail in .x file format.
Code:
Frame RootFrame {
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 Cube_001 {
FrameTransformMatrix {
0.965900,-0.258800,0.000000,0.000000,
0.258800,0.965900,0.000000,0.000000,
0.000000,0.000000,1.000000,0.000000,
3.023400,5.487700,1.262100,1.000000;;
}
I don't understand the first part of it at all. I understand the second part a bit.
In my parser program I use the second part in the following way:
Code:
fscanf(x_file, "%f,%f,%f,%f,\n", &kord_x, &kord_temp, &kord_temp, &kord_temp);
fscanf(x_file, "%f,%f,%f,%f,\n", &kord_temp, &kord_y, &kord_temp, &kord_temp);
fscanf(x_file, "%f,%f,%f,%f;;\n", &kord_temp, &kord_temp, &kord_z, &kord_temp);
Code:
for(int j=0; j<vertex_count[i]-1; j++)
{
x[j]=x[j]*kord_x;
y[j]=y[j]*kord_y;
z[j]=z[j]*kord_z;
}
So I use the transformation to get the true size of the mesh into coordinates.
My question is: what are the other things and are they something important?