Difference between revisions of "FF9/File/0x02"

From Final Fantasy Inside
< FF9
Jump to navigation Jump to search
my_wiki>Zidane
 
my_wiki>Zidane
Line 9: Line 9:
  
 
4: Objects count.
 
4: Objects count.
 
 
  
  
Line 65: Line 63:
 
| style="background:rgb(255,255,255);" | Pointer to the end of object, counting from first byte of model
 
| style="background:rgb(255,255,255);" | Pointer to the end of object, counting from first byte of model
 
| style="background:rgb(255,255,255);" | 4
 
| style="background:rgb(255,255,255);" | 4
 +
|}
 +
 +
 +
'''Vertex table'''
 +
 +
In this table there is information about count of vertex connected to every bone. Every record is 2-byte. If count of bones is odd, there is 2-byte padding.
 +
 +
 +
'''Vertices'''
 +
 +
Here there is information about all vertices of selected object. Vertex record is 3-byte and is of next structure:
 +
 +
{| border="0" cellspacing="1" cellpadding="3" style="background: rgb(0,0,0)" align="center"
 +
! style="background:rgb(204,204,204);" align="center" | Data
 +
! style="background:rgb(204,204,204);" align="center" | Length (bytes)
 +
|-
 +
| style="background:rgb(255,255,255);" | X
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | Y
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | Z
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | Bone number
 +
| style="background:rgb(255,255,255);" | 1
 +
|-
 +
| style="background:rgb(255,255,255);" | UnkNown
 +
| style="background:rgb(255,255,255);" | 1
 +
|}
 +
 +
Point coordinates are in local coordinate system of given bones. Vertex count begins from 0. For every model object it counts from 0.
 +
 +
 +
'''Quad and Triangle block'''
 +
 +
First there is block of quads, next there is triangles. Count of quads and triangles is in object table.
 +
 +
    '''''Quad record:'''''
 +
{| border="0" cellspacing="1" cellpadding="3" style="background: rgb(0,0,0)" align="center"
 +
! style="background:rgb(204,204,204);" align="center" | Data
 +
! style="background:rgb(204,204,204);" align="center" | Length (bytes)
 +
|-
 +
| style="background:rgb(255,255,255);" | 1-st vertex index
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | 2-nd vertex index
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | 3-rd vertex index
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | 4-th vertex index
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | Coordinate index from block of coordinates of texturation for first vertex.
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | Coordinate index from block of coordinates of texturation for second vertex.
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | Coordinate index from block of coordinates of texturation for third vertex.
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | Coordinate index from block of coordinates of texturation for fourth vertex.
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | Color R (I think)
 +
| style="background:rgb(255,255,255);" | 1
 +
|-
 +
| style="background:rgb(255,255,255);" | Color G (I think)
 +
| style="background:rgb(255,255,255);" | 1
 +
|-
 +
| style="background:rgb(255,255,255);" | Color B (I think)
 +
| style="background:rgb(255,255,255);" | 1
 +
|-
 +
| style="background:rgb(255,255,255);" | (Texture information?)
 +
| style="background:rgb(255,255,255);" | 1
 +
|-
 +
| style="background:rgb(255,255,255);" | (Texture information?)
 +
| style="background:rgb(255,255,255);" | 4
 +
|}
 +
 +
 +
    '''''Triangle record:'''''
 +
 +
{| border="0" cellspacing="1" cellpadding="3" style="background: rgb(0,0,0)" align="center"
 +
! style="background:rgb(204,204,204);" align="center" | Data
 +
! style="background:rgb(204,204,204);" align="center" | Length (bytes)
 +
|-
 +
| style="background:rgb(255,255,255);" | 1-st vertex index
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | 2-nd vertex index
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | 3-rd vertex index
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | (Texture information?)
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | Color R (I think)
 +
| style="background:rgb(255,255,255);" | 1
 +
|-
 +
| style="background:rgb(255,255,255);" | Color G (I think)
 +
| style="background:rgb(255,255,255);" | 1
 +
|-
 +
| style="background:rgb(255,255,255);" | Color B (I think)
 +
| style="background:rgb(255,255,255);" | 1
 +
|-
 +
| style="background:rgb(255,255,255);" | (Texture information?)
 +
| style="background:rgb(255,255,255);" | 1
 +
|-
 +
| style="background:rgb(255,255,255);" | Coordinate index from block of coordinates of texturation for first vertex.
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | Coordinate index from block of coordinates of texturation for second vertex.
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | Coordinate index from block of coordinates of texturation for third vertex.
 +
| style="background:rgb(255,255,255);" | 2
 +
|-
 +
| style="background:rgb(255,255,255);" | (Texture information?)
 +
| style="background:rgb(255,255,255);" | 2
 +
|}
 +
 +
 +
