Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

Star Fox/Object Data

From Data Crystal
< Star Fox
Revision as of 20:57, 16 May 2019 by SpyderTL (talk | contribs) (Added vertex and face data)
Jump to navigation Jump to search

This is a sub-page of Star Fox.

Object Data
Game Star Fox
Start Address 0x002c15
End Address 0x006900
# of Entries 556 (not all entries are used)
Entry Length 28 (0x1c)
Total Length 15,595 bytes (0x3CEB)
Back to the ROM map

Format

Offset  Size    Description
------- ----    -----------
 0x00   2       Vertex Data Offset
 0x02   1       Vertex Data Page
 0x03   2       Face Data Offset
 0x05   2       Z-Position
 0x07   1       Scale
 0x08   2       Collision Information
 0x0a   2       Size X
 0x0c   2       Size Y
 0x0e   2       Size Z
 0x10   2       Alignment
 0x12   2       Palette
 0x14   2       ID 1
 0x16   2       ID 2
 0x18   2       ID 3
 0x1a   2       ID 4


Vertex Data

The vertex data for an object can be found using this formula:

Address = ((Vertex Data Page - 1) * 0x8000) + Vertex Data Offset
Offset  Size    Description
------- ----    -----------
 0x00   1       Vertex List Type (0x04)
 0x01   1       Vertex Count
 0x02   3*Count Vertices
        
Offset  Size    Description
------- ----    -----------
 0x00   1       Vertex List Type (0x38)
 0x01   1       Vertex Count (not including mirrored vertices)
 0x02   3*Count Vertices (not including mirrored vertices)

Each vertex listed represents two vertices in the model. The first vertex is normal, and the second vertex is a mirror image of the model about the x-axis. All of the (virtual) mirror vertices are located after the normal vertices when they are being referenced by the face data below.


Offset  Size    Description
------- ----    -----------
 0x00   1       Vertex List Type (0x34)
 0x01   1       Vertex Count
 0x02   6*Count Vertices

Identical to Vertex List Type 0x04, but each vertex is 2 bytes.

Animated models use Vertex List Type 0x1C, but this format is currently unavailable.

The table ends when a Vertex List Type value of 0x0C is read.

Face Data

The face data follows the vertex data, and contains a list of triangles that make up the model.

Offset  Size    Description
------- ----    -----------
 0x00   1       Face List Type (0x30)
 0x01   1       Triangle Count
 0x02   3*Count Triangles

The Triangle List contains one or more triangles. Each triangle is made up of 3 bytes, one for each index in the vertex list above.