Quasar
Moderator

Posts: 4613
Registered: 08-00 |
HollowedEmpire said:
I searched around for a bit but I was surprised I didn't find anything on this... (And hopefully this is a good place to post this...)
Doom's floors. I know how they are made the original way with the visplanes and all, but what I want to know is how someone could go about forming polygonal meshes for the floors/ceilings.
From what I've been finding, is it seems you can use the points from the subsectors to form them. Is that right? But what is this about implicit edges? I'm just a tiny bit confused at which lines they actually are. I just need a quick rundown I guess.
Thanks in advance!
Most ports use a precalculated "GL" BSP to facilitate quick determination of these fully closed polygons; however, this shouldn't be strictly necessary, especially for levels with well-formed sectors and BSP trees.
The segs together with the complete set of node partition lines (determined by the node_t::x, y, dx, dy fields) should form a complete division of space. So the problem is one of recursively splitting node lines with the vertices of segs that lay on (or sufficiently near in some possible cases of round-off error) the node lines, and then generating one or more dummy segs for each resulting edge in order to close the subsectors that are against them.
Something to be aware of is that a subsector may have only one explicit edge (typically a single-sided wall), while all remaining 2 or more other lines in the subsector are implicit node line edges. So it doesn't suffice to make any assumptions about how many implicit edges there may be.
I can't promise it'll be fast, but it should be the kind of thing that only needs to be done once when loading the level.
|