bspquake

Quake MAP brushes


Many level editors like Quake or Source games uses implicit plane equation for brush side representation (by 3 points) instead of simple (n.x n.y n.z d).

 {
     ...
     ( 256 0 0 ) ( 256 0 1 ) ( 256 1 0 ) GROUND1_6 0 0 0 1.0 1.0
     ( 0 128 0 ) ( 0 128 1 ) ( 1 128 0 ) GROUND1_6 0 0 0 1.0 1.0
     ...
 }

Is there some reason for this? I know it can be easily converted to any form, just wonder why they used this form. Is it some floating point precision stuff?


Solution

  • Quake uses the plane equation, and plane sidedness test, extensively, and so while it seems awkward or annoying if you're just looking to render map geometry, it was likely a pretty easy decision to use this representation. As alluded to above, it allows the map format to use integer coordinates for plane sides. This means the format itself is "lossless" and immune to floating point rounding issues. Vertex coordinates can be calculated at either floating point or full double precision. In fact, newer BSP compilers (q3map2, quemap, etc..) do use double precision for some face splitting calculations.