Normal quotes
This commit is contained in:
parent
5e10794a24
commit
18011c595a
352 changed files with 6040 additions and 6040 deletions
22
65-04.md
22
65-04.md
|
|
@ -11,13 +11,13 @@ regarding range and precision. Floating-point is much easier—and, with
|
|||
the Pentium generation of processors, is generally comparable in speed.
|
||||
In fact, for some operations, such as multiplication in general and
|
||||
division when the floating-point unit is in single-precision mode,
|
||||
floating-point is much faster. Check out Chris Hecker’s column in the
|
||||
floating-point is much faster. Check out Chris Hecker's column in the
|
||||
February 1996 *Game Developer* for an interesting discussion along these
|
||||
lines.
|
||||
|
||||
Second, the planes that form the frustum are shifted ever so slightly
|
||||
inward from their proper positions at the edge of the field of view.
|
||||
This guarantees that it’s never possible to generate a visible vertex
|
||||
This guarantees that it's never possible to generate a visible vertex
|
||||
exactly at the eyepoint, averting the divide-by-zero error that such a
|
||||
vertex would cause when projected and at no performance cost.
|
||||
|
||||
|
|
@ -40,12 +40,12 @@ objects began to warp visibly after many rotations.
|
|||
|
||||
Fourth, Listing 65.3 processes each input polygon into a clipped
|
||||
polygon, one line segment at a time. It would be more efficient to
|
||||
process all the vertices, categorizing whether and how they’re clipped,
|
||||
process all the vertices, categorizing whether and how they're clipped,
|
||||
and then perform a test such as the Cohen-Sutherland outcode test to
|
||||
detect trivial acceptance (the polygon is entirely inside) and sometimes
|
||||
trivial rejection (the polygon is fully outside) without ever dealing
|
||||
with the edges, and to identify which planes actually need to be clipped
|
||||
against, as discussed in “Line-Segment Clipping Revisited,” *Dr. Dobb’s
|
||||
against, as discussed in "Line-Segment Clipping Revisited," *Dr. Dobb's
|
||||
Journal*, January 1996. Some clipping approaches also minimize the
|
||||
number of intersection calculations when a segment is clipped by
|
||||
multiple planes. Further, Listing 65.3 clips a polygon against each
|
||||
|
|
@ -88,7 +88,7 @@ For a game, 90 degrees is a pretty good field of view, but can we get
|
|||
the same sort of efficient clipping if we need some other field of view?
|
||||
Sure. All we have to do is scale the x and y results of the
|
||||
world-to-view transformation to account for the field of view, so that
|
||||
the coordinates lie in a viewspace that’s normalized such that the
|
||||
the coordinates lie in a viewspace that's normalized such that the
|
||||
frustum planes extend along lines of x==z and y==z. The resulting
|
||||
visible projected points span the range -1 to 1 (before scaling up to
|
||||
get pixel coordinates), just as with a 90-degree field of view, so the
|
||||
|
|
@ -96,27 +96,27 @@ rest of the drawing pipeline remains unchanged. Better yet, there is no
|
|||
cost in performance because the adjustment can be added to the
|
||||
transformation matrix.
|
||||
|
||||
I didn’t implement normalized clipping in Listing 65.3 because I wanted
|
||||
I didn't implement normalized clipping in Listing 65.3 because I wanted
|
||||
to illustrate the general 3-D clipping mechanism without additional
|
||||
complications, and because for many applications the dot product (which,
|
||||
after all, takes only 10-20 cycles on a Pentium) is sufficient. However,
|
||||
the more frustum clipping you’re doing, especially if most of the
|
||||
the more frustum clipping you're doing, especially if most of the
|
||||
polygons are trivially visible, the more attractive the performance
|
||||
advantages of normalized clipping become.
|
||||
|
||||
### Further Reading {#Heading9}
|
||||
|
||||
You now have the basics of 3-D clipping, but because fast clipping is
|
||||
central to high-performance 3-D, there’s a lot more to be learned. One
|
||||
central to high-performance 3-D, there's a lot more to be learned. One
|
||||
good place for further reading is Foley and van Dam; another is
|
||||
*Procedural Elements of Computer Graphics*, by David F. Rogers. Read and
|
||||
understand either of these books, and you’ll know everything you need
|
||||
understand either of these books, and you'll know everything you need
|
||||
for world-class clipping.
|
||||
|
||||
And, as you read, you might take a moment to consider how wonderful it
|
||||
is that anyone who’s interested can tap into so much expert knowledge
|
||||
is that anyone who's interested can tap into so much expert knowledge
|
||||
for the price of a book—or, on the Internet, for free—with no strings
|
||||
attached. Our part of the world is a pretty good place right now, isn’t
|
||||
attached. Our part of the world is a pretty good place right now, isn't
|
||||
it?
|
||||
|
||||
------------------------ --------------------------------- --------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue