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=61//-->
<!--PAGES=1141-1144//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//--></HEAD><BODY LINK=#0000FF ALINK=#000099 VLINK=#0000FF BGCOLOR=#FFFFFF>
<!--UNASSIGNED2//--></HEAD><body>
<CENTER>
<TABLE BORDER>
@ -37,14 +37,14 @@
</CENTER>
<P><BR></P>
</P>
<H3><A NAME="Heading9"></A><FONT COLOR="#000077">Using the Dot Product for Projection</FONT></H3>
<H3><A NAME="Heading9"></A>Using the Dot Product for Projection</H3>
<P>Consider Equation 3 again, but this time make one of the vectors, say <B>V</B>, a unit vector. Now the equation reduces to:</P>
<P ALIGN="LEFT"><P ALIGN="CENTER"><IMG SRC="images/61-08d.jpg"></P>
</P>
<P ALIGN="RIGHT">(eq. 8)</P>
<P>In other words, the result is the cosine of the angle between the two vectors, scaled by the magnitude of the non-unit vector. Now, consider that cosine is really just the length of the adjacent leg of a right triangle, and think of the non-unit vector as the hypotenuse of a right triangle, and remember that all sides of similar triangles scale equally. What it all works out to is that the value of the dot product of any vector with a unit vector is the length of the first vector projected onto the unit vector, as shown in Figure 61.6.</P>
<P><A NAME="Fig6"><!-- </A><A HREF="javascript:displayWindow('images/61-06.jpg',408,163 )"> --><IMG SRC="images/61-06.jpg"><BR><!-- </A>
<BR><A HREF="javascript:displayWindow('images/61-06.jpg',408,163)"> --><FONT COLOR="#000077"><B>Figure 61.6</B></FONT></A>&nbsp;&nbsp;<I>How the dot product with a unit vector performs a projection.</I>
<BR><A HREF="javascript:displayWindow('images/61-06.jpg',408,163)"> --><B>Figure 61.6</B></A>&nbsp;&nbsp;<I>How the dot product with a unit vector performs a projection.</I>
</P>
<P>This unlocks all sorts of neat stuff. Want to know the distance from a point to a plane? Just dot the vector from the point <B>P</B> to the plane origin <B>O</B><SUB>p</SUB> with the plane unit normal <B>N</B><SUB>p</SUB>, to project the vector onto the normal, then take the absolute value</P>
<!-- CODE SNIP //-->
@ -89,11 +89,11 @@ void LineIntersectPlane (float *linestart, float *lineend,
}
</PRE>
<!-- END CODE //-->
<H3><A NAME="Heading10"></A><FONT COLOR="#000077">Rotation by Projection</FONT></H3>
<H3><A NAME="Heading10"></A>Rotation by Projection</H3>
<P>We can use the dot product&rsquo;s projection capability to look at rotation in an interesting way. Typically, rotations are represented by matrices. This is certainly a workable representation that encapsulates all aspects of transformation in a single object, and is ideal for concatenations of rotations and translations. One problem with matrices, though, is that many people, myself included, have a hard time looking at a matrix of sines and cosines and visualizing what&rsquo;s actually going on. So when two 3-D experts, John Carmack and Billy Zelsnack, mentioned that they think of rotation differently, in a way that seemed more intuitive to me, I thought it was worth passing on.
</P>
<P><A NAME="Fig7"><!-- </A><A HREF="javascript:displayWindow('images/61-07.jpg',406,222 )"> --><IMG SRC="images/61-07.jpg"><BR><!-- </A>
<BR><A HREF="javascript:displayWindow('images/61-07.jpg',406,222)"> --><FONT COLOR="#000077"><B>Figure 61.7</B></FONT></A>&nbsp;&nbsp;<I>Using the dot product to get the distance from a point to a plane.</I>
<BR><A HREF="javascript:displayWindow('images/61-07.jpg',406,222)"> --><B>Figure 61.7</B></A>&nbsp;&nbsp;<I>Using the dot product to get the distance from a point to a plane.</I>
</P>
<P>Their approach is this: Think of rotation as projecting coordinates onto new axes. That is, given that you have points in, say, worldspace, define the new coordinate space (viewspace, for example) you want to rotate to by a set of three orthogonal unit vectors defining the new axes, and then project each point onto each of the three axes to get the coordinates in the new coordinate space, as shown for the 2-D case in Figure 61.8. In 3-D, this involves three dot products per point, one to project the point onto each axis. Translation can be done separately from rotation by simple addition.
</P>
@ -102,7 +102,7 @@ void LineIntersectPlane (float *linestart, float *lineend,
<P>Three things I&rsquo;ve learned over the years are that it never hurts to learn a new way of looking at things, that it helps to have a clearer, more intuitive model in your head of whatever it is you&rsquo;re working on, and that new tools, or new ways to use old tools, are Good Things. My experience has been that rotation by projection, and dot product tricks in general, offer those sorts of benefits for 3-D.
</P>
<P><A NAME="Fig8"><!-- </A><A HREF="javascript:displayWindow('images/61-08.jpg',407,198 )"> --><IMG SRC="images/61-08.jpg"><BR><!-- </A>
<BR><A HREF="javascript:displayWindow('images/61-08.jpg',407,198)"> --><FONT COLOR="#000077"><B>Figure 61.8</B></FONT></A>&nbsp;&nbsp;<I>Rotation to a new coordinate space by projection onto new axes.</I>
<BR><A HREF="javascript:displayWindow('images/61-08.jpg',407,198)"> --><B>Figure 61.8</B></A>&nbsp;&nbsp;<I>Rotation to a new coordinate space by projection onto new axes.</I>
<P><BR></P>
<CENTER>
<TABLE BORDER>
@ -116,7 +116,7 @@ void LineIntersectPlane (float *linestart, float *lineend,
<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 -->