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: Frames of Reference</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: Frames of Reference</title>
<meta name="chapter" content="61" />
<meta name="pages" content="1135-1138" />
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
</head>
<body>
@ -45,7 +38,7 @@
<p>For additional information, you might want to check out Foley &amp; van Dam&rsquo;s <i>Computer Graphics</i> (ISBN 0-201-12110-7), or the chapters in this book dealing with my X-Sharp 3-D graphics library.</p>
<h3><a id="Heading5"></a>The Dot Product</h3>
<h3 id="Heading5">The Dot Product</h3>
<p>Now we&rsquo;re ready to move on to the dot product. Given two vectors <b>U</b> = [u<sub>1</sub> u<sub>2</sub> u<sub>3</sub>] and <b>V</b> = [v<sub>1</sub> v<sub>2</sub> v<sub>3</sub>], their dot product, denoted by the symbol &bull;, is calculated as:</p>
@ -67,7 +60,7 @@
<p>where q is the angle between the two vectors, and the other two terms are the lengths of the vectors, as shown in Figure 61.1. Although it&rsquo;s not immediately obvious, equation 3 has a wide variety of applications in 3-D graphics.</p>
<h4 align="left"><a id="Heading6"></a>Dot Products of Unit Vectors</h4>
<h4 align="left" id="Heading6">Dot Products of Unit Vectors</h4>
<p>The simplest case of the dot product is when both vectors are <i>unit vectors</i>; that is, when their lengths are both one, as calculated as in Equation 1. In this case, equation 3 simplifies to:</p>
@ -87,9 +80,8 @@
<p align="right">(eq. 5)</p>
<p><a id="Fig1"><!-- </A><A HREF="javascript:displayWindow('images/61-01.jpg',406,234 )"> --><img src="images/61-01.jpg" /><br />
<!-- </A>
<BR><A HREF="javascript:displayWindow('images/61-01.jpg',406,234)"> --><b>Figure 61.1</b></a>&nbsp;&nbsp;<i>The dot product.</i></p>
<p><a id="Fig1"><img src="images/61-01.jpg" /><br />
<b>Figure 61.1</b></a>&nbsp;&nbsp;<i>The dot product.</i></p>
<p>where <b>I</b><sub>s</sub> is the intensity of illumination of the surface, <b>I</b><sub>l</sub> is the intensity of the light, and q is the angle between <b>-D</b><sub>l</sub> (where <b>D</b><sub>l</sub> is the light direction vector) and the surface normal. If the inverse light vector and the surface normal are both unit vectors, then this calculation can be performed with four multiplies and three additions&mdash;and no explicit cosine calculations&mdash;as</p>
@ -101,15 +93,14 @@
<p>where <b>N</b><sub>s</sub> is the surface unit normal and <b>D</b><sub>l</sub> is the light unit direction vector, as shown in Figure 61.2.</p>
<h3><a id="Heading7"></a>Cross Products and the Generation of Polygon Normals</h3>
<h3 id="Heading7">Cross Products and the Generation of Polygon Normals</h3>
<p>One question equation 6 begs is where the surface unit normal comes from. One approach is to store the end of a surface normal as an extra data point with each polygon (with the start being some point that&rsquo;s already in the polygon), and transform it along with the rest of the points. This has the advantage that if the normal starts out as a unit normal, it will end up that way too, if only rotations and translations (but not scaling and shears) are performed.</p>
<p>The problem with having an explicit normal is that it will remain a normal&mdash;that is, perpendicular to the surface&mdash;only through viewspace. Rotation, translation, and scaling preserve right angles, which is why normals are still normals in viewspace, but perspective projection does not preserve angles, so vectors that were surface normals in viewspace are no longer normals in screenspace.</p>
<p><a id="Fig2"><!-- </A><A HREF="javascript:displayWindow('images/61-02.jpg',406,158 )"> --><img src="images/61-02.jpg" /><br />
<!-- </A>
<BR><A HREF="javascript:displayWindow('images/61-02.jpg',406,158)"> --><b>Figure 61.2</b></a>&nbsp;&nbsp;<i>The dot product as used in calculating lighting intensity.</i></p>
<p><a id="Fig2"><img src="images/61-02.jpg" /><br />
<b>Figure 61.2</b></a>&nbsp;&nbsp;<i>The dot product as used in calculating lighting intensity.</i></p>
<p><br /></p>
@ -128,10 +119,6 @@
<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>