Strip comments and inline ids onto h*

This commit is contained in:
James Gregory 2013-12-30 15:11:04 +11:00
commit 0f5f617adb
362 changed files with 2519 additions and 6694 deletions

View file

@ -10,16 +10,9 @@
<meta name="vspubdate" content="07/01/97" />
<meta name="vscategory" content="Web and Software Development: Game Development,Web and Software Development: Graphics and Multimedia Development" />
<title>Michael Abrash's Graphics Programming Black Book Special Edition: Pooh and the Space Station</title><!-- HEADER -->
<!-- Empty Reference Subhead -->
<!--ISBN=1576101746//-->
<!--TITLE=Michael Abrash's Graphics Programming Black Book Special Edition//-->
<!--AUTHOR=Michael Abrash//-->
<!--PUBLISHER=The Coriolis Group, Inc.//-->
<title>Michael Abrash's Graphics Programming Black Book Special Edition: Pooh and the Space Station</title>
<meta name="chapter" content="56" />
<meta name="pages" content="1053-1059" />
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
</head>
<body>
@ -37,7 +30,7 @@
<p><br /></p>
<h3><a id="Heading6"></a>Fast Texture Mapping: An Implementation</h3>
<h3 id="Heading6">Fast Texture Mapping: An Implementation</h3>
<p>As you might expect, I&rsquo;ve implemented DDA texture mapping in X-Sharp, and the changes are reflected in the X-Sharp archive in this chapter&rsquo;s subdirectory on the listings disk. Listing 56.1 shows the new header file entries, and Listing 56.2 shows the actual texture-mapped polygon drawer. The set-pixel routine that Listing 56.2 calls is a slight modification of the Mode X set-pixel routine from Chapter 47. In addition, INITBALL.C has been modified to create three texture-mapped polygons and define the texture bitmaps, and modifications have been made to allow the user to flip the axis of rotation. You will of course need the complete X-Sharp library to see texture mapping in action, but Listings 56.1 and 56.2 are the actual texture mapping code in its entirety.</p>
@ -49,7 +42,7 @@
</tr>
</table>
<p><b>LISTING 56.1 L56-1.C</b></p><!-- CODE //-->
<p><b>LISTING 56.1 L56-1.C</b></p>
<pre>
/* New header file entries related to texture-mapped polygons */
@ -95,9 +88,9 @@ typedef struct {
normal endpoint in VertNums) */
} Face;
extern void DrawTexturedPolygon(PointListHeader *, Point *, TextureMap *);
</pre><!-- END CODE //-->
</pre>
<p><b>LISTING 56.2 L56-2.C</b></p><!-- CODE //-->
<p><b>LISTING 56.2 L56-2.C</b></p>
<pre>
/* Draws a bitmap, mapped to a convex polygon (draws a texture-mapped polygon).
&ldquo;Convex&rdquo; means that every horizontal line drawn through the polygon at any
@ -351,7 +344,7 @@ void ScanOutLine(EdgeScan * LeftEdge, EdgeScan * RightEdge)
SourceY += SourceYStep;
}
}
</pre><!-- END CODE //-->
</pre>
<p>No matter how you slice it, DDA texture mapping beats boring, single-color polygons nine ways to Sunday. The big downside is that it&rsquo;s much slower than a normal polygon fill; move the ball close to the screen in DEMO1, and watch things slow down when one of those big texture maps comes around. Of course, that&rsquo;s partly because the code is all in C; some well-chosen optimizations would work wonders. In the next chapter we&rsquo;ll discuss texture mapping further, crank up the speed of our texture mapper, and attend to some rough spots that remain in the DDA texture mapping implementation, most notably in the area of exactly which texture pixels map to which destination pixels as a polygon rotates.</p>
@ -374,10 +367,6 @@ void ScanOutLine(EdgeScan * LeftEdge, EdgeScan * RightEdge)
<div align="center">
Graphics Programming Black Book &copy; 2001 Michael Abrash
</div><!-- all of the reference materials (books) have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->
<!-- reference_footer = subfoot -->
<!-- BEGIN SUB FOOTER -->
<!-- END FOOTER -->
</div>
</body>
</html>