Format:MDL (Quake)
Appearance
| Developer | id Software |
|---|---|
| Versions | 6 |
| Magic | 49 44 50 4F ("IDPO") at offset 0, then int32 6 |
| Extensions | .mdl |
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
Alias (vertex-animated) model format of Software:Quake: magic "IDPO", version 6, an 84-byte header with scale and origin for decoding byte-quantised vertices, followed by 8-bit skins, texture coordinates, triangles and keyframes. Not related to the Half-Life or Source .mdl formats.
Identification
IDPO at offset 0 and the int32 version 6. Half-Life (IDST) and Source models use the same extension but are unrelated.
Structure
After the 84-byte header, in order:
- Skins (
numskinstimes): anint32type (0 single, 1 group). A single skin isskinwidth * skinheightpalette indices; a group is a count, that many float intervals, then that many images. - Texture coordinates (
numvertstimes, 12 bytes):onseam,s,tasint32. - Triangles (
numtristimes, 16 bytes):facesfrontand three vertex indices. - Frames (
numframestimes): anint32type (0 single, 1 group). A single frame is a bounding-box min and max vertex, a 16-byte name, thennumverts4-byte vertices; a group adds a count, bounds, float intervals and that many single frames.
A vertex is three unsigned bytes and an index into the engine's table of 162 precomputed normals. The model-space position is scale * v + scale_origin per axis.
Pitfalls
- Skin coordinates of back-facing triangles that touch a seam vertex (
onseamset, 0x20) get half the skin width added tos: the skin holds front and back halves side by side. - Frame and skin types are full
int32, not bytes.
Evidence & references
- id Software Quake source,
WinQuake/modelgen.h(mdl_t,stvert_t,dtriangle_t,trivertx_t,daliasframe_t),model.c(Mod_LoadAliasModel),r_alias.c(seam fix-up of half the skin width, transform fromscale_origin) at commit bf4ac42. - Runtime test: all 81
.mdlfiles of LibreQuake v0.09-beta start withIDPOand version 6.