'''Texture coordinates'''
 +
 +
In this block there is texture coordinate of selected object. Values of given table used for applying texture to quads and triangles of object. To elements of given table points «Coordinate index from block of coordinates of texturation for <N> vertex.» from triangle and quad records.
 +
 +
 +
Records counting from 0.
 +
 +
Texture coordinate record:
 +
 +
{| border="0" cellspacing="1" cellpadding="3" style="background: rgb(0,0,0)" align="center"
 +
! style="background:rgb(204,204,204);" align="center" | Data
 +
! style="background:rgb(204,204,204);" align="center" | Length (bytes)
 +
|-
 +
| style="background:rgb(255,255,255);" | Texture coordinate U
 +
| style="background:rgb(255,255,255);" | 1
 +
|-
 +
| style="background:rgb(255,255,255);" | Texture coordinate V
 +
| style="background:rgb(255,255,255);" | 1
 
|}
 
|}

Revision as of 13:09, 16 November 2008

Model begins with 4-byte header:


1: 00 (1-st model byte)

2: 00

3: Bones count.

4: Objects count.


Next there is 8 byte, unknown purpose

Next there is 4 bytes, value is always 0x14. I think, that it is count of bytes from 1-st byte to bones table.

Next there is 4-byte pointer from 1-st model byte to object table.


Bones

Next there is model scelet, bones counting from 0. Every bone information is of 4-bytes:

3 bytes — bone length

1 byte — parent bone


Object table

Size of table is 40 * objects count.

Data Length (bytes)
UNKNOWN 2
Quads count 2
Triangles count 2
UNKNOWN, zeroes 14
Pointer to vertex table, counting from first byte of model 4
Pointer to vertices, counting from first byte of model 4
Pointer to quad block with triangles, counting from first byte of model 4
Pointer to texture coordinates, counting from first byte of model 4
Pointer to the end of object, counting from first byte of model 4


Vertex table

In this table there is information about count of vertex connected to every bone. Every record is 2-byte. If count of bones is odd, there is 2-byte padding.


Vertices

Here there is information about all vertices of selected object. Vertex record is 3-byte and is of next structure:

Data Length (bytes)
X 2
Y 2
Z 2
Bone number 1
UnkNown 1

Point coordinates are in local coordinate system of given bones. Vertex count begins from 0. For every model object it counts from 0.


Quad and Triangle block

First there is block of quads, next there is triangles. Count of quads and triangles is in object table.

   Quad record:
Data Length (bytes)
1-st vertex index 2
2-nd vertex index 2
3-rd vertex index 2
4-th vertex index 2
Coordinate index from block of coordinates of texturation for first vertex. 2
Coordinate index from block of coordinates of texturation for second vertex. 2
Coordinate index from block of coordinates of texturation for third vertex. 2
Coordinate index from block of coordinates of texturation for fourth vertex. 2
Color R (I think) 1
Color G (I think) 1
Color B (I think) 1
(Texture information?) 1
(Texture information?) 4


    Triangle record:
Data Length (bytes)
1-st vertex index 2
2-nd vertex index 2
3-rd vertex index 2
(Texture information?) 2
Color R (I think) 1
Color G (I think) 1
Color B (I think) 1
(Texture information?) 1
Coordinate index from block of coordinates of texturation for first vertex. 2
Coordinate index from block of coordinates of texturation for second vertex. 2
Coordinate index from block of coordinates of texturation for third vertex. 2
(Texture information?) 2


Texture coordinates

In this block there is texture coordinate of selected object. Values of given table used for applying texture to quads and triangles of object. To elements of given table points «Coordinate index from block of coordinates of texturation for <N> vertex.» from triangle and quad records.


Records counting from 0.

Texture coordinate record:

Data Length (bytes)
Texture coordinate U 1
Texture coordinate V 1