Here's a little example I made long ago (It was one of my paranoises trying to make a mechanical shovel .
For those who do not know how to see this example. Simply copy and paste into a text file and rename the extension to .x Ex. Object.x
xof 0303txt 0032
//definiendo colores
Material amarillo {
1.000000;1.000000;0.000000;1.000000;; // R = 1.0, G = 0.0, B = 0.0 Alpha =1
0.000000;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;
}
Material azul {
0.000000;0.000000;1.000000;1.000000;; // R = 1.0, G = 0.0, B = 0.0 Alpha =1
0.000000;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;
}
Material marron {
0.340000;0.200000;0.000000;1.000000;; // R = 1.0, G = 0.0, B = 0.0 Alpha =1
0.000000;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;
}
Material rojo {
1.000000;0.000000;0.000000;1.000000;; // R = 1.0, G = 0.0, B = 0.0 Alpha =1
0.000000;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;
}
Frame cuerpo {
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;;
}
Mesh cuerpo{
24;
-3.500000;3.500000;-6.000000;,
3.500000;3.500000;-6.000000;,
3.500000;-3.500000;-6.000000;,
-3.500000;-3.500000;-6.000000;,
-3.500000;3.500000;6.000000;,
-3.500000;-3.500000;6.000000;,
3.500000;-3.500000;6.000000;,
3.500000;3.500000;6.000000;,
-3.500000;3.500000;6.000000;,
3.500000;3.500000;6.000000;,
3.500000;3.500000;-6.000000;,
-3.500000;3.500000;-6.000000;,
-3.500000;-3.500000;6.000000;,
-3.500000;-3.500000;-6.000000;,
3.500000;-3.500000;-6.000000;,
3.500000;-3.500000;6.000000;,
3.500000;3.500000;-6.000000;,
3.500000;3.500000;6.000000;,
3.500000;-3.500000;6.000000;,
3.500000;-3.500000;-6.000000;,
-3.500000;3.500000;-6.000000;,
-3.500000;-3.500000;-6.000000;,
-3.500000;-3.500000;6.000000;,
-3.500000;3.500000;6.000000;;
12;
3;0,1,2;,
3;2,3,0;,
3;4,5,6;,
3;6,7,4;,
3;8,9,10;,
3;10,11,8;,
3;12,13,14;,
3;14,15,12;,
3;16,17,18;,
3;18,19,16;,
3;20,21,22;,
3;22,23,20;;
MeshNormals {
24;
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;;
12;
3;0,1,2;,
3;2,3,0;,
3;4,5,6;,
3;6,7,4;,
3;8,9,10;,
3;10,11,8;,
3;12,13,14;,
3;14,15,12;,
3;16,17,18;,
3;18,19,16;,
3;20,21,22;,
3;22,23,20;;
}
MeshTextureCoords {
24;
0.000000;0.000000;,
1.000000;0.000000;,
1.000000;1.000000;,
0.000000;1.000000;,
1.000000;0.000000;,
1.000000;1.000000;,
0.000000;1.000000;,
0.000000;0.000000;,
0.000000;0.000000;,
1.000000;0.000000;,
1.000000;1.000000;,
0.000000;1.000000;,
0.000000;1.000000;,
0.000000;0.000000;,
1.000000;0.000000;,
1.000000;1.000000;,
0.000000;0.000000;,
1.000000;0.000000;,
1.000000;1.000000;,
0.000000;1.000000;,
1.000000;0.000000;,
1.000000;1.000000;,
0.000000;1.000000;,
0.000000;0.000000;;
}
MeshMaterialList { // Cube material list
1;
6;
0,
0,
0,
0,
0,
0;;
{azul}
}
}
Frame brazo {
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;;
}
Mesh brazo{
100;
-4.999999;1.500000;-0.999999;,
-4.999999;-1.500000;-0.999999;,
-4.999999;-1.500000;18.999998;,
-4.999999;1.500000;18.999998;,
-4.999999;1.500000;-0.999999;,
-4.000000;1.500000;-0.999999;,
-4.000000;1.200000;-0.999999;,
-4.000000;1.500000;-0.999999;,
4.999999;1.500000;-0.999999;,
4.999999;-1.500000;-0.999999;,
4.999999;-1.500000;-0.999999;,
-4.000000;-1.500000;-0.999999;,
-4.999999;-1.500000;-0.999999;,
-4.999999;1.500000;-0.999999;,
-4.000000;-1.500000;-0.999999;,
-4.000000;1.200000;-0.999999;,
-4.999999;1.500000;18.999998;,
-4.999999;-1.500000;18.999998;,
-4.000000;-1.500000;18.999998;,
-4.999999;1.500000;18.999998;,
-4.000000;1.200000;18.999998;,
-4.000000;1.500000;18.999998;,
-4.000000;1.200000;18.999998;,
-4.999999;1.500000;18.999998;,
-4.000000;1.500000;18.999998;,
-4.000000;1.500000;16.999998;,
-4.000000;1.500000;-0.999999;,
-4.999999;1.500000;-0.999999;,
-4.999999;1.500000;18.999998;,
-4.000000;1.500000;-0.999999;,
-4.000000;1.500000;16.999998;,
-4.999999;-1.500000;18.999998;,
-4.999999;-1.500000;-0.999999;,
-4.000000;-1.500000;-0.999999;,
-4.999999;-1.500000;18.999998;,
-4.000000;-1.500000;-0.999999;,
-4.000000;-1.500000;16.999998;,
-4.000000;-1.500000;18.999998;,
-4.000000;-1.500000;16.999998;,
4.999999;-1.500000;1.000000;,
4.999999;-1.500000;-0.999999;,
4.999999;1.500000;-0.999999;,
4.999999;-1.500000;1.000000;,
4.999999;1.500000;-0.999999;,
4.999999;1.200000;1.000000;,
4.999999;-1.500000;18.999998;,
4.999999;1.500000;1.000000;,
4.999999;1.200000;1.000000;,
4.999999;1.500000;1.000000;,
4.999999;1.500000;18.999998;,
4.999999;-1.500000;18.999998;,
4.999999;-1.500000;-0.999999;,
4.999999;-1.500000;1.000000;,
4.000000;-1.500000;1.000000;,
-4.000000;-1.500000;-0.999999;,
4.000000;-1.500000;1.000000;,
-4.000000;-1.500000;1.000000;,
4.999999;1.500000;-0.999999;,
-4.000000;1.500000;1.000000;,
4.999999;1.500000;-0.999999;,
4.000000;1.500000;1.000000;,
4.999999;1.500000;1.000000;,
4.000000;1.500000;1.000000;,
4.000000;-1.500000;18.999998;,
4.999999;-1.500000;18.999998;,
4.000000;-1.200000;18.999998;,
4.999999;-1.500000;18.999998;,
4.999999;1.500000;18.999998;,
4.000000;1.500000;18.999998;,
4.000000;-1.200000;18.999998;,
4.000000;1.500000;18.999998;,
4.999999;1.500000;18.999998;,
4.999999;1.500000;1.000000;,
4.999999;-1.500000;1.000000;,
4.999999;-1.500000;18.999998;,
4.000000;-1.500000;18.999998;,
-4.000000;-1.500000;18.999997;,
-4.000000;-1.500000;18.499997;,
-4.000000;1.500000;3.500000;,
-4.000000;1.500000;18.999998;,
-4.000000;-1.500000;18.499998;,
-4.000000;-1.500000;1.000000;,
-4.000000;1.500000;1.000000;,
-4.000000;1.500000;3.500001;,
4.000000;1.500000;3.500000;,
4.000000;1.500000;1.000000;,
4.000000;-1.500000;1.000000;,
4.000000;-1.500000;18.499997;,
4.000000;-1.500000;18.499998;,
4.000000;-1.500000;18.999998;,
4.000000;1.500000;18.999997;,
4.000000;1.500000;3.500001;,
-3.000000;1.500000;1.000000;,
-4.000000;1.500000;1.000000;,
-4.000000;-1.500000;1.000000;,
3.000000;-1.500000;1.000000;,
-3.000000;1.500000;1.000000;,
3.000000;-1.500000;1.000000;,
4.000000;-1.500000;1.000000;,
4.000000;1.500000;1.000000;;
48;
3;0,1,2;,
3;2,3,0;,
3;4,5,6;,
3;7,8,9;,
3;5,10,6;,
3;11,12,13;,
3;14,4,15;,
3;9,11,15;,
3;16,17,18;,
3;19,18,20;,
3;21,16,22;,
3;23,24,25;,
3;26,27,28;,
3;29,23,30;,
3;31,32,33;,
3;34,35,36;,
3;37,31,38;,
3;39,40,41;,
3;42,43,44;,
3;45,39,44;,
3;41,46,47;,
3;48,49,50;,
3;46,45,47;,
3;51,52,53;,
3;54,51,55;,
3;33,55,56;,
3;57,26,58;,
3;59,58,60;,
3;61,57,62;,
3;63,64,65;,
3;66,67,68;,
3;64,68,69;,
3;70,71,72;,
3;70,61,60;,
3;73,74,75;,
3;52,75,53;,
3;76,77,78;,
3;79,76,78;,
3;80,81,82;,
3;83,80,82;,
3;84,85,86;,
3;87,84,86;,
3;88,89,90;,
3;91,88,90;,
3;92,93,94;,
3;95,96,94;,
3;97,98,99;,
3;92,95,99;;
MeshNormals {
100;
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;;
48;
3;0,1,2;,
3;2,3,0;,
3;4,5,6;,
3;7,8,9;,
3;5,10,6;,
3;11,12,13;,
3;14,4,15;,
3;9,11,15;,
3;16,17,18;,
3;19,18,20;,
3;21,16,22;,
3;23,24,25;,
3;26,27,28;,
3;29,23,30;,
3;31,32,33;,
3;34,35,36;,
3;37,31,38;,
3;39,40,41;,
3;42,43,44;,
3;45,39,44;,
3;41,46,47;,
3;48,49,50;,
3;46,45,47;,
3;51,52,53;,
3;54,51,55;,
3;33,55,56;,
3;57,26,58;,
3;59,58,60;,
3;61,57,62;,
3;63,64,65;,
3;66,67,68;,
3;64,68,69;,
3;70,71,72;,
3;70,61,60;,
3;73,74,75;,
3;52,75,53;,
3;76,77,78;,
3;79,76,78;,
3;80,81,82;,
3;83,80,82;,
3;84,85,86;,
3;87,84,86;,
3;88,89,90;,
3;91,88,90;,
3;92,93,94;,
3;95,96,94;,
3;97,98,99;,
3;92,95,99;;
}
MeshTextureCoords {
100;
1.000000;0.000000;,
1.000000;1.000000;,
0.000000;1.000000;,
0.000000;0.000000;,
0.000000;0.000000;,
0.100000;0.000000;,
0.100000;0.100000;,
0.100000;0.000000;,
1.000000;0.000000;,
1.000000;1.000000;,
1.000000;1.000000;,
0.100000;1.000000;,
0.000000;1.000000;,
0.000000;0.000000;,
0.100000;1.000000;,
0.100000;0.100000;,
1.000000;0.000000;,
1.000000;1.000000;,
0.900000;1.000000;,
1.000000;0.000000;,
0.900000;0.100000;,
0.900000;0.000000;,
0.900000;0.100000;,
0.000000;0.000000;,
0.100000;0.000000;,
0.100000;0.100000;,
0.100000;1.000000;,
0.000000;1.000000;,
0.000000;0.000000;,
0.100000;1.000000;,
0.100000;0.100000;,
0.000000;1.000000;,
0.000000;0.000000;,
0.100000;0.000000;,
0.000000;1.000000;,
0.100000;0.000000;,
0.100000;0.900000;,
0.100000;1.000000;,
0.100000;0.900000;,
0.100000;1.000000;,
0.000000;1.000000;,
0.000000;0.000000;,
0.100000;1.000000;,
0.000000;0.000000;,
0.100000;0.100000;,
1.000000;1.000000;,
0.100000;0.000000;,
0.100000;0.100000;,
0.100000;0.000000;,
1.000000;0.000000;,
1.000000;1.000000;,
1.000000;0.000000;,
1.000000;0.100000;,
0.900000;0.100000;,
0.100000;0.000000;,
0.900000;0.100000;,
0.100000;0.100000;,
1.000000;1.000000;,
0.100000;0.900000;,
1.000000;1.000000;,
0.900000;0.900000;,
1.000000;0.900000;,
0.900000;0.900000;,
0.100000;1.000000;,
0.000000;1.000000;,
0.100000;0.900000;,
0.000000;1.000000;,
0.000000;0.000000;,
0.100000;0.000000;,
0.100000;0.900000;,
0.900000;0.000000;,
1.000000;0.000000;,
1.000000;0.900000;,
1.000000;0.100000;,
1.000000;1.000000;,
0.900000;1.000000;,
0.100000;0.875000;,
0.125000;0.875000;,
0.875000;0.125000;,
0.100000;0.125000;,
0.125000;0.875000;,
1.000000;0.875000;,
1.000000;0.125000;,
0.875000;0.125000;,
0.125000;0.125000;,
0.000000;0.125000;,
0.000000;0.875000;,
0.875000;0.875000;,
0.875000;0.875000;,
0.900000;0.875000;,
0.900000;0.125000;,
0.125000;0.125000;,
0.125000;0.125000;,
0.000000;0.125000;,
0.000000;0.875000;,
0.875000;0.875000;,
0.125000;0.125000;,
0.875000;0.875000;,
1.000000;0.875000;,
1.000000;0.125000;;
}
MeshMaterialList { // Cube material list
1;
6;
0,
0,
0,
0,
0,
0;;
{amarillo}
}
}
Frame cuchara{
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;;
}
Mesh cuchara{
125;
-4.000000;4.600000;-1.000000;,
-4.000000;-1.400000;-1.000000;,
-4.000000;-1.400000;5.000000;,
-4.000000;4.600000;5.000000;,
-4.000000;4.600000;-1.000000;,
-3.500000;4.600000;-1.000000;,
-3.500000;4.225000;-1.000000;,
-3.500000;4.600000;-1.000000;,
4.000000;4.600000;-1.000000;,
4.000000;-1.400000;-1.000000;,
4.000000;-1.400000;-1.000000;,
-3.500000;-1.400000;-1.000000;,
-4.000000;-1.400000;-1.000000;,
-4.000000;4.600000;-1.000000;,
-3.500000;-1.400000;-1.000000;,
-3.500000;4.225000;-1.000000;,
-4.000000;4.600000;5.000000;,
-4.000000;-1.400000;5.000000;,
-3.500000;-1.400000;5.000000;,
-4.000000;4.600000;5.000000;,
-3.500000;-1.400000;5.000000;,
-3.500000;4.225000;5.000000;,
-3.500000;4.600000;5.000000;,
-3.500000;4.225000;5.000000;,
-4.000000;4.600000;5.000000;,
-3.500000;4.600000;5.000000;,
-3.500000;4.600000;4.625000;,
-3.500000;4.600000;-1.000000;,
-4.000000;4.600000;-1.000000;,
-4.000000;4.600000;5.000000;,
-3.500000;4.600000;-1.000000;,
-3.500000;4.600000;4.625000;,
-4.000000;-1.400000;5.000000;,
-4.000000;-1.400000;-1.000000;,
-3.500000;-1.400000;-1.000000;,
-4.000000;-1.400000;5.000000;,
-3.500000;-1.400000;-1.000000;,
-3.500000;-1.400000;4.625000;,
-3.500000;-1.400000;5.000000;,
-3.500000;-1.400000;4.625000;,
4.000000;-1.400000;0.000000;,
4.000000;-1.400000;-1.000000;,
4.000000;4.600000;-1.000000;,
4.000000;-1.400000;0.000000;,
4.000000;4.600000;-1.000000;,
4.000000;3.600000;0.000000;,
4.000000;-1.400000;5.000000;,
4.000000;4.600000;0.000000;,
4.000000;3.600000;0.000000;,
4.000000;4.600000;0.000000;,
4.000000;4.600000;5.000000;,
4.000000;-1.400000;5.000000;,
4.000000;-1.400000;-1.000000;,
4.000000;-1.400000;0.000000;,
2.666667;-1.400000;0.000000;,
-3.500000;-1.400000;-1.000000;,
2.666666;-1.400000;0.000000;,
2.666666;-1.400000;0.000000;,
-3.500000;-1.400000;0.000000;,
4.000000;4.600000;-1.000000;,
-3.500000;4.600000;0.000000;,
4.000000;4.600000;-1.000000;,
2.666667;4.600000;0.000000;,
4.000000;4.600000;0.000000;,
2.666666;4.600000;0.000000;,
3.500000;-1.400000;5.000000;,
4.000000;-1.400000;5.000000;,
3.500000;-1.025000;5.000000;,
4.000000;-1.400000;5.000000;,
4.000000;4.600000;5.000000;,
3.500000;4.600000;5.000000;,
3.500000;-1.025000;5.000000;,
3.500000;4.600000;5.000000;,
4.000000;4.600000;5.000000;,
4.000000;4.600000;0.000000;,
3.500000;4.600000;0.000000;,
4.000000;-1.400000;0.000000;,
4.000000;-1.400000;5.000000;,
3.500000;-1.400000;5.000000;,
3.500000;-1.400000;5.000000;,
3.500000;-1.400000;0.000000;,
3.500000;-1.400000;5.000000;,
-3.500000;-1.400000;4.625000;,
3.500000;-1.400000;5.000000;,
2.666667;-1.400000;0.000000;,
-3.500000;-1.400000;5.000000;,
3.500000;-1.025000;5.000000;,
-3.500000;-1.400000;5.000000;,
3.500000;-1.025000;5.000000;,
2.666666;-0.400000;5.000000;,
-3.500000;-0.400000;5.000000;,
2.666666;-0.400000;5.000000;,
3.500000;-0.400000;5.000000;,
-2.333333;-0.400000;5.000000;,
3.500000;-0.400000;4.999999;,
3.500000;-0.400000;0.000000;,
3.500000;-0.400000;0.000000;,
-3.500000;-0.400000;0.000000;,
-3.500000;-0.400000;5.000000;,
-2.333333;-0.400000;4.999999;,
-3.500000;4.599999;5.000000;,
-3.500000;0.600000;4.999999;,
-3.500000;4.600000;1.000000;,
-3.500000;-0.400000;4.999999;,
-3.500000;-0.400000;0.000000;,
-3.500000;4.600000;0.000000;,
-3.500000;0.600000;5.000000;,
-3.500000;4.600000;0.000000;,
-3.500000;4.599999;1.000000;,
3.500000;4.599999;0.000000;,
3.500000;-0.400000;0.000000;,
3.500000;-0.400000;5.000000;,
3.500000;4.600000;1.000000;,
3.500000;-0.400000;5.000000;,
3.500000;0.600000;4.999999;,
3.500000;4.599999;1.000000;,
3.500000;0.600000;5.000000;,
3.500000;4.600000;4.999999;,
-3.500000;4.599999;0.000000;,
-3.500000;-0.400000;0.000000;,
3.500000;-0.400000;0.000000;,
-2.333333;4.600000;0.000000;,
3.500000;-0.400000;0.000000;,
-2.333333;4.599999;0.000000;,
3.500000;4.600000;0.000000;;
58;
3;0,1,2;,
3;2,3,0;,
3;4,5,6;,
3;7,8,9;,
3;5,10,6;,
3;11,12,13;,
3;14,4,15;,
3;9,11,15;,
3;16,17,18;,
3;19,20,21;,
3;22,16,23;,
3;24,25,26;,
3;27,28,29;,
3;30,24,31;,
3;32,33,34;,
3;35,36,37;,
3;38,32,39;,
3;40,41,42;,
3;43,44,45;,
3;46,40,45;,
3;42,47,48;,
3;49,50,51;,
3;47,46,48;,
3;52,53,54;,
3;55,52,56;,
3;34,57,58;,
3;56,37,58;,
3;59,27,60;,
3;61,60,62;,
3;63,59,64;,
3;65,66,67;,
3;68,69,70;,
3;66,70,71;,
3;72,73,74;,
3;72,63,75;,
3;76,77,78;,
3;53,79,80;,
3;81,38,82;,
3;83,39,84;,
3;78,54,80;,
3;85,65,86;,
3;87,88,89;,
3;18,89,90;,
3;91,67,92;,
3;93,94,95;,
3;96,97,98;,
3;99,95,98;,
3;100,101,102;,
3;103,104,105;,
3;106,103,107;,
3;108,106,105;,
3;109,110,111;,
3;112,109,113;,
3;114,112,111;,
3;115,116,117;,
3;118,119,120;,
3;121,118,122;,
3;123,120,124;;
MeshNormals {
125;
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;-1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;-1.000000;0.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
0.000000;1.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
-1.000000;0.000000;0.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;,
0.000000;0.000000;1.000000;;
58;
3;0,1,2;,
3;2,3,0;,
3;4,5,6;,
3;7,8,9;,
3;5,10,6;,
3;11,12,13;,
3;14,4,15;,
3;9,11,15;,
3;16,17,18;,
3;19,20,21;,
3;22,16,23;,
3;24,25,26;,
3;27,28,29;,
3;30,24,31;,
3;32,33,34;,
3;35,36,37;,
3;38,32,39;,
3;40,41,42;,
3;43,44,45;,
3;46,40,45;,
3;42,47,48;,
3;49,50,51;,
3;47,46,48;,
3;52,53,54;,
3;55,52,56;,
3;34,57,58;,
3;56,37,58;,
3;59,27,60;,
3;61,60,62;,
3;63,59,64;,
3;65,66,67;,
3;68,69,70;,
3;66,70,71;,
3;72,73,74;,
3;72,63,75;,
3;76,77,78;,
3;53,79,80;,
3;81,38,82;,
3;83,39,84;,
3;78,54,80;,
3;85,65,86;,
3;87,88,89;,
3;18,89,90;,
3;91,67,92;,
3;93,94,95;,
3;96,97,98;,
3;99,95,98;,
3;100,101,102;,
3;103,104,105;,
3;106,103,107;,
3;108,106,105;,
3;109,110,111;,
3;112,109,113;,
3;114,112,111;,
3;115,116,117;,
3;118,119,120;,
3;121,118,122;,
3;123,120,124;;
}
MeshTextureCoords {
125;
1.000000;0.000000;,
1.000000;1.000000;,
0.000000;1.000000;,
0.000000;0.000000;,
0.000000;0.000000;,
0.062500;0.000000;,
0.062500;0.062500;,
0.062500;0.000000;,
1.000000;0.000000;,
1.000000;1.000000;,
1.000000;1.000000;,
0.062500;1.000000;,
0.000000;1.000000;,
0.000000;0.000000;,
0.062500;1.000000;,
0.062500;0.062500;,
1.000000;0.000000;,
1.000000;1.000000;,
0.937500;1.000000;,
1.000000;0.000000;,
0.937500;1.000000;,
0.937500;0.062500;,
0.937500;0.000000;,
0.937500;0.062500;,
0.000000;0.000000;,
0.062500;0.000000;,
0.062500;0.062500;,
0.062500;1.000000;,
0.000000;1.000000;,
0.000000;0.000000;,
0.062500;1.000000;,
0.062500;0.062500;,
0.000000;1.000000;,
0.000000;0.000000;,
0.062500;0.000000;,
0.000000;1.000000;,
0.062500;0.000000;,
0.062500;0.937500;,
0.062500;1.000000;,
0.062500;0.937500;,
0.166667;1.000000;,
0.000000;1.000000;,
0.000000;0.000000;,
0.166667;1.000000;,
0.000000;0.000000;,
0.166667;0.166667;,
1.000000;1.000000;,
0.166667;0.000000;,
0.166667;0.166667;,
0.166667;0.000000;,
1.000000;0.000000;,
1.000000;1.000000;,
1.000000;0.000000;,
1.000000;0.166667;,
0.833333;0.166667;,
0.062500;0.000000;,
0.833333;0.166667;,
0.833333;0.166667;,
0.062500;0.166667;,
1.000000;1.000000;,
0.062500;0.833333;,
1.000000;1.000000;,
0.833333;0.833333;,
1.000000;0.833333;,
0.833333;0.833333;,
0.062500;1.000000;,
0.000000;1.000000;,
0.062500;0.937500;,
0.000000;1.000000;,
0.000000;0.000000;,
0.062500;0.000000;,
0.062500;0.937500;,
0.937500;0.000000;,
1.000000;0.000000;,
1.000000;0.833333;,
0.937500;0.833333;,
1.000000;0.166667;,
1.000000;1.000000;,
0.937500;1.000000;,
0.937500;1.000000;,
0.937500;0.166667;,
0.937500;1.000000;,
0.062500;0.937500;,
0.937500;1.000000;,
0.833333;0.166667;,
0.937500;1.000000;,
0.062500;0.937500;,
0.937500;1.000000;,
0.062500;0.937500;,
0.166667;0.833333;,
0.937500;0.833333;,
0.166667;0.833333;,
0.062500;0.833333;,
0.166667;0.833333;,
1.000000;0.833333;,
1.000000;0.000000;,
1.000000;0.000000;,
0.000000;0.000000;,
0.000000;0.833333;,
0.166667;0.833333;,
0.166667;0.166667;,
0.166667;0.833333;,
0.833333;0.166667;,
0.166667;1.000000;,
1.000000;1.000000;,
1.000000;0.166667;,
0.166667;0.833333;,
1.000000;0.166667;,
0.833333;0.166667;,
0.000000;0.166667;,
0.000000;1.000000;,
0.833333;1.000000;,
0.166667;0.166667;,
0.833333;1.000000;,
0.833333;0.833333;,
0.166667;0.166667;,
0.833333;0.833333;,
0.833333;0.166667;,
0.000000;0.166667;,
0.000000;1.000000;,
1.000000;1.000000;,
0.166667;0.166667;,
1.000000;1.000000;,
0.166667;0.166667;,
1.000000;0.166667;;
}
MeshMaterialList { // Cube material list
1;
6;
0,
0,
0,
0,
0,
0;;
{rojo}
}
}
} //fin frame cuchara
} //fin frame brazos
} //fin frame cuerpo
// *********************************************************************
AnimationSet Spin { // our animation will be called spin
Animation {
{cuerpo}
AnimationKey {
2; // Position keys
9; // 9 keys
10; 3; 10.000000, 0.000000, 0.000000;;,
20; 3; 10.000000, 0.000000, 10.000000;;,
30; 3; 0.000000, 0.000000, 10.000000;;,
40; 3; 0.500000, 0.000000, 0.000000;;,
50; 3; 10.000000, 0.000000, 0.000000;;, //movimiento
60; 3; 10.500000, 0.000000, 10.000000;;,
70; 3; 0.000000, 0.000000, 10.000000;;,
80; 3; 0.500000, 0.000000, 0.000000;;,
90; 3; 0.000000, 0.000000, 30.000000;;;
}
AnimationKey {
0;
4;
0;4;0.000000, 0.000000, 0.000000, 0.000000;;,
120;4;0.999900, 0.000000, 0.004300, 0.000000;;,
130;4;0.834200, 0.000000, 0.511400, 0.000000;;,
140;4;0.554200, 0.000000, 0.832300, 0.000000;;;
}
}
Animation {
{brazo}
AnimationKey {
0;
4;
1; 4;0.000000, 0.000000,0.000000, 0.000000;;,
30; 4;0.982800, 0.385100,0.000000, 0.000000;;,
90; 4;0.707000, 0.707000,0.000000, 0.000000;;, //rotacion del brazo
120; 4;0.982800, 0.385100,0.000000, 0.000000;;;
}
AnimationKey {
2; //ajustando el pivote de los brazos
1;
1; 3; 0.000000, 0.000000, 4.000000;;;
}
}
Animation {
{cuchara}
AnimationKey {
2; // Position keys
1; // 1 keys
1; 3; 0.000000, 0.500000, 18.000000;;; //centrando pivote de la cuchara
}
AnimationKey {
0;
4;
0; 4;0.000000, -0.000000,0.000000, 0.000000;;,
140; 4;0.982800, -0.385100,0.000000, 0.000000;;,
150; 4;0.707000, -0.707000,0.000000, 0.000000;;, //rotacion de la cuchara
160; 4;0.982800, -0.385100,0.000000, 0.000000;;;
}
}
}
//************************************************************************
Here is an example that export animacion to an .x file
The code is a mess upside down with with explanations in Spanish, but now I'm too lazy to translate it into English .
goto prog
crea:
Dim linea$(20000)
`Cargamos archivo .x . Lo leemos y lo volvemos a escribir en otro archivo con la parte que le asigna textura y animacion.
if file exist("dumyrot.x") then open to read 1,"dumyrot.x"
repeat
inc lin
read string 1,x$
linea$(lin)=x$
until file end(1)
close file 1
if file exist("dumyrot.x") then delete file "dumyrot.x"
open to write 1,"dumyrot.x"
write string 1,"xof 0303txt 0032"
write string 1," "
write string 1,"//Made by Chafari. october 2014 "
write string 1," Frame caja { // inicio de frame"
write string 1," FrameTransformMatrix {"
write string 1,"1.000000,0.000000,0.000000,0.000000,"
write string 1,"0.000000,1.000000,0.000000,0.000000,"
write string 1,"0.000000,0.000000,1.000000,0.000000,"
write string 1,"-24.836994,0.000000,0.000000,1.000000;;"
write string 1," }"
rem La estructura de la malla que exporta Darkbasic, tiene muchos templates que no nos interesan, por eso comenzamos en la linea 44.
for t= 1 to lin-1 ` leemos solo hasta la penultima linea, para incrustar antes del ultimo bracket "}"
if t>43 then write string 1,linea$(t)
next t
`------------------- PARTE DEL ARCHIVO QUE HA DE SER INCLUIDO EN EL .X ---------------------
write string 1," MeshMaterialList { // Cube material list"
write string 1," 1;"
write string 1," 1;"
write string 1," 0;;"
write string 1," Material Material {"
write string 1," 0.640000; 0.640000; 0.640000; 1.000000;;"
write string 1," 96.078431;"
write string 1," 0.500000; 0.500000; 0.500000;;"
write string 1," 0.000000; 0.000000; 0.000000;;"
write string 1," TextureFilename {"test.jpg";}"
write string 1," }"
write string 1," } // End of Cube material list"
`-------------------------------------------------------------------------------------------
write string 1,"} // ---------aqui termina el frame"
write string 1,"} //--------aqui termina la mesh"
largo=150
write string 1,"AnimationSet {"
write string 1," Animation {"
write string 1," {caja}"
write string 1," AnimationKey {"
write string 1," 2;"
write string 1,str$ (largo/10)+";" +" // Cantidad de fotogramas"
rem ------------------------------- AQUI VA LA PARTE QUE ANIMA AL OBJETO --------------------------------------
for i= 0 to largo step 10
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
if i<30 then inc x#,10
if i>30 and i<80 then inc y#,10
if i>80 then inc z#,10
position object 1,x#,y#,z#
rem tenemos que aƱadirle decimales a los valores, de lo contrario no funcionara.
if i<largo-1 then write string 1,str$(i)+" ;"+" 3"+" ; "+str$(x#)+".0000"+" ,"+str$(y#)+".0000"+" ,"+str$(z#)+".0000"+" ;;,"
if i=largo/10 then write string 1,str$(i)+" ;"+" 3"+" ;"+str$(x#)+".0000"+" ,"+str$(y#)+".0000"+" ,"+str$(z#)+".0000"+" ;;;" + " // final cerrando con tres ;"
rem sleep 2
next i
write string 1," }"
`rotacion
write string 1," AnimationKey {"
write string 1," 0;"
write string 1,str$ (largo/10)+";" +" // Cantidad de fotogramas"
for i= 1 to largo step 10
inc salto
if salto<largo/10 then fin$=";;," else fin$=";;;"
W# = cos (1*object angle y(1))
w2# = 1 * sin(object angle y(1))
write string 1,str$(i)+ " ;"+"4 "+"; "+str$(w#)+" ,"+" 0.000 "+","+str$(w2#)+" , "+" 0.000 "+ fin$ rem rotacion "y"
yrotate object 1,i rem tenemos que dividir por dos para que salga la cuenta justa, si no ...saldra el doble.
next i rem o poner la mitad de fotogramas que lleva el giro completo.
rem -------------------------------------------------------------------------------------------------------------
write string 1," }"
write string 1," }"
write string 1," }"
close file 1
end
prog:
autocam off
sync on
load image "test.bmp",1
make object box 1,15,6,15
make object box 2,10,8,10:yrotate object 2,45
perform csg difference 1,2:delete object 2
texture object 1,1
make mesh from object 1,1
position camera -20,20,-20
point camera 0,0,0
do
set cursor 0,0
print "PULSA CONTROL PARA SALVAR "
control camera using arrowkeys 0,0.1,0.1
a#=wrapvalue(a#+mousemovex()/2)
cam#=wrapvalue(cam#+mousemovey()/2)
rotate camera cam#,a#,0
if leftkey() then move camera left 0.1
if rightkey() then move camera right 0.1
if controlkey() then save mesh "dumyrot.x",1 :goto crea
sync
loop
I'm not a grumpy grandpa
