[Release] Full O3D File Format

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    • [Release] Full O3D File Format

      Hallo Leute,
      Ich hab mir mal die Zeit genommen das komplette O3D Datei Format aufzuschreiben.
      Vielleicht kann der eine oder andere was damit anfangen.

      PHP-Quellcode

      1. O3D FILE FORMAT
      2. 1 byte - Name Length
      3. 4 bytes - Name
      4. 4 bytes - Version
      5. if Version < 20
      6. Error - Return FAIL
      7. 4 bytes - ID
      8. 12 bytes - D3DVECTOR3 Force1
      9. 12 bytes - D3DVECTOR3 Force2
      10. if Version >21
      11. 12 bytes - D3DVECTOR3 Force3
      12. 12 bytes - D3DVECTOR3 Force4
      13. 4 bytes - FLOAT ScrlU
      14. 4 bytes - FLOAT ScrlV
      15. 16 bytes - NULL, skip that ones
      16. 12 bytes - D3DVECTOR3 BoundingBox Minimum
      17. 12 bytes - D3DVECTOR3 BoundingBox Minimum
      18. 4 bytes - FLOAT PerSlerp
      19. 4 bytes - Frame Count
      20. 4 bytes - Event Count
      21. if Event Count > 0
      22. start loop1 - Repeat x times, where x is equal to Event Count
      23. 12 bytes - D3DVECTOR3 Event
      24. end loop1
      25. 4 bytes - Temp
      26. if Temp != 0 - Now the Geometry Part
      27. 12 bytes - D3DVECTOR3 BoundingBox Minimum
      28. 12 bytes - D3DVECTOR3 BoundingBox Minimum
      29. 4 bytes - INT used as BOOLEAN Opacity
      30. 4 bytes - INT used as BOOLEAN Bump
      31. 4 bytes - INT used as BOOLEAN Rigid Body
      32. 28 bytes - NULL, skip that ones
      33. 4 bytes - Number of Vertices
      34. 4 bytes - Number of Vertex Buffers
      35. 4 bytes - Number of Faces
      36. 4 bytes - Number of Index Buffers
      37. start loop2 - Repeat x times, where x is the Number of Vertices
      38. 12 bytes - D3DVECTOR3 Vertex List
      39. end loop2
      40. if MeshType == 1 -- if the Object is skinned
      41. start loop3 - Repeat x times, where x is the Number of Vertex Buffers
      42. //44 bytes - SKINVERTEX it is built as this:
      43. 12 Bytes - D3DVECTOR3 3D Position of Vertex
      44. 4 Bytes - FLOAT Vertex Weight 1
      45. 4 Bytes - FLOAT Vertex Weight 2
      46. 4 Bytes - DWORD Material ID
      47. 12 Bytes - D3DVECTOR3 Surface Normal for the Vertex
      48. 4 Bytes - FLOAT Texture Coordinate u
      49. 4 Bytes - FLOAT Texture Coordinate v
      50. end loop3
      51. else-- if the Object is not skinned
      52. start loop4 - Repeat x times, where x is the Number of Vertex Buffers
      53. //32 bytes - NORMALVERTEX it is built as this:
      54. 12 Bytes - D3DVECTOR3 3D Position of Vertex
      55. 12 Bytes - D3DVECTOR3 Surface Normal for the Vertex
      56. 4 Bytes - FLOAT Texture Coordinate u
      57. 4 Bytes - FLOAT Texture Coordinate v
      58. end loop4
      59. start loop5 - Repeat x times, where x is the Number of Index Buffers
      60. 2 bytes - WORD
      61. end loop 5
      62. start loop5 - Repeat x times, where x is the Number of Vertex Buffers
      63. 2 bytes - WORD
      64. end loop 5
      65. 4 bytes - Temp
      66. if Temp != 0 -- Physique
      67. start loop6 - Repeat x times, where x is the Number of Vertices
      68. 4 bytes - Physique Vertex
      69. end loop6
      70. 4 bytes - IsMaterial
      71. if IsMaterial != 0 -- IsMaterial = True
      72. 4 bytes - MaxMaterial
      73. start loop7 - Repeat x times, where x is the Number of Materials
      74. //68 bytes - D3D9MATERIAL it is built like this:
      75. 16 bytes - D3DCOLORVALUE Diffuse Color with r(ed), g(reen), b(blue), a(lpha)
      76. 16 bytes - D3DCOLORVALUE Ambient Color with r(ed), g(reen), b(blue), a(lpha)
      77. 16 bytes - D3DCOLORVALUE Specular Color with r(ed), g(reen), b(blue), a(lpha)
      78. 16 bytes - D3DCOLORVALUE Emissive Color with r(ed), g(reen), b(blue), a(lpha)
      79. 4 bytes - FLOAT Power of the Color
      80. 4 bytes - Bitmap Filename Length
      81. 4 bytes - Bitmap Filename
      82. end loop7
      83. 4 bytes - Vertex Buffer Material Block
      84. if Vertex Buffer Material Block > 31
      85. ERROR - Return FAIL
      86. if Vertex Buffer Material Block > 0
      87. start loop8 - Repeat x times, where x is the Number of Material Blocks
      88. //136 bytes - MATERiAL_BLOCK it is built like this:
      89. 4 bytes - Start Vertex
      90. 4 bytes - Primitive Count
      91. 4 bytes - Texture ID
      92. 4 bytes - DWORD Effect
      93. 4 bytes - Amount
      94. 4 bytes - Number of Bones
      95. 28*4 bytes - INT ARRAY Bone
      96. end loop8
      97. 4 bytes - INT used as BOOLEAN LOD
      98. 4 bytes - Bone Count
      99. if Bone Count > 0
      100. start loop9 - Repeat x times, where x is equal to Bone Count
      101. 64 bytes - D3DXMATRIX LocalTM (16 float values in a 4x4 Matrix)
      102. end loop9
      103. start loop10 - Repeat x times, where x is equal to Bone Count
      104. 64 bytes - D3DXMATRIX InversedTM (16 float values in a 4x4 Matrix)
      105. end loop10
      106. 4 bytes - INT used as BOOLEAN SendVS
      107. 4 bytes - PoolSize
      108. start loop11 - Repeat x times, where x is the amount of LoDPresent
      109. 4 bytes - Object Count
      110. start loop12 - Repeat x times, where x is equal to Object Count
      111. 4 bytes - Mesh Type
      112. 4 bytes - Number of Bones
      113. if Number of Bones > 0
      114. start loop13 - Repeat x times, where x is equal to Number of Bones
      115. 4x28 Bytes - INT ARRAY Bone
      116. end loop13
      117. 4 bytes - Object ID
      118. 4 bytes - Parent Index
      119. if Parent Index != -1
      120. 4 Bytes - Parent Type
      121. 64 bytes - D3DXMATRIX LocalTM (16 float values in a 4x4 Matrix)
      122. end loop12
      123. end loop11
      124. 12 bytes - D3DVECTOR3 BoundingBox Minimum
      125. 12 bytes - D3DVECTOR3 BoundingBox Minimum
      126. 4 bytes - INT used as BOOLEAN Opacity
      127. 4 bytes - INT used as BOOLEAN Bump
      128. 4 bytes - INT used as BOOLEAN Rigid Body
      129. 28 bytes - NULL, skip that ones
      130. 4 bytes - Number of Vertices
      131. 4 bytes - Number of Vertex Buffers
      132. 4 bytes - Number of Faces
      133. 4 bytes - Number of Index Buffers
      134. start loop14 - Repeat x times, where x is the Number of Vertices
      135. 12 bytes - D3DVECTOR3 Vertex List
      136. end loop14
      137. if MeshType == 1 -- if the Object is skinned
      138. start loop15 - Repeat x times, where x is the Number of Vertex Buffers
      139. //44 bytes - SKINVERTEX it is built as this:
      140. 12 Bytes - D3DVECTOR3 3D Position of Vertex
      141. 4 Bytes - FLOAT Vertex Weight 1
      142. 4 Bytes - FLOAT Vertex Weight 2
      143. 4 Bytes - DWORD Material ID
      144. 12 Bytes - D3DVECTOR3 Surface Normal for the Vertex
      145. 4 Bytes - FLOAT Texture Coordinate u
      146. 4 Bytes - FLOAT Texture Coordinate v
      147. end loop15
      148. else-- if the Object is not skinned
      149. start loop16 - Repeat x times, where x is the Number of Vertex Buffers
      150. //32 bytes - NORMALVERTEX it is built as this:
      151. 12 Bytes - D3DVECTOR3 3D Position of Vertex
      152. 12 Bytes - D3DVECTOR3 Surface Normal for the Vertex
      153. 4 Bytes - FLOAT Texture Coordinate u
      154. 4 Bytes - FLOAT Texture Coordinate v
      155. end loop16
      156. start loop17 - Repeat x times, where x is the Number of Index Buffers
      157. 2 bytes - WORD
      158. end loop17
      159. start loop18 - Repeat x times, where x is the Number of Vertex Buffers
      160. 2 bytes - WORD
      161. end loop18
      162. 4 bytes - Temp
      163. if Temp != 0 -- Physique
      164. start loop19 - Repeat x times, where x is the Number of Vertices
      165. 4 bytes - Physique Vertex
      166. end loop19
      167. 4 bytes - IsMaterial
      168. if IsMaterial != 0 -- IsMaterial = True
      169. 4 bytes - MaxMaterial
      170. start loop20 - Repeat x times, where x is the Number of Materials
      171. //68 bytes - D3D9MATERIAL it is built like this:
      172. 16 bytes - D3DCOLORVALUE Diffuse Color with r(ed), g(reen), b(blue), a(lpha)
      173. 16 bytes - D3DCOLORVALUE Ambient Color with r(ed), g(reen), b(blue), a(lpha)
      174. 16 bytes - D3DCOLORVALUE Specular Color with r(ed), g(reen), b(blue), a(lpha)
      175. 16 bytes - D3DCOLORVALUE Emissive Color with r(ed), g(reen), b(blue), a(lpha)
      176. 4 bytes - FLOAT Power of the Color
      177. 4 bytes - Bitmap Filename Length
      178. 4 bytes - Bitmap Filename
      179. end loop20
      180. 4 bytes - Vertex Buffer Material Block
      181. if Vertex Buffer Material Block > 31
      182. ERROR - Return FAIL
      183. if Vertex Buffer Material Block > 0
      184. start loop8 - Repeat x times, where x is the Number of Material Blocks
      185. //136 bytes - MATERiAL_BLOCK it is built like this:
      186. 4 bytes - Start Vertex
      187. 4 bytes - Primitive Count
      188. 4 bytes - Texture ID
      189. 4 bytes - DWORD Effect
      190. 4 bytes - Amount
      191. 4 bytes - Number of Bones
      192. 28*4 bytes - INT ARRAY Bone
      193. end loop8
      194. if Version > 20
      195. 4 bytes - Attribute
      196. if Attribute == Frame Count
      197. start loop21 - Repeat x times, while x is equal to Frame Count
      198. //12 bytes - MOTION_ATTR it is build like this:
      199. 4 bytes - DWORD Attribue
      200. 4 bytes - Sound ID
      201. 4 bytes - FLOAT Frame
      202. end loop21
      Alles anzeigen
    • Werbung zur Unterstützung des Forums ( Bitte AddBlocker deaktivieren )