Jump to content

MD2: Difference between revisions

From Kingpin Wiki
No edit summary
No edit summary
Line 1: Line 1:
<p style="text-align: center;" align="center"><span style="font-size: x-large;"><strong>.md2 File Format Specification</strong></span></p>
= .md2 File Format Specification =
<p style="text-align: center;" align="center"><span style="font-size: medium;"><strong>by </strong></span>[mailto:dansch@hops.cs.jhu.edu"> <span style="font-size: medium;"><strong>Daniel E. Schoenblum</strong></span>]</p>
'''by''' [mailto:dansch@hops.cs.jhu.edu Daniel E. Schoenblum]
<p align="left"><span style="color: #436888; font-size: large;">INTRO</span></p>
 
<p>This page will try and give some sort of technical documentation on the Quake2 model format (.md2).</p>
== INTRO ==
<p>These specs can be used freely for whatever you want. I only ask that people [mailto:dansch@hops.cs.jhu.edu">send me] corrections, suggestions, etc.</p>
This page will try and give some sort of technical documentation on the Quake2 model format (.md2).
<p align="left">Quake2 models are stored in files with the .md2 extension. This is a custom format used only by Quake2 and (probably) Quake2 mission packs. md2 files can be generated from various other file formats by tools provided freely by id, in original and modified form. A single md2 file contains the model's geometry, frame information, skin filename(s), and texture coordinates. The file is little-endian (intel byte ordering).</p>
 
<p align="left"><span style="color: #436888; font-size: large;">HEADER</span></p>
These specs can be used freely for whatever you want. I only ask that people [mailto:dansch@hops.cs.jhu.edu send me] corrections, suggestions, etc.
<p align="left">The header comes right at the start of the file. The information in the header is needed to load different parts of the model.</p>
 
<p align="left"><code>typedef struct <br /> { <br /> &nbsp;&nbsp;&nbsp;int [#model_magic">magic]; <br /> &nbsp;&nbsp;&nbsp;int [#model_version">version]; <br /> &nbsp;&nbsp;&nbsp;int [#model_skinWidth">skinWidth]; <br /> &nbsp;&nbsp;&nbsp;int [#model_skinHeight">skinHeight]; <br /> &nbsp;&nbsp;&nbsp;int [#model_frameSize">frameSize]; <br /> &nbsp;&nbsp;&nbsp;int [#model_numSkins">numSkins]; <br /> &nbsp;&nbsp;&nbsp;int [#model_numVertices">numVertices]; <br /> &nbsp;&nbsp;&nbsp;int [#model_numTexCoords">numTexCoords]; <br /> &nbsp;&nbsp;&nbsp;int [#model_numTriangles">numTriangles]; <br /> &nbsp;&nbsp;&nbsp;int [#model_numGlCommands">numGlCommands]; <br /> &nbsp;&nbsp;&nbsp;int [#model_numFrames">numFrames]; <br /> &nbsp;&nbsp;&nbsp;int [#model_offsetSkins">offsetSkins]; <br /> &nbsp;&nbsp;&nbsp;int [#model_offsetTexCoords">offsetTexCoords]; <br /> &nbsp;&nbsp;&nbsp;int [#model_offsetTriangles">offsetTriangles]; <br /> &nbsp;&nbsp;&nbsp;int [#model_offsetFrames">offsetFrames]; <br /> &nbsp;&nbsp;&nbsp;int [#model_offsetGlCommands">offsetGlCommands]; <br /> &nbsp;&nbsp;&nbsp;int [#model_offsetEnd">offsetEnd]; <br /> } model_t;</code></p>
Quake2 models are stored in files with the .md2 extension. This is a custom format used only by Quake2 and (probably) Quake2 mission packs. md2 files can be generated from various other file formats by tools provided freely by id, in original and modified form. A single md2 file contains the model's geometry, frame information, skin filename(s), and texture coordinates. The file is little-endian (intel byte ordering).
<p><a name="model_magic">]</p>
 
<p align="left">int magic: A "magic number" used to identify the file. The magic number is 844121161 in decimal (0x32504449 in hexadecimal). The magic number is equal to the int "IDP2" (id polygon 2), which is formed by ('I' + ('D' &lt;&lt; 8) + ('P' &lt;&lt; 16) + ('2' &lt;&lt; 24)).</p>
== HEADER ==
<p align="left"><a target="_top" name="model_version">] int version: Version number of the file. Always 8.</p>
The header comes right at the start of the file. The information in the header is needed to load different parts of the model.
<p align="left"><a target="_top" name="model_skinWidth">] int skinWidth: Width of the skin(s) in pixels.</p>
 
<p align="left"><a target="_top" name="model_skinHeight">] int skinHeight: Height of the skin(s) in pixels.</p>
<code>
<p align="left"><a target="_top" name="model_frameSize">] int frameSize: Size of each [#FRAMES">frame] in bytes.</p>
typedef struct
<p align="left"><a target="_top" name="model_numSkins">] int numSkins: Number of skins associated with this model.</p>
{
<p align="left"><a target="_top" name="model_numVertices">] int numVertices: Number of [#triangleVertex">vertices] in each frame.</p>
    int [[#model_magic|magic]];
<p align="left"><a target="_top" name="model_numTexCoords">] int numTexCoords: Number of texture coordinates (not necessarily the same as the number of vertices).</p>
    int [[#model_version|version]];
<p align="left"><a target="_top" name="model_numTriangles">] int numTriangles: Number of triangles in each frame.</p>
    int [[#model_skinWidth|skinWidth]];
<p align="left"><a target="_top" name="model_numGlCommands">] int numGlCommands: Number of dwords (4 bytes) in the gl command list.</p>
    int [[#model_skinHeight|skinHeight]];
<p align="left"><a target="_top" name="model_numFrames">] int numFrames: Number of [#FRAMES">frames].</p>
    int [[#model_frameSize|frameSize]];
<p align="left"><a target="_top" name="model_offsetSkins">] int offsetSkins: Offset, in bytes from the start of the file, to the list of skin names.</p>
    int [[#model_numSkins|numSkins]];
<p align="left"><a target="_top" name="model_offsetTexCoords">] int offsetTexCoords: Offset, in bytes from the start of the file, to the list of texture coordinates.</p>
    int [[#model_numVertices|numVertices]];
<p align="left"><a target="_top" name="model_offsetTriangles">] int offsetTriangles: Offset, in bytes from the start of the file, to the list of triangles.</p>
    int [[#model_numTexCoords|numTexCoords]];
<p align="left"><a target="_top" name="model_offsetFrames">] int offsetFrames: Offset, in bytes from the start of the file, to the list of [#FRAMES">frames].</p>
    int [[#model_numTriangles|numTriangles]];
<p align="left"><a target="_top" name="model_offsetGlCommands">] int offsetGlCommands: Offset, in bytes from the start of the file, to the gl command list.</p>
    int [[#model_numGlCommands|numGlCommands]];
<p align="left"><a target="_top" name="model_offsetEnd">] int offsetEnd: Offset, in bytes from the start of the file, to the end (size of the file).</p>
    int [[#model_numFrames|numFrames]];
<p><a name="FRAMES">]</p>
    int [[#model_offsetSkins|offsetSkins]];
<p align="left"><span style="color: #436888; font-size: large;">FRAMES</span></p>
    int [[#model_offsetTexCoords|offsetTexCoords]];
<p align="left">Each frame contains the positions in 3D space for each vertex of each triangle that makes up the model. Quake 2 (and Quake) models contain only triangles.</p>
    int [[#model_offsetTriangles|offsetTriangles]];
<p><a name="triangleVertex">] <code> typdef struct<br /> {<br /> &nbsp;&nbsp;&nbsp;byte [#triangleVertex_vertex">vertex][3];<br /> &nbsp;&nbsp;&nbsp;byte [#triangleVertex_lightNormalIndex">lightNormalIndex];<br /> } triangleVertex_t;<br /> </code></p>
    int [[#model_offsetFrames|offsetFrames]];
<p align="left"><a target="_top" name="triangleVertex_vertex">] byte vertex[3]: The three bytes represent the x, y, and z coordinates of this vertex. This is not the "real" vertex coordinate. This is a scaled version of the coordinate, scaled so that each of the three numbers fit within one byte. To scale the vertex back to the "real" coordinate, you need to first multiply each of the bytes by their respective float [#frame_scale">scale] in the [#frame">frame_t] structure, and then add the respective float [#frame_translate">translation ], also in the [#frame">frame_t] structure. This will give you the vertex coordinate relative to the model's origin, which is at the origin, (0, 0, 0).</p>
    int [[#model_offsetGlCommands|offsetGlCommands]];
<p align="left"><a target="_top" name="triangleVertex_lightNormalIndex">] byte lightNormalIndex: This is an index into a table of normals kept by Quake2. To get the table, you need to download [https://www.quaddicted.com/files/idgames2/idstuff/quake2/source/old/q2source_12_11.zip">this zip file (1.7 MB)], released by [http://www
    int [[#model_offsetEnd|offsetEnd]];
.idsoftware.com">id], that has the source code to all of the tools they used for quake2.</p>
} model_t;
<p align="left"><code> typedef struct<br /> {<br /> &nbsp;&nbsp;&nbsp;float [#frame_scale">scale][3];<br /> &nbsp;&nbsp;&nbsp;float [#frame_translate">translate][3];<br /> &nbsp;&nbsp;&nbsp;char [#frame_name">name][16];<br /> &nbsp;&nbsp;&nbsp;[#triangleVertex">triangleVertex_t] [#frame_vertices">vertices][1];<br /> } frame_t;<br /> </code></p>
</code>
<p align="left">frame_t is a variable sized structure, however all frame_t structures within the same file will have the same size ([#model_numVertices">numVertices] in the [#model">header])</p>
 
<p align="left"><a target="_top" name="frame_scale">] float scale[3]: This is a scale used by the [#triangleVertex_vertex">vertex] member of the [#triangleVertex">triangleVertex_t] structure.</p>
=== model_magic ===
<p align="left"><a target="_top" name="frame_translate">] float translate[3]: This is a translation used by the [#triangleVertex_vertex">vertex] member of the [#triangleVertex">triangleVertex_t] structure.</p>
'''int magic''': A "magic number" used to identify the file. The magic number is 844121161 in decimal (0x32504449 in hexadecimal). The magic number is equal to the int "IDP2" (id polygon 2), which is formed by ('I' + ('D' << 8) + ('P' << 16) + ('2' << 24)).
<p align="left"><a target="_top" name="frame_name">] char name[16]: This is a name for the frame.</p>
 
<p align="left"><a target="_top" name="frame_vertices">] [#triangleVertex">triangleVertex_t] vertices[1]: An array of [#model_numVertices">numVertices] [#triangleVertex">triangleVertex_t] structures.</p>
=== model_version ===
<p align="left"><a name="TRIANGLES">]</p>
'''int version''': Version number of the file. Always 8.
<p align="left"><span style="color: #436888; font-size: large;">TRIANGLES</span></p>
 
<p align="left">Quake 2 models are made up of only triangles. At [#model_offsetTriangles">offsetTriangles] in the file is an array of [#triangle">triangle_t] structures. The array has [#model_numTriangles">numTriangles] structures in it.</p>
=== model_skinWidth ===
<p align="left"><a name="triangle">]</p>
'''int skinWidth''': Width of the skin(s) in pixels.
<p align="left"><code> typedef struct<br /> {<br /> &nbsp;&nbsp;&nbsp;short [#triangle_vertexIndices">vertexIndices][3];<br /> &nbsp;&nbsp;&nbsp;short [#triangle_textureIndices">textureIndices][3];<br /> } triangle_t;<br /> </code></p>
 
<p align="left"><a target="_top" name="triangle_vertexIndices">] short vertexIndices: These three shorts are indices into the array of [#frame_vertices">vertices] in each [#frame">frames]. In other words, the number of triangles in a md2 file is fixed, and each triangle is always made of the same three indices into each frame's array of vertices. So, in each frame, the triangles themselves stay intact, their vertices are just moved around.</p>
=== model_skinHeight ===
<p align="left"><a target="_top" name="triangle_textureIndices">] short textureIndices: These three shorts are indices into the array of [#textureCoordinate">texture coordinates].</p>
'''int skinHeight''': Height of the skin(s) in pixels.
<p align="left"><a name="SKINS">]</p>
 
<p align="left"><span style="color: #436888; font-size: large;">SKINS</span></p>
=== model_frameSize ===
<p align="left"><a name="SKINS">]</p>
'''int frameSize''': Size of each [[#FRAMES|frame]] in bytes.
<p align="left">There is an array of [#model_numSkins">numSkins] skin names stored at [#model_offsetSkins">offsetSkins] into the file. Each skin name is a char[64]. The name is really a path to the skin, relative to the base game directory (baseq2 f or "standard" Quake2). The skin files are regular pcx files.</p>
 
<p align="left"><a name="textureCoordinate">]</p>
=== model_numSkins ===
<p align="left"><code> typedef struct<br /> {<br /> &nbsp;&nbsp;&nbsp;short [#textureCoordinate_st">s], [#textureCoordinate_st">t];<br /> } textureCoordinate_t;<br /> </code></p>
'''int numSkins''': Number of skins associated with this model.
<p align="left"><a target="_top" name="textureCoordinate_t">] short s, t: These two shorts are used to map a vertex onto a skin. The horizontal axis position is given by s, and the vertical axis position is given by t. The range for s is greater than or equal to 0 and less than [#model_skinWidth">skinWidth] (0 &lt;= s &lt; skinWidth). The range for t is greater than or equal to 0 and less than [#model_skinHeight">skinHeight] (0 &lt;= s &lt; skinHeight). Note that the ranges are different than in the [#glCommandVertex_s">s] and [#glCommandVertex_t">t] members of the [#glCommandVertex">glCommandVertex] structure.</p>
 
<p align="left"><a name="GL_COMMANDS">]</p>
=== model_numVertices ===
<p align="left"><span style="color: #436888; font-size: large;">GL COMMANDS</span></p>
'''int numVertices''': Number of [[#triangleVertex|vertices]] in each frame.
<p align="left"><a name="GL_COMMANDS">]At [#model_offsetGlCommands">offsetGlCommands]<a name="GL_COMMANDS">] bytes into the file, there is the gl command list, which is made up of a series of [#model_numGlCommands">numGlCommands]<a name="GL_COMMANDS">] int's and float's, organized into groups. Each group starts with an int. If it is positive, it is followed by that many [#glCommandVertex">glCommandVertex_t]<a name="GL_COMMANDS">] structures, which form a triangle strip. If it is negative, it is followed by -x [#glCommandVertex">glCommandVertex_t]<a name="GL_COMMANDS">] structures, which fo rm a triangle fan. A 0 indicates the end of the list. The list is an optimized way of issuing commands when rendering with [http://www.opengl.org">OpenGl]<a name="GL_COMMANDS">]. <a name="glCommandVertex">]</p>
 
<p align="left"><code> typedef struct<br /> {<br /> &nbsp;&nbsp;&nbsp;float [#glCommandVertex_st">s], [#glCommandVertex_st">t];<br /> &nbsp;&nbsp;&nbsp;int [#glCommandVertex_vertexIndex">vertexIndex];<br /> } glCommandVertex_t;<br /> </code></p>
=== model_numTexCoords ===
<p align="left"><a target="_top" name="glCommandVertex_t">] float s, t: These two floats are used to map a vertex onto a skin. The horizontal axis position is given by s, and the vertical axis position is given by t. The range for s and for t is 0.0 to 1.0. Note that the ranges are different than in the [#textureCoordinate">textureCoordinate_t]<a target="_top" name="glCommandVertex_t">] structure. They are stored as floats here because that's the way Quake2 passes them to [http://www.opengl.org">OpenGl]<a target="_top" name="glCommandVertex_t">].</p>
'''int numTexCoords''': Number of texture coordinates (not necessarily the same as the number of vertices).
<p align="left"><a target="_top" name="glCommandVertex_vertexIndex">] int vertexIndex: Index into the array of [#frame_vertices">vertices]<a target="_top" name="glCommandVertex_vertexIndex">] stored in each [#frame">frame]<a target="_top" name="glCommandVertex_vertexIndex">].</p>
 
<p align="left"><span style="color: #436888; font-size: large;">MAXIMUMS</span></p>
=== model_numTriangles ===
<p align="left">Quake2 has some pre-defined limits, so that dynamic memory does not need to be used. You can use these to your advantage to speed up loading if you want.</p>
'''int numTriangles''': Number of triangles in each frame.
<ul>
 
<li>[#TRIANGLES">Triangles]: 4096</li>
=== model_numGlCommands ===
<li>[#triangleVertex">Vertices]: 2048</li>
'''int numGlCommands''': Number of dwords (4 bytes) in the gl command list.
<li>[#textureCoordinate">Texture Coordinates]: 2048</li>
 
<li>[#FRAMES">Frames]: 512</li>
=== model_numFrames ===
<li>[#SKINS">Skins]: 32</li>
'''int numFrames''': Number of [[#FRAMES|frames]].
</ul>
 
<p align="left"><span> Quake and Quake2 are trademarks of [http://www.idsoftware.com">id Software].<br /> All trademarks used are properties of their respective owners. </span></p>
=== model_offsetSkins ===
<p align="left"><a name="glCommandVertex">]</p>
'''int offsetSkins''': Offset, in bytes from the start of the file, to the list of skin names.
<p align="left"><a name="textureCoordinate">]</p>
 
<p align="left"><a name="triangle">]</p>
=== model_offsetTexCoords ===
'''int offsetTexCoords''': Offset, in bytes from the start of the file, to the list of texture coordinates.
 
=== model_offsetTriangles ===
'''int offsetTriangles''': Offset, in bytes from the start of the file, to the list of triangles.
 
=== model_offsetFrames ===
'''int offsetFrames''': Offset, in bytes from the start of the file, to the list of [[#FRAMES|frames]].
 
=== model_offsetGlCommands ===
'''int offsetGlCommands''': Offset, in bytes from the start of the file, to the gl command list.
 
=== model_offsetEnd ===
'''int offsetEnd''': Offset, in bytes from the start of the file, to the end (size of the file).
 
== FRAMES ==
Each frame contains the positions in 3D space for each vertex of each triangle that makes up the model. Quake 2 (and Quake) models contain only triangles.
 
<pre>
typedef struct
{
    byte [[#triangleVertex_vertex|vertex]][3];
    byte [[#triangleVertex_lightNormalIndex|lightNormalIndex]];
} triangleVertex_t;
</pre>
 
=== triangleVertex_vertex ===
'''byte vertex[3]''': The three bytes represent the x, y, and z coordinates of this vertex. This is not the "real" vertex coordinate. This is a scaled version of the coordinate, scaled so that each of the three numbers fit within one byte.  
 
=== triangleVertex_lightNormalIndex ===
'''byte lightNormalIndex''': This is an index into a table of normals kept by Quake2.
 
== TRIANGLES ==
Quake 2 models are made up of only triangles. At [[#model_offsetTriangles|offsetTriangles]] in the file is an array of [[#triangle|triangle_t]] structures.
 
<pre>
typedef struct
{
    short [[#triangle_vertexIndices|vertexIndices]][3];
    short [[#triangle_textureIndices|textureIndices]][3];
} triangle_t;
</pre>
 
=== triangle_vertexIndices ===
'''short vertexIndices''': These three shorts are indices into the array of [[#frame_vertices|vertices]] in each [[#frame|frame]].
 
=== triangle_textureIndices ===
'''short textureIndices''': These three shorts are indices into the array of [[#textureCoordinate|texture coordinates]].
 
== SKINS ==
There is an array of [[#model_numSkins|numSkins]] skin names stored at [[#model_offsetSkins|offsetSkins]] into the file. Each skin name is a char[64]. The name is really a path to the skin, relative to the base game directory (baseq2 for "standard" Quake2). The skin files are regular PCX files.
 
== GL COMMANDS ==
At [[#model_offsetGlCommands|offsetGlCommands]] bytes into the file, there is the gl command list.
 
<pre>
typedef struct
{
    float [[#glCommandVertex_st|s]], [[#glCommandVertex_st|t]];
    int [[#glCommandVertex_vertexIndex|vertexIndex]];
} glCommandVertex_t;
</pre>
 
=== glCommandVertex_st ===
'''float s, t''': These two floats are used to map a vertex onto a skin.
 
=== glCommandVertex_vertexIndex ===
'''int vertexIndex''': Index into the array of [[#frame_vertices|vertices]] stored in each [[#frame|frame]].
 
== MAXIMUMS ==
Quake2 has some pre-defined limits:
 
* [[#TRIANGLES|Triangles]]: 4096
* [[#triangleVertex|Vertices]]: 2048
* [[#textureCoordinate|Texture Coordinates]]: 2048
* [[#FRAMES|Frames]]: 512
* [[#SKINS|Skins]]: 32
 
Quake and Quake2 are trademarks of [http://www.idsoftware.com id Software]. All trademarks used are properties of their respective owners.

Revision as of 22:47, 18 March 2025

.md2 File Format Specification

by Daniel E. Schoenblum

INTRO

This page will try and give some sort of technical documentation on the Quake2 model format (.md2).

These specs can be used freely for whatever you want. I only ask that people send me corrections, suggestions, etc.

Quake2 models are stored in files with the .md2 extension. This is a custom format used only by Quake2 and (probably) Quake2 mission packs. md2 files can be generated from various other file formats by tools provided freely by id, in original and modified form. A single md2 file contains the model's geometry, frame information, skin filename(s), and texture coordinates. The file is little-endian (intel byte ordering).

HEADER

The header comes right at the start of the file. The information in the header is needed to load different parts of the model.

typedef struct {

   int magic;  
   int version;  
   int skinWidth;  
   int skinHeight;  
   int frameSize;  
   int numSkins;  
   int numVertices;  
   int numTexCoords;  
   int numTriangles;  
   int numGlCommands;  
   int numFrames;  
   int offsetSkins;  
   int offsetTexCoords;  
   int offsetTriangles;  
   int offsetFrames;  
   int offsetGlCommands;  
   int offsetEnd;

} model_t;

model_magic

int magic: A "magic number" used to identify the file. The magic number is 844121161 in decimal (0x32504449 in hexadecimal). The magic number is equal to the int "IDP2" (id polygon 2), which is formed by ('I' + ('D' << 8) + ('P' << 16) + ('2' << 24)).

model_version

int version: Version number of the file. Always 8.

model_skinWidth

int skinWidth: Width of the skin(s) in pixels.

model_skinHeight

int skinHeight: Height of the skin(s) in pixels.

model_frameSize

int frameSize: Size of each frame in bytes.

model_numSkins

int numSkins: Number of skins associated with this model.

model_numVertices

int numVertices: Number of vertices in each frame.

model_numTexCoords

int numTexCoords: Number of texture coordinates (not necessarily the same as the number of vertices).

model_numTriangles

int numTriangles: Number of triangles in each frame.

model_numGlCommands

int numGlCommands: Number of dwords (4 bytes) in the gl command list.

model_numFrames

int numFrames: Number of frames.

model_offsetSkins

int offsetSkins: Offset, in bytes from the start of the file, to the list of skin names.

model_offsetTexCoords

int offsetTexCoords: Offset, in bytes from the start of the file, to the list of texture coordinates.

model_offsetTriangles

int offsetTriangles: Offset, in bytes from the start of the file, to the list of triangles.

model_offsetFrames

int offsetFrames: Offset, in bytes from the start of the file, to the list of frames.

model_offsetGlCommands

int offsetGlCommands: Offset, in bytes from the start of the file, to the gl command list.

model_offsetEnd

int offsetEnd: Offset, in bytes from the start of the file, to the end (size of the file).

FRAMES

Each frame contains the positions in 3D space for each vertex of each triangle that makes up the model. Quake 2 (and Quake) models contain only triangles.

typedef struct
{
    byte [[#triangleVertex_vertex|vertex]][3];
    byte [[#triangleVertex_lightNormalIndex|lightNormalIndex]];
} triangleVertex_t;

triangleVertex_vertex

byte vertex[3]: The three bytes represent the x, y, and z coordinates of this vertex. This is not the "real" vertex coordinate. This is a scaled version of the coordinate, scaled so that each of the three numbers fit within one byte.

triangleVertex_lightNormalIndex

byte lightNormalIndex: This is an index into a table of normals kept by Quake2.

TRIANGLES

Quake 2 models are made up of only triangles. At offsetTriangles in the file is an array of triangle_t structures.

typedef struct
{
    short [[#triangle_vertexIndices|vertexIndices]][3];
    short [[#triangle_textureIndices|textureIndices]][3];
} triangle_t;

triangle_vertexIndices

short vertexIndices: These three shorts are indices into the array of vertices in each frame.

triangle_textureIndices

short textureIndices: These three shorts are indices into the array of texture coordinates.

SKINS

There is an array of numSkins skin names stored at offsetSkins into the file. Each skin name is a char[64]. The name is really a path to the skin, relative to the base game directory (baseq2 for "standard" Quake2). The skin files are regular PCX files.

GL COMMANDS

At offsetGlCommands bytes into the file, there is the gl command list.

typedef struct
{
    float [[#glCommandVertex_st|s]], [[#glCommandVertex_st|t]];
    int [[#glCommandVertex_vertexIndex|vertexIndex]];
} glCommandVertex_t;

glCommandVertex_st

float s, t: These two floats are used to map a vertex onto a skin.

glCommandVertex_vertexIndex

int vertexIndex: Index into the array of vertices stored in each frame.

MAXIMUMS

Quake2 has some pre-defined limits:

Quake and Quake2 are trademarks of id Software. All trademarks used are properties of their respective owners.