The following message is the same as the previous message I send on the
twenty first of December... but with as X file listing. I decided to add
this listing to make it easier for you to perform the AnimationKey testing.
Hi
I'm currently learning X file data formatting. I created an animation frame
and mesh to be viewed by Directx mview.exe. Animations using Quaternion,
Scaling, and Positioning type keys work fine. But when I tried to animate
with the Transform key, nothing happens, it just ignore it. The following
AnimationKey is an exact of the data I used. I used random data in hopes to
see something changing. but nothing changed.
How do I get the Animated Transform Matrix to work?
Sincerely,
King
The following listing is a complete X file animator:
PS: don't forget to delete the HTML PRE tags. I'm hope this will preserve
white spaces.
xof 0303txt 0032
Material RedMaterial {
1.000000;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;;
}
Material PurpleMaterial {
1.000000;0.000000;1.000000;1.000000;;
0.000000;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;
}
Material YellowMaterial {
1.000000;1.000000;0.000000;1.000000;;
0.000000;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;
}
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 CubeFrame1 {
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,-30.000000,1.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 CubeMesh1 {
8; // 8 vertices.
1.000000;1.000000;-1.000000;, // Vertex 0.
-1.000000;1.000000;-1.000000;, // Vertex 1.
-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; // 12 faces.
3;0,1,2;, // Face 0 has three vertices.
3;0,2,3;, // And so on.
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; // Number of materials used.
12; // A material for each face.
0, // Face 0 uses the first material.
0,
0,
0,
0,
0,
0,
0,
1, // Face 8 uses the second material.
1,
1,
1;;
{RedMaterial} // References to the definitions
{GreenMaterial} // of material 0 and 1.
}
MeshNormals {
8; // Define 8 normals.
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; // For the 12 faces, define the normals.
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; // Define texture coords for each vertex.
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;;
}
}
Frame CubeFrame2 {
FrameTransformMatrix {
3.000000,0.000000,0.000000,0.000000,
0.000000,1.000000,0.000000,0.000000,
0.000000,0.000000,1.000000,0.000000,
4.000000,-6.000000,0.000000,1.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 CubeMesh2 {
8; // 8 vertices.
1.000000;1.000000;-1.000000;, // Vertex 0.
-1.000000;1.000000;-1.000000;, // Vertex 1.
-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; // 12 faces.
3;0,1,2;, // Face 0 has three vertices.
3;0,2,3;, // And so on.
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; // Number of materials used.
12; // A material for each face.
0, // Face 0 uses the first material.
0,
0,
0,
0,
0,
0,
0,
1, // Face 8 uses the second material.
1,
1,
1;;
{PurpleMaterial} // References to the definitions
{YellowMaterial} // of material 0 and 1.
}
MeshNormals {
8; // Define 8 normals.
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; // For the 12 faces, define the normals.
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; // Define texture coords for each vertex.
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;;
}
}
}
}
}
Animation Animation0 {
{CubeFrame1}
AnimationKey {
0; // Quaternion(w,x,y,z) keys
9; // 9 TimedFloatKeys
1000; 4; 0.000000, 0.000000, 0.000000, 1.000000;;,
2000; 4; 0.342020, 0.000000, 0.000000, 0.939693;;,
3000; 4; 0.642788, 0.000000, 0.000000, 0.766044;;,
4000; 4; 0.866025, 0.000000, 0.000000, 0.500000;;,
5000; 4; 0.984808, 0.000000, 0.000000, 0.173648;;,
6000; 4; 0.984808, 0.000000, 0.000000, -0.173648;;,
7000; 4; 0.866025, 0.000000, 0.000000, -0.500000;;,
8000; 4; 0.642788, 0.000000, 0.000000, -0.766044;;,
9000; 4; 0.342020, 0.000000, 0.000000, -0.939693;;;
}
AnimationKey {
2; // Position keys
9; // 9 TimedFloatKeys
1000; 3; 20.000000, 0.000000, 0.000000;;,
2000; 3; 15.000000, 0.000000, 0.000000;;,
3000; 3; 10.000000, 0.000000, 0.000000;;,
4000; 3; 5.000000, 0.000000, 0.000000;;,
5000; 3; 0.000000, 0.000000, 0.000000;;,
6000; 3; -5.000000, 0.000000, 0.000000;;,
7000; 3; -10.000000, 0.000000, 0.000000;;,
8000; 3; -15.000000, 0.000000, 0.000000;;,
9000; 3; -20.000000, 0.000000, 0.000000;;;
}
AnimationOptions
{
0;
1;
}
}
Animation Animation1 {
{CubeFrame2}
AnimationKey {
3; // Transforms keys - Appears not to work!
// OR, I don't know how to use it!
9; // 9 TimedFloatKeys
1000; 16; 1.000000, 0.000000, 1.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 2.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000;;,
2000; 16; 0.900000, 0.000000, 0.000000, 0.000000,
0.000000, 0.970000, 0.000000, 0.000000,
0.000000, 0.000000, 3.000000, 0.000000,
1.000000, 1.000000, 0.000000, 1.000000;;,
3000; 16; 0.800000, 0.000000, 0.000000, 0.000000,
0.000000, 0.950000, 2.000000, 0.000000,
0.000000, 0.000000, 4.000000, 0.000000,
2.000000, 2.000000, 0.000000, 1.000000;;,
4000; 16; 0.700000, 0.000000, 0.000000, 0.000000,
0.000000, 0.920000, 0.000000, 0.000000,
0.000000, 0.000000, 3.000000, 0.000000,
3.000000, 3.000000, 0.000000, 1.000000;;,
5000; 16; 0.600000, 0.000000, 0.000000, 0.000000,
0.000000, 0.800000, 3.000000, 0.000000,
0.000000, 0.000000, 2.000000, 0.000000,
2.000000, 2.000000, 0.000000, 1.000000;;,
6000; 16; 0.500000, 0.000000, 0.000000, 0.000000,
0.000000, 0.600000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
1.000000, 1.000000, 0.000000, 1.000000;;,
7000; 16; 0.400000, 0.000000, 0.000000, 0.000000,
0.000000, 0.600000, 0.000000, 0.000000,
0.000000, 0.000000, 4.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000;;,
8000; 16; 0.300000, 0.000000, 0.000000, 0.000000,
0.000000, 0.700000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
-1.000000, 0.000000, 0.000000, 1.000000;;,
9000; 16; 0.200000, 0.000000, 0.000000, 0.000000,
0.000000, 0.800000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
-2.000000, 0.000000, 0.000000, 1.000000;;;
}
AnimationOptions
{
0;
1;
}
}
//AnimTicksPerSecond {
// 4800;
//}
AnimationSet AnimationSet0 {
{Animation0}
{Animation1}
}