Normal quotes
This commit is contained in:
parent
5e10794a24
commit
18011c595a
352 changed files with 6040 additions and 6040 deletions
40
59-02.md
40
59-02.md
|
|
@ -2,15 +2,15 @@
|
|||
[Previous](59-01.html) [Table of Contents](index.html) [Next](59-03.html)
|
||||
------------------------ --------------------------------- --------------------
|
||||
|
||||
Back-to-front or front-to-back traversal in itself wouldn’t be so
|
||||
Back-to-front or front-to-back traversal in itself wouldn't be so
|
||||
impressive—there are many ways to do that—were it not for one additional
|
||||
detail: The traversal can always be performed in linear time, as we’ll
|
||||
detail: The traversal can always be performed in linear time, as we'll
|
||||
see later on. For instance, you can traverse, a polygon list
|
||||
back-to-front from any viewpoint simply by walking through the
|
||||
corresponding BSP tree once, visiting each node one and only one time,
|
||||
and performing only one relatively inexpensive test at each node.
|
||||
|
||||
It’s hard to get cheaper sorting than linear time, and BSP-based
|
||||
It's hard to get cheaper sorting than linear time, and BSP-based
|
||||
rendering stacks up well against alternatives such as z-buffering,
|
||||
octrees, z-scan sorting, and polygon sorting. Better yet, a scene
|
||||
database represented as a BSP tree can be clipped to the view pyramid
|
||||
|
|
@ -22,12 +22,12 @@ for reasons that will become clear as we delve into the workings of BSP
|
|||
trees.
|
||||
|
||||
\
|
||||
**Figure 59.1** *The painter’s algorithm.*
|
||||
**Figure 59.1** *The painter's algorithm.*
|
||||
|
||||
#### Limitations of BSP Trees {#Heading5}
|
||||
|
||||
Powerful as they are, BSP trees aren’t perfect. By far the greatest
|
||||
limitation of BSP trees is that they’re time-consuming to build, enough
|
||||
Powerful as they are, BSP trees aren't perfect. By far the greatest
|
||||
limitation of BSP trees is that they're time-consuming to build, enough
|
||||
so that, for all practical purposes, BSP trees must be precalculated,
|
||||
and cannot be built dynamically at runtime. In fact, a BSP-tree compiler
|
||||
that attempts to perform some optimization (limiting the number of
|
||||
|
|
@ -49,7 +49,7 @@ quicker than building them, because the BSP trees being merged are
|
|||
already spatially sorted.
|
||||
|
||||
Another possibility would be to generate a per-pixel z-buffer for each
|
||||
frame as it’s rendered, to allow dynamically changing objects to be
|
||||
frame as it's rendered, to allow dynamically changing objects to be
|
||||
drawn into the BSP-based world. In this scheme, the BSP tree would allow
|
||||
fast traversal and clipping of the complex, static world, and the
|
||||
z-buffer would handle the relatively localized visibility determination
|
||||
|
|
@ -69,7 +69,7 @@ required to store the tree, which amounts to a few pointers per node,
|
|||
and the relative complexity of debugging BSP-tree compilation and usage;
|
||||
debugging a large data set being processed by recursive code (which BSP
|
||||
code tends to be) can be quite a challenge. Tools like the BSP compiler
|
||||
I’ll present in the next chapter, which visually depicts the process of
|
||||
I'll present in the next chapter, which visually depicts the process of
|
||||
spatial subdivision as a BSP tree is constructed, help a great deal with
|
||||
BSP debugging.
|
||||
|
||||
|
|
@ -77,23 +77,23 @@ BSP debugging.
|
|||
|
||||
Now that we know a good bit about what a BSP tree is, how it helps in
|
||||
visible surface determination, and what its strengths and weaknesses
|
||||
are, let’s take a look at how a BSP tree actually works to provide
|
||||
front-to-back or back-to-front ordering. This chapter’s discussion will
|
||||
are, let's take a look at how a BSP tree actually works to provide
|
||||
front-to-back or back-to-front ordering. This chapter's discussion will
|
||||
be at a conceptual level, with plenty of figures; in the next chapter
|
||||
we’ll get into mechanisms and implementation details.
|
||||
we'll get into mechanisms and implementation details.
|
||||
|
||||
I’m going to discuss only 2-D BSP trees from here on out, because
|
||||
they’re much easier to draw and to grasp than their 3-D counterparts.
|
||||
Don’t worry, though; the principles of 2-D BSP trees using line segments
|
||||
I'm going to discuss only 2-D BSP trees from here on out, because
|
||||
they're much easier to draw and to grasp than their 3-D counterparts.
|
||||
Don't worry, though; the principles of 2-D BSP trees using line segments
|
||||
generalize directly to 3-D BSP trees using polygons. Also, 2-D BSP trees
|
||||
are quite powerful in their own right, as evidenced by DOOM, which is
|
||||
built around 2-D BSP trees.
|
||||
|
||||
First, let’s construct a simple BSP tree. Figure 59.2 shows a set of
|
||||
four lines that will constitute our sample world. I’ll refer to these as
|
||||
walls, because that’s one easily-visualized context in which a 2-D BSP
|
||||
First, let's construct a simple BSP tree. Figure 59.2 shows a set of
|
||||
four lines that will constitute our sample world. I'll refer to these as
|
||||
walls, because that's one easily-visualized context in which a 2-D BSP
|
||||
tree would be useful in a game. Think of Figure 59.2 as depicting
|
||||
vertical walls viewed from directly above, so they’re lines for the
|
||||
vertical walls viewed from directly above, so they're lines for the
|
||||
purpose of the BSP tree. Note that each wall has a front side, denoted
|
||||
by a normal (perpendicular) vector, and a back side. To make a BSP tree
|
||||
for this sample set, we need to split the world in two, then each part
|
||||
|
|
@ -111,8 +111,8 @@ sense of producing the smallest tree, but it has the virtue of
|
|||
generating the splitting lines without expensive analysis. It also saves
|
||||
on data storage, because the data for the walls can do double duty in
|
||||
describing the splitting lines as well. (Putting one wall on each
|
||||
splitting line doesn’t actually create a unique subspace for each wall,
|
||||
but it does create a unique subspace *boundary* for each wall; as we’ll
|
||||
splitting line doesn't actually create a unique subspace for each wall,
|
||||
but it does create a unique subspace *boundary* for each wall; as we'll
|
||||
see, that spatial organization provides for the same unambiguous
|
||||
visibility ordering as a unique subspace would.)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue