Bytes | Values | Notes |
0-3 4-7 8-11 12- |
"SZYX" 0x00000000 data size data... |
Section Type (reversed) Seems to be a zero all the time Size of data in bytes Sets of 16 bytes |
The data section consists of multiples of 16bytes: 4bytes each for the
s, x, y & z coordinates (in that order). The s coord has been zero
in all the files I've seen. The coordinates are in float format, and
can be read (in C) with:
float x;
FILE* f;
fread(&x, sizeof(float), 1, f);
Here is a diagram to hopefully show how these numbers define a plane:
Planes are used in GPL for two purposes - for Hidden Surface Removal (HSR),
and Collision Detection. In both cases they are used to split 3D space
into two parts, above and below. GPL also uses on
the plane, and sometimes uses - on the plane viewed from above,
and on the plane viewed from below.
In general terms, normals are unit length (1.0) vectors that define the direction a polygon lies in - e.g. for a table top the normal would point straight up. Normals can be defined either once for the entire polygon (used for polygons that represent flat objects), or once per vertex (used for spheres, etc.).
A typical STRN section looks like this (kyalami/in-t9.3do, if you must
know).
Bytes | Values | Notes |
0-3 4-7 8-11 12- |
"NRTS" 0x00000000 data size grass02, 0x00 0xFF |
Section Type Seems to be a zero all the time Size of data in bytes (not including padding spaces) Strings, each terminated with a 0x00 character A single 0xFF character terminating the string table Padding 0x20 characters (spaces). Either 0, 1, 2 or 3, to bring the STRN size up to a multiple of 4. |