Material TuxMaterial { 1.000000;1.000000;1.000000;1.000000;; // R = 1.0, G = 0.0, B = 0.0 0.000000; 0.000000;0.000000;0.000000;; 0.000000;0.000000;0.000000;; TextureFilename { "cube.jpg"; } } Material GreenMaterial { 0.000000;1.000000;0.000000;1.000000;; // R = 0.0, G = 1.0, B = 0.0 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 CubeMesh { 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;, // etc... 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;; 6; // 12 faces 4;0,1,2,3;, // face 0 has 3 vertices 4;0,4,5,1;, 4;1,5,6,2;, 4;2,6,7,3;, 4;3,7,4,0;, 4;4,7,6,5;; // All required data has been defined. Now define optional data // using the hierarchical nature of the file format. MeshMaterialList { 2; // Number of materials used 6; // A material for each face 1, // face 0 uses the first 0, // material 1, 0, 1, 1;; {TuxMaterial} // 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;; 6; // For the 12 faces, 4;0,1,2,3;, // face 0 has 3 vertices 4;0,4,5,1;, 4;1,5,6,2;, 4;2,6,7,3;, 4;3,7,4,0;, 4;4,7,6,5;; } MeshTextureCoords { 8; 0.000000;0.000000; 1.000000;0.000000; 0.000000;0.000000; 1.000000;0.000000; 0.000000;1.000000; 1.000000;1.000000; 0.000000;1.000000; 1.000000;1.000000;; } }