Normal quotes
This commit is contained in:
parent
5e10794a24
commit
18011c595a
352 changed files with 6040 additions and 6040 deletions
32
53-01.md
32
53-01.md
|
|
@ -8,22 +8,22 @@ Chapter 53\
|
|||
|
||||
### The Naked Truth About Speed in 3-D Animation {#Heading2}
|
||||
|
||||
Years ago, this friend of mine—let’s call him Bert—went to Hawaii with
|
||||
Years ago, this friend of mine—let's call him Bert—went to Hawaii with
|
||||
three other fellows to celebrate their graduation from high school. This
|
||||
was an unchaperoned trip, and they behaved pretty much as responsibly as
|
||||
you’d expect four teenagers to behave, which is to say, not; there’s a
|
||||
story about a rental car that, to this day, Bert can’t bring himself to
|
||||
you'd expect four teenagers to behave, which is to say, not; there's a
|
||||
story about a rental car that, to this day, Bert can't bring himself to
|
||||
tell. They had a good time, though, save for one thing: no girls.
|
||||
|
||||
By and by, they met a group of girls by the pool, but the boys couldn’t
|
||||
By and by, they met a group of girls by the pool, but the boys couldn't
|
||||
get past the hi-howya-doin stage, so they retired to their hotel room to
|
||||
plot a better approach. This being the early ’70s, and them being
|
||||
plot a better approach. This being the early '70s, and them being
|
||||
slightly tipsy teenagers with raging hormones and the effective combined
|
||||
IQ of four eggplants, it took them no time at all to come up with a
|
||||
brilliant plan: streaking. The girls had mentioned their room number, so
|
||||
the boys piled into the elevator, pushed the button for the girls’
|
||||
the boys piled into the elevator, pushed the button for the girls'
|
||||
floor, shucked their clothes as fast as they could, and sprinted to the
|
||||
girls’ door. They knocked on the door and ran on down the hall. As the
|
||||
girls' door. They knocked on the door and ran on down the hall. As the
|
||||
girls opened their door, Bert and his crew raced past, toward the
|
||||
elevator, laughing hysterically.
|
||||
|
||||
|
|
@ -38,11 +38,11 @@ laughter, tears streaming down his face. The universe had blessed him
|
|||
with one of those exceedingly rare moments of perfect timing and
|
||||
execution.
|
||||
|
||||
The universe wasn’t done with Bert quite yet, though. He was still
|
||||
The universe wasn't done with Bert quite yet, though. He was still
|
||||
contorted with laughter—and still quite thoroughly undressed—when the
|
||||
elevator doors opened again. On the lobby.
|
||||
|
||||
And with that, we come to this chapter’s topics: raw speed and hidden
|
||||
And with that, we come to this chapter's topics: raw speed and hidden
|
||||
surfaces.
|
||||
|
||||
### Raw Speed, Part 1: Assembly Language {#Heading3}
|
||||
|
|
@ -56,27 +56,27 @@ the user wants fast response. And, in the course of pursuing
|
|||
performance, there are times when a little assembly language goes a long
|
||||
way.
|
||||
|
||||
We’re now four chapters into development of the X-Sharp 3-D animation
|
||||
We're now four chapters into development of the X-Sharp 3-D animation
|
||||
package. In realtime animation, performance is *sine qua non* (Latin for
|
||||
“Make it fast or find another line of work”), so some judiciously
|
||||
"Make it fast or find another line of work"), so some judiciously
|
||||
applied assembly language is in order. In the previous chapter, we got
|
||||
up to a serviceable performance level by switching to fixed-point math,
|
||||
then implementing the fixed-point multiplication and division functions
|
||||
in assembly in order to take advantage of the 386’s 32-bit capabilities.
|
||||
There’s another area of the program that fairly cries out for assembly
|
||||
in assembly in order to take advantage of the 386's 32-bit capabilities.
|
||||
There's another area of the program that fairly cries out for assembly
|
||||
language: matrix math. The function to multiply a matrix by a vector
|
||||
(**XformVec()**) and the function to concatenate matrices
|
||||
(**ConcatXforms()**) both loop heavily around calls to **FixedMul();** a
|
||||
lot of calling and looping can be eliminated by converting these
|
||||
functions to pure assembly language.
|
||||
|
||||
Listing 53.1 is the module FIXED.ASM from this chapter’s iteration of
|
||||
Listing 53.1 is the module FIXED.ASM from this chapter's iteration of
|
||||
X-Sharp, with **XformVec()** and **ConcatXforms()** implemented in
|
||||
assembly language. The code is heavily optimized, to the extent of
|
||||
completely unrolling the loops via macros so that looping is eliminated
|
||||
altogether. FIXED.ASM is highly effective; the time taken for matrix
|
||||
math is now down to the point where it’s a fairly minor component of
|
||||
execution time, representing less than ten percent of the total. It’s
|
||||
math is now down to the point where it's a fairly minor component of
|
||||
execution time, representing less than ten percent of the total. It's
|
||||
time to turn our optimization sights elsewhere.
|
||||
|
||||
------------------------ --------------------------------- --------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue