4 ms·
> I never dove into the subject enough to figure out if this plane representation was also internal to the compiled bsp format, but I suspect it is. Not exactl
by cmovq 2y ago
> I never dove into the subject enough to figure out if this plane representation was also internal to the compiled bsp format, but I suspect it is.
Not exactly. The BSP format stores planes as a normal (3 floats) + distance to the origin + an int that flags axis aligned planes. Which is the representation the engine uses.
I believe “3 points on the plane” was chosen for the map file so the coordinates could be exact integers in the text file, to avoid precision loss from storing the normal+distance representation. The latter representation uses less space and is easier to work with.
- Maken 2y agoNow I'm curious. How does BSP encode the orientation of a plane wrt its normal?
- webkike 2y agoThe normal is the orientation
- Maken 2y agoIt is the orientation of the plane, but not the orientation inside the plane. How does BSP decides in which direction it must display the textures inside a plane?
- cmovq 2y agoThe BSP file stores faces, which define a number of edges (or vertices). Faces are used in rendering, and contain the texture being drawn. Faces also refer to a plane and a “side”. If the side is 1, the normal of the plane is flipped which has the effect of using the back side of the plane.
- Sharlin 2y agoThree points on a plane also give you a basis for texture mapping that’s reasonably intuitive to the level designer. I believe this is the main reason for the representation.
- badsectoracula 2y agoWhile texture mapping is done via box projection based on the plane itself, the actual texture mapping parameters are separate values than the plane (specifically they are scaling, shifting and rotation). Some .map extensions do store vectors instead of scale/shift/rotate that allow much more flexible texture mapping (though still need to be on a plane, but can represent things like skewing), but these are still stored separately from the plane.