User:Ukurere

From QhimmWiki
Revision as of 06:09, 8 April 2009 by Qhimm>Ukurere
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

It's pronounced UU-KUU-REH-REH. Or maybe UUUU-KUU-REH-REH. Article preview! Yea, the table of contents is too long.

File Layout

  • 0x0002 File Start
    • 0x0003 Sub-File
      • 0x8015 Scale and Bias
      • 0x8014
      • 0x0004 Bone Info
        • 0x8014
        • 0x8041 Reference to Parent Bone/Object?
        • 0x8044 Big list of Bones refs.
        • 0x8045 List of 4x4 Matrices (goes w/ 0x8044 list)
        • 0x8048
        • 0x804B
        • 0x804C
        • 0x804E Ref. to a Model Surface
      • 0x0005 Model Surface
        • 0x8014
      • 0x0006 Mesh
        • 0x8061 Ref. to a Material
        • 0x8062 List of Bones from the 0x8044 list (for weights!)
        • 0x8066 Ref. to a Vertex Array, primitive type, etc
      • 0x0007 Vertex Array
        • Vertex Array data
      • 0x0008 Material
        • 0x8081
        • 0x8082
        • 0x8083 Specular, I guess
        • 0x8085
        • 0x8086 Environment mapping (shiny reflection!)
        • 0x0009 Texture Layer
          • 0x8091 Ref. to a Texture
          • 0x8094 (somehow related to 0x8081?)
      • 0x000A Texture
        • 0x8012 Texture Filename
        • 0x8013 Texture File Data
      • 0x000B Animation
        • 0x80B1 (start & end frames?)
        • 0x80B2
        • 0x80B3 Bone ref., Anim Node type, & Anim Node ref.
        • 0x000C Animation Node
          • Animation Node data

Chunk Detail

Note: all chunks are padded to 4 bytes.

0x8012 Texture Filename

  • A null-terminated string containing a filename.

This chunk is typically (but not always) followed by 0x8013 Texture File Data. Also, the filename can be misleading (e.g. "texture.bmp" might be followed by a .tga file).

0x8013 Texture File Data

  • uint32 size of texture file
  • data of the texture file.

The texture file types encountered so far are GIM, TGA, and BMP.

0x8014

unknown, contains 6 float32s. So far this is the only chunk that occurs under different section types: Sub-File (0x03), Bone Info (0x04), and Mesh Surface (0x05).

0x8015 Scale and Bias

Once all the 3D data is obtained from the current Sub-File, it is scaled and biased depending on the contents of this chunk. This chunk occurs in two forms, determined by the value of the first uint32. If needed, the chunk will appear twice, once with each form.

UV coordinates form:

  • uint32 bias type = 3
  • float32 U-Bias
  • float32 V-Bias
  • float32 U-Scale
  • float32 V-Scale

All UV coordinates in all arrays of the current Sub-File are then adjusted like so (also repeat for V):

U = (U * U-Scale * 2.0) + U-Bias

Vertex positions form:

  • uint32 bias type = 384
  • float32 X-Bias
  • float32 Y-Bias
  • float32 Z-Bias
  • float32 X-Scale
  • float32 Y-Scale
  • float32 Z-Scale

All vertex positions in all arrays of the current Sub-File are then adjusted like so (also repeat for Y and Z):

X = (X * X-Scale * 2.0 / 65535.0) + X-Bias

0x8041 Reference to Parent Bone

  • dword [00 04 10 XX] where XX is the index of the parent bone (as listed in the current Sub-File, starting at 0).

0x8044 list of bones that have vertices weighed to them

The list might or might not include the current bone.

  • uint32 number of bones, numBones
  • then a list of numBones bone references. Each bone reference is dword [00 04 10 XX] where XX is the index of the bone (as listed in the current Sub-File, starting at 0).

0x8045 base pose matrices for weighted bones

  • uint32 number of matrices (should match the number of bones in 0x8044)

0x8048 bone translation

  • float32 X
  • float32 Y
  • float32 Z

0x804B bone quaternion

  • float32 a
  • float32 b
  • float32 c
  • float32 d

0x804C

unknown, contains 3 float32s.

0x804E Reference to Model Surface

  • dword [00 05 10 XX] where XX is the index of the Model Surface (as listed in the current Sub-File, starting at 0).

0x8061 Reference to Material

  • dword [00 06 20 XX] where XX is the index of the Material (as listed in the current Sub-File, starting at 0).

0x8062 weighed bones

  • uint32 number of weighted bones (always between 1 and 8)

uint32 numWeightedBones (always between 1 and 8), followed by that many uint32s. Each uint32 refers to a bone from the bone reference list in 0x8044.

0x8066 vertex kick, mesh index data, whatever to call it

  • Reference to Vertex Array: dword [00 07 10 XX] where XX is the index of the Vertex Array (as listed in the current Model Surface, starting at 0).

0x8081

0x8082

0x8083

0x8085

0x8086 Environment Mapping

  • float32 unknown

0x8091 Reference to Texture

0x8094

somehow related to 0x8081?

0x80B1 animation frames

0x80B2

0x80B3 animation-bone link