Difference between revisions of "Vertex"
From DoomWiki.org
[checked revision] | [checked revision] |
m (→Sources: templatified link) |
m (more accurate) |
||
Line 25: | Line 25: | ||
The number of vertices displayed in an [[editing utility]] is less than the size of the VERTEXES lump divided by 32 bits. This is because the map designer cannot manipulate the extra vertices required for all [[seg]]s to have endpoints; these are generated deterministically by the [[node builder]] (and then concealed from the user by nearly all mapping programs). | The number of vertices displayed in an [[editing utility]] is less than the size of the VERTEXES lump divided by 32 bits. This is because the map designer cannot manipulate the extra vertices required for all [[seg]]s to have endpoints; these are generated deterministically by the [[node builder]] (and then concealed from the user by nearly all mapping programs). | ||
− | ===Doom 64 | + | ===PlayStation / Doom 64 format=== |
+ | Midway's ports of Doom to the [[Sony PlayStation]] and [[Nintendo 64]] features additional precision by storing vertex coordinates as fixed_t (32-bit integers where 16 bits are used for the integral part and 16 for the fractional part). The range is therefore the same as in the original format, but fractional coordinates are possible. | ||
+ | |||
+ | {| {{prettytable}} | ||
+ | ! Offset | ||
+ | ! Size (bytes) | ||
+ | ! Description | ||
+ | |- | ||
+ | | align="center" | 0 | ||
+ | | align="center" | 4 | ||
+ | | ''x'' position | ||
+ | |- | ||
+ | | align="center" | 4 | ||
+ | | align="center" | 4 | ||
+ | | ''y'' position | ||
+ | |} | ||
− | |||
[[Category:Doom engine]] | [[Category:Doom engine]] | ||
[[Category:WAD lumps]] | [[Category:WAD lumps]] |
Revision as of 12:59, 24 April 2012
Doom level format |
---|
Vertices are nothing more than coordinates on the map. Linedefs and segs reference vertices for their start-point and end-point.
The vertices for a map are stored in the VERTEXES lump, which consists of a raw sequence of x, y coordinates as pairs of 16-bit signed integers. The bytes are in little-endian order (least significant byte first).
Due to the 16-bit signed two's complement format, each coordinate can range from -32768 to +32767.
Vertex structure
Offset | Size (bytes) | Description |
---|---|---|
0 | 2 | x position |
2 | 2 | y position |
Lump size
The number of vertices displayed in an editing utility is less than the size of the VERTEXES lump divided by 32 bits. This is because the map designer cannot manipulate the extra vertices required for all segs to have endpoints; these are generated deterministically by the node builder (and then concealed from the user by nearly all mapping programs).
PlayStation / Doom 64 format
Midway's ports of Doom to the Sony PlayStation and Nintendo 64 features additional precision by storing vertex coordinates as fixed_t (32-bit integers where 16 bits are used for the integral part and 16 for the fractional part). The range is therefore the same as in the original format, but fractional coordinates are possible.
Offset | Size (bytes) | Description |
---|---|---|
0 | 4 | x position |
4 | 4 | y position |
Sources
- Discrepancy in VERTEXES and other on-disk structs counts, thread at the Doomworld forums
- The Unofficial Doom Specs version 1.666, especially section 4.8