Remove colour attributes from body and strip most of the font tags out
This commit is contained in:
parent
7e957c0bb4
commit
c1f88ddb41
362 changed files with 1632 additions and 1706 deletions
14
61-02.html
14
61-02.html
|
|
@ -24,7 +24,7 @@
|
|||
<!--CHAPTER=61//-->
|
||||
<!--PAGES=1135-1138//-->
|
||||
<!--UNASSIGNED1//-->
|
||||
<!--UNASSIGNED2//--></HEAD><BODY LINK=#0000FF ALINK=#000099 VLINK=#0000FF BGCOLOR=#FFFFFF>
|
||||
<!--UNASSIGNED2//--></HEAD><body>
|
||||
|
||||
<CENTER>
|
||||
<TABLE BORDER>
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
<P>For our purposes, <I>projection</I> is the process of mapping coordinates onto a line or surface. <I>Perspective projection</I> projects 3-D coordinates onto a viewplane, scaling coordinates according to their z distance from the viewpoint in order to provide proper perspective. <I>Objectspace</I> is the coordinate space in which an object is defined, independent of other objects and the world itself. <I>Worldspace</I> is the absolute frame of reference for a 3-D world; all objects’ locations and orientations are with respect to worldspace, and this is the frame of reference around which the viewpoint and view direction move. <I>Viewspace</I> is worldspace as seen from the viewpoint, looking in the view direction. <I>Screenspace</I> is viewspace after perspective projection and scaling to the screen.</P>
|
||||
<P>Finally, <I>transformation</I> is the process of converting points from one coordinate space into another; in our case, that’ll mean rotating and translating (moving) points from objectspace or worldspace to viewspace.</P>
|
||||
<P>For additional information, you might want to check out Foley & van Dam’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 NAME="Heading5"></A><FONT COLOR="#000077">The Dot Product</FONT></H3>
|
||||
<H3><A NAME="Heading5"></A>The Dot Product</H3>
|
||||
<P>Now we’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 •, is calculated as:</P>
|
||||
<P ALIGN="LEFT"><P ALIGN="CENTER"><IMG SRC="images/61-02d.jpg"></P>
|
||||
</P>
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
</P>
|
||||
<P ALIGN="RIGHT">(eq. 3)</P>
|
||||
<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’s not immediately obvious, equation 3 has a wide variety of applications in 3-D graphics.</P>
|
||||
<H4 ALIGN="LEFT"><A NAME="Heading6"></A><FONT COLOR="#000077">Dot Products of Unit Vectors</FONT></H4>
|
||||
<H4 ALIGN="LEFT"><A NAME="Heading6"></A>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>
|
||||
<P ALIGN="LEFT"><P ALIGN="CENTER"><IMG SRC="images/61-04d.jpg"></P>
|
||||
</P>
|
||||
|
|
@ -63,19 +63,19 @@
|
|||
</P>
|
||||
<P ALIGN="RIGHT">(eq. 5)</P>
|
||||
<P><A NAME="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)"> --><FONT COLOR="#000077"><B>Figure 61.1</B></FONT></A> <I>The dot product.</I>
|
||||
<BR><A HREF="javascript:displayWindow('images/61-01.jpg',406,234)"> --><B>Figure 61.1</B></A> <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—and no explicit cosine calculations—as</P>
|
||||
<P ALIGN="LEFT"><P ALIGN="CENTER"><IMG SRC="images/61-06d.jpg"></P>
|
||||
</P>
|
||||
<P ALIGN="RIGHT">(eq. 6)</P>
|
||||
<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 NAME="Heading7"></A><FONT COLOR="#000077">Cross Products and the Generation of Polygon Normals</FONT></H3>
|
||||
<H3><A NAME="Heading7"></A>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’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—that is, perpendicular to the surface—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 NAME="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)"> --><FONT COLOR="#000077"><B>Figure 61.2</B></FONT></A> <I>The dot product as used in calculating lighting intensity.</I>
|
||||
<BR><A HREF="javascript:displayWindow('images/61-02.jpg',406,158)"> --><B>Figure 61.2</B></A> <I>The dot product as used in calculating lighting intensity.</I>
|
||||
<P><BR></P>
|
||||
<CENTER>
|
||||
<TABLE BORDER>
|
||||
|
|
@ -89,7 +89,7 @@
|
|||
|
||||
<hr width="90%" size="1" noshade>
|
||||
<div align="center">
|
||||
<font face="Verdana,sans-serif" size="1">Graphics Programming Black Book © 2001 Michael Abrash</font>
|
||||
Graphics Programming Black Book © 2001 Michael Abrash
|
||||
</div>
|
||||
<!-- all of the reference materials (books) have the footer and subfoot reveresed -->
|
||||
<!-- reference_subfoot = footer -->
|
||||
|
|
|
|||
Loading…
Reference in a new issue