Texel |
|
.an8 file format from Anim8or
Object Mode Meshes only Note: This article has been written a long time ago, when the .an8 file format specification were not avaialble. This specs are now avaialable on the officiel Anim8or web site but incomplet. Maybe, thi article will allow you to understand some bases of how the file format works. You can also try LibAn8, my open source Anim8or file loader.. Anim8or is an easy to use 3D modelling program. Try it before going head. (Official web site of Anim8or) These specs are not complet. But they could allow you to save sevral hours of your time. I advice you to do some test in order to see how the .an8 file is created. It's easier to load or write .an8 files with meshes only than cubes or shperes. Use "Build -> convert to mesh" in Anim8or to convert all of your primitives into meshes. An Anim8or file could have several objects. Each object could have several meshes. Here is a file which represent a textured cube: Légende: Always present. Present only if a texture is used in the object. Present only if a material is used in the object (a material can be color or a texture with diffuse, ambient... properties). Always present if a material is used. Present only if the default parameter has been modified. Present in some conditions
Chunk: header
version: Number of version of Anim8or which has been used to create the file. build: Date of creation. Chunk: environment grid: ? framerate: Number of frame per second. Chunk: texture The name of the texture follows this chunk. The "file" chunk hold the complete path of the texture file. It can be: file { "D:\\MyProjects\\divers\\anim8or\\an8demo_02-09-06\\Debug\\Data\\sand.bmp" } or file { "D:\\MyProjects\\divers\\anim8or\\an8demo_02-09-06\\Debug\\Data\\sand.bmp" } Chunk: object The name of the object follows the name of this chunk. Just one object can be exported in "object" mode, several in the scene mode. One object can hold one or several groups of meshes. The chunk name of a group is group.
The name of the material follows the name of this chunk. This chunk is not writed if you do not create materials in Anim8or. The surface chunk is alwas present and seems to be the one in this chunk.
Present if the "=" button has been selected in the material dialogue box of Anim8or.
Always present if a material is created. And always in the same order: (ambiant,diffuse,speculare). Chunk: "rgb" (color: red,blue, green) and "factor" always present. Chunk: texturename,textureparams present only if the material is a texture.
The name of the texture.
Hold the blending mode and alpha mode.
Always present if the material is present. Correspond to the "Rough" parameter of Anim8or.
Present if the default parameter has been changed in Anim8or. Chunk: "rgb" (color r,g,b) and "factor" always present. Chunk: texturename,textureparams present only if the material has a testure.
Present if the default parameter has been changed in Anim8or. Correspond to the "Trans" and "brillance" parameter of Anim8or.
Present only if a texture is set for transparency or bumpmapping. phongsize for phongsize. The "kind" chunk indicate if the material use transparency or bumpmapping (One can be persent without the other). Chunk: Mesh Hold a mesh. Several meshes can be in an object. Note: A "group" chunk can have several meshes. This chunk has this chunk: "name", "base" followed by the "mesh" chunks. Chunk: name Always present Name of a mesh. Chunk: base Use when the mesh has been moved (location or/and orientation) Chunk: origin: Local origin of the mesh. Chunk: orientation Quaternion for the orientation of the object (x, y, z, w) (present only if the mesh has been rotated in Anim8or). Chunk: material Default material of the mesh ? Chunk: smoothangle A vertex can be used in two polygons (A and B). By default, this vertex use the face normal of A for polygon A, and the face normal of B for polygon B. If the angle betweeen the two face noraml of this vertex is smaller than smoothangle, the two face normal are added (and normalized). By this way, the light smooth the object. Commentary: /* n points, m faces, k uvCoords */ Number n of points. Number m of faces. Number k of texture coordinates. Chunk: materiallist List of materials used in the mesh. Listed by name. One"materialname" per material. If the mesh do not use any material. A default name is present: (" -- default --"). The materials are hold in a special order which will be used in the face chunk (go to the face description). Chunk: points List of points with theirs coordinates (x,y,z). The number of points per line is not fixed (it could be 1,2,3...). Note: One point can be use by several faces (Anim8or use vertex indices). Chunk: texcoords List of texture coordinates. Note: Anim8or use texture coordinate indices. Chunk: normals Present only if the "Debug->Output Normals" has been checked in the Anim8or menu. List of normal coordinates. Chunk: faces One line per face. 4 numbres are writted before the list of indices of the face. These 4 numbers corespond to: _ 1st: Nomber of vertices for each faces (triangle, quad,...). _ 2nd: Mask. Binary number converted to decimal. Computed like this: It has 3 digits. the first bit (left) is set to 1 by Anim8or if backfaces must be displayed or 0 if not (default value). the 2nd bit is set to 1 if each vertices have there normal or 0 if not (default value). the 3rd bit is set to 1 if uv coordinate are used ou 0 if not (default value). Then, this binary number is converted to decimal. Some examples: 0: No uv coords 1: Show backfaces. 2: Vertex normal are exported. 4: UV coords are used by the face. 6: Normals has been exported with "Debug->Output normal" and UV coords are used. _ 3ième: Number of the material used by the face. This number correspond to the order the materials are listed in the "materiallist" chunk of the current mesh. _ 4ième: If >=0, Index of the normal of the face itself (not its vertices) 3 type of indices can be hold: Vertex indices, UVcoord indices, Normal indices. Inside "(...)", for each vertex 1,2 or 3 indices can be hold inside "(...)": _ Index of a vertex (always present and in 1st position). _ Index of an UVcoord (present if the mask allow it). _ Index of a normal (present if the mask allow it). Indices are listed following the opposite of the direction of the hand of clock path. Anim8or computes noramls when it loads an .an8 file. Warning: The description of a face is not always writted in one line (when the number of vertex is great). But indices of each vertex (2 or 3 indices for vertex, UVcoord and normal) are always in the same line. Example:
|