Difference between revisions of "Sonic Jam/Models"
From Sonic Retro
m |
|||
Line 74: | Line 74: | ||
| Body||$3FD98 | | Body||$3FD98 | ||
|} | |} | ||
+ | |||
+ | {{SCHGuides}} | ||
+ | [[Category:SCHG: Sonic Jam]] |
Revision as of 10:08, 18 February 2021
Models start at $3F908 in MUSEUM.MUS.
Contents
Model Format
Models generally consist of the following parts. There are some exceptions, but the general order stays the same.
Vertices
The first part are vertices, stored as a 3D vector.
Indexing Table
The second part is the indexing table for quads, using the vertices given. Indices are words, and jump by $08. The first vertex would be $0000; the second would be $0008. There's one for each quad.
Vertex Normals
The third, for objects that use Dynamic Gouraud Shading, are the vertex normals. These are normalized 3D vectors. As you'd expect, there's one for each vertex.
Draw Settings
After the above is the draw settings. There's one list of settings for each quad. Each list is 16 bytes long. Here's its format:
Description | Length |
---|---|
Unknown. Highest bit seems to turn off backface culling. | Byte |
Unknown. Bits $1 and $2 affect depth testing in certain instances. | Byte |
Texture index. $0-$1DB. | Word |
CMDPMOD command for VDP1. Bit flags. | Word |
Unknown. | Word |
Static/Dynamic Gouraud Shading Table Index. | Word |
CMDCTRL command for VDP1. Bit flags. | Word |
Unknown. | Word |
Unknown. | Word |
This can vary from model to model, depending on which parts are present. For Sonic, this consists of the following:
- Pointer to start of vertices (long), number of vertices (long)
- Pointer to start of indexing table (long), number of quads (long)
- Pointer to draw command (long)
- Pointer to vertex normals (long)
Model Groups
Some models, such as Sonic and Tails, consist of multiple models in a group. After the last model in the group, there's a footer.
The first part of the footer is a list of addresses pointing to each model's footer.
The second part is a list of 3D Vectors, relative positions for each model. They correspond to the addresses given in the previous section.
Certain model groups have some seemingly unused data that appears before the footer. This data seems to correlate with how the model group parenting hierarchy is set up.
Model List
Here's the list of models in the game that I know of. Addresses given are pointers to footers, for both model groups and individual models.
Sonic | $42620 |
---|---|
Body | $3FD98 |