Remove colour attributes from body and strip most of the font tags out

This commit is contained in:
James Gregory 2013-12-30 13:57:02 +11:00
commit c1f88ddb41
362 changed files with 1632 additions and 1706 deletions

View file

@ -24,7 +24,7 @@
<!--CHAPTER=54//-->
<!--PAGES=1027-1029//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//--></HEAD><BODY LINK=#0000FF ALINK=#000099 VLINK=#0000FF BGCOLOR=#FFFFFF>
<!--UNASSIGNED2//--></HEAD><body>
<CENTER>
<TABLE BORDER>
@ -36,14 +36,14 @@
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading7"></A><FONT COLOR="#000077">Shading: Implementation Details</FONT></H4>
<H4 ALIGN="LEFT"><A NAME="Heading7"></A>Shading: Implementation Details</H4>
<P>In order to calculate the cosine of the angle between an incoming light source and a polygon&rsquo;s unit normal, we must first have the polygon&rsquo;s unit normal. This could be calculated by generating a cross-product on two polygon edges to generate a normal, then calculating the normal&rsquo;s length and scaling to produce a unit normal. Unfortunately, that would require taking a square root, so it&rsquo;s not a desirable course of action. Instead, I&rsquo;ve made a change to X-Sharp&rsquo;s polygon format. Now, the first vertex in a shaded polygon&rsquo;s vertex list is the end-point of a unit normal that starts at the second point in the polygon&rsquo;s vertex list, as shown in Figure 54.3. The first point isn&rsquo;t one of the polygon&rsquo;s vertices, but is used only to generate a unit normal. The second point, however, is a polygon vertex. Calculating the difference vector between the first and second points yields the polygon&rsquo;s unit normal. Adding a unit-normal endpoint to each polygon isn&rsquo;t free; each of those end-points has to be transformed, along with the rest of the vertices, and that takes time. Still, it&rsquo;s faster than calculating a unit normal for each polygon from scratch.
</P>
<P><A NAME="Fig3"><!-- </A><A HREF="javascript:displayWindow('images/54-03.jpg',409,134 )"> --><IMG SRC="images/54-03.jpg"><BR><!-- </A>
<BR><A HREF="javascript:displayWindow('images/54-03.jpg',409,134)"> --><FONT COLOR="#000077"><B>Figure 54.3</B></FONT></A>&nbsp;&nbsp;<I>The unit normal in the polygon data structure.</I>
<BR><A HREF="javascript:displayWindow('images/54-03.jpg',409,134)"> --><B>Figure 54.3</B></A>&nbsp;&nbsp;<I>The unit normal in the polygon data structure.</I>
</P>
<P><A NAME="Fig4"><!-- </A><A HREF="javascript:displayWindow('images/54-04.jpg',408,142 )"> --><IMG SRC="images/54-04.jpg"><BR><!-- </A>
<BR><A HREF="javascript:displayWindow('images/54-04.jpg',408,142)"> --><FONT COLOR="#000077"><B>Figure 54.4</B></FONT></A>&nbsp;&nbsp;<I>The reversed light source vector.</I>
<BR><A HREF="javascript:displayWindow('images/54-04.jpg',408,142)"> --><B>Figure 54.4</B></A>&nbsp;&nbsp;<I>The reversed light source vector.</I>
</P>
<P>We also need a unit vector for each directed light source. The directed light sources I&rsquo;ve implemented in X-Sharp are spotlights; that is, they&rsquo;re considered to be point light sources that are infinitely far away. This allows the simplifying assumption that all light rays from a spotlight are parallel and of equal intensity throughout the displayed universe, so each spotlight can be represented with a single unit vector and a single intensity. The only trick is that in order to calculate the desired cos(theta) between the polygon unit normal and a spotlight&rsquo;s unit vector, the direction of the spotlight&rsquo;s unit vector must be reversed, as shown in Figure 54.4. This is necessary because the dot product implicitly places vectors with their start points at the same location when it&rsquo;s used to calculate the cosine of the angle between two vectors. The light vector is incoming to the polygon surface, and the unit normal is outbound, so only by reversing one vector or the other will we get the cosine of the desired angle.
</P>
@ -60,7 +60,7 @@
<hr width="90%" size="1" noshade>
<div align="center">
<font face="Verdana,sans-serif" size="1">Graphics Programming Black Book &copy; 2001 Michael Abrash</font>
Graphics Programming Black Book &copy; 2001 Michael Abrash
</div>
<!-- all of the reference materials (books) have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->