Advertisement
Guest User

Untitled

a guest
Nov 11th, 2012
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.32 KB | None | 0 0
  1. The following document is written by a 'Mr Potato Head', I claim no ownership. - Tom
  2.  
  3.  
  4.  
  5.  
  6. File format specification for old format (pre 474) - still used
  7.  
  8. -----------------------------------------------------------------------
  9.  
  10. VERTEX_DIRECTION_Chunk : Bytes; Number of verices in length.
  11.  
  12. This chunk contains Vertex direction data, the data contained in each byte is a set Bit of Flags. Only the first 3 bits are used.
  13. Each Flag determines whether an addition is made to the x,y, or z axis when calculating the next vertex point.
  14. Example: The start point is always 0,0,0, so if the first vertex is at point 10,10,10 then the All the Flags will be set and the byte value = 7.
  15.  
  16. ALWAYS Required.
  17.  
  18. -----------------------------------------------------------------------
  19.  
  20. TRIANGLE_TYPE_Chunk : Bytes; Number of triangles in length.
  21.  
  22. This chunk contains Triangle type data, the data is an integer Flag, of value 1-4, used to control how Triangles vertex numbers are loaded.
  23. Type_1 = New Triangle. Load v1, v2 and v3.
  24. Type_2 = v2=v3, load v3, v1=v1
  25. Type_3 = v1=v3, load v3, v2=v2
  26. Type_4 = v1=v2, v2=v1, load v3
  27.  
  28. NOTE: Type_4 is rare, Type_1 can be used to replace type 4 with only a small loss in compression.
  29.  
  30. Type_4 can only exist in 2 instances,
  31. a) when a new triangle is loaded and the next triangle type is of type_4.
  32. b) when the normal of the next triangle is inverted.
  33. Otherwise the vast majority of triangles will be of type_2 and type_3
  34.  
  35. ALWAYS Required.
  36.  
  37. -----------------------------------------------------------------------
  38.  
  39. TRIANGLE_PRIORITY_Chunk : Bytes; Number of triangles in length.
  40.  
  41. This chunk contains integer values used to calculate which triangles are drawn first, The higher the value the later they are drawn.
  42.  
  43. Used only when triangle priority is required.
  44.  
  45. -----------------------------------------------------------------------
  46.  
  47. TRIANGLE_SKIN_Chunk : Bytes; Number of triangles in length.
  48.  
  49. This chunk contains integer values that are applied to triangles in order to display animation data. The value represents the group the triangle belongs to.
  50.  
  51. Used only when animation is required.
  52.  
  53. -----------------------------------------------------------------------
  54.  
  55. TEXTURE_POINTER_Chunk : Bytes; Number of triangles in length.
  56.  
  57. This chunk contains integer values that point to which texture mapping triangle is used to texture the model triangle.
  58. A Value of 0 represents NO texture mapping.
  59.  
  60. Used only when texture mapping is required.
  61.  
  62. -----------------------------------------------------------------------
  63.  
  64. VERTEX_SKIN : Bytes; Number of vertices in length.
  65.  
  66. This chumck contains integer values that describe which vertex skin group a vertex belongs to.
  67.  
  68. Used only when animation is required.
  69.  
  70. -----------------------------------------------------------------------
  71.  
  72. TRIANGLE_ALPHA_Chunk : Bytes; Number of Triangles in length
  73.  
  74. This chunk conatins integer values that are used to determine how transparent the model triangle is.
  75.  
  76. Used only when transparency is required.
  77.  
  78. -----------------------------------------------------------------------
  79. TRIANGLE_DATA_CHUNK : Bytes and/or Words; Length is Triangle_Data Length.
  80.  
  81. This chunk contains signed bytes and words that are used to calculate which vertices are used to describe the triangle. The value has an offset of 64 to determine wether the value is stored as a byte or a word. A base value of 0 is used. The values are stored as offsets to the next vertex.
  82. Example: the model starts with a triangle that uses vertices 2,3,4.
  83. The offsets from the base value will be +2,+1,+1
  84. This will be stored as 66,65,65 (or in Hex 42,41,41)
  85.  
  86. ALWAYS Required.
  87.  
  88. -----------------------------------------------------------------------
  89.  
  90. COLOR_DATA_Chunk : Words; Number of triangles in length.
  91.  
  92. This chunk contains integer values that describe which color, from the 65,536 color lookuptable, is used for the model triangle.
  93.  
  94. ALWAYS Required.
  95.  
  96. -----------------------------------------------------------------------
  97.  
  98. UV_MAP_TRIANGLES_Chunk : Word,Word,Word; Number of texture triangles in length.
  99.  
  100. This chunk contains the positions of the UV(0,0), UV(0,1) and UV(1,0) information required to calculate the UV coordinates for textured model triangles. The 'texture triangle' represents the flat mapped texture which the model triangles are projected onto to produce the UV coordinates.
  101.  
  102. Used only when texture mapping is required.
  103.  
  104. -----------------------------------------------------------------------
  105.  
  106. X_DATA_Chunk : Byte and/or Word; XdataLength in length
  107.  
  108. This chunk contains signed bytes or words, used to calculate the X value for the vertex position. A base offset of 0 is used and the number stored is the offset from one vertex position to the next.
  109. An offset of 64 is also applied to the data to determine if the value is stored as a byte or a word.
  110.  
  111. ALWAYS Required.
  112.  
  113. -----------------------------------------------------------------------
  114.  
  115. Y_DATA_Chunk : Byte and/or Word; YdataLength in length
  116.  
  117. This chunk contains signed bytes or words, used to calculate the Y value for the vertex position. A base offset of 0 is used and the number stored is the offset from one vertex position to the next.
  118. An offset of 64 is also applied to the data to determine if the value is stored as a byte or a word.
  119.  
  120. ALWAYS Required.
  121.  
  122. -----------------------------------------------------------------------
  123.  
  124. Z_DATA_Chunk : Byte and/or Word; ZdataLength in length
  125.  
  126. This chunk contains signed bytes or words, used to calculate the Z value for the vertex position. A base offset of 0 is used and the number stored is the offset from one vertex position to the next.
  127. An offset of 64 is also applied to the data to determine if the value is stored as a byte or a word.
  128.  
  129. ALWAYS Required.
  130.  
  131. -----------------------------------------------------------------------
  132.  
  133. FILE_FOOTER_Chunk : Bytes and Words; Length is 18 bytes.
  134.  
  135. This chunk contains the data lengths and data flags used to store the file.
  136.  
  137. Word - Number of vertices
  138. Word - Number of triangles
  139. Byte - Number of Texture triangles
  140. Byte - Use textures FLAG
  141. Byte - Use Triangle Priorities FLAG (FF for True)
  142. Byte - Use Transparency FLAG
  143. Byte - Use Triangle Skinning FLAG
  144. Byte - Use Vertex Skinning FLAG
  145. Word - X_DATA length
  146. Word - Y_DATA length
  147. Word - Z_DATA length
  148. Word - Triangle_Data length
  149.  
  150. ALWAYS Required.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement