Replace invalid characters with HTML entities

— with —
’ with ’
+ with +
× with x
ç with ç
“ with “
” with ”
‘ with ‘
• with •
– with -
µ with µ
† with †
Fix C++
θ with θ
Yen symbol instead of times
Fix broken apos
Bullet again
E-circumflex
This commit is contained in:
James Gregory 2013-12-30 12:50:32 +11:00
commit 500e7f5654
353 changed files with 5091 additions and 5091 deletions

View file

@ -43,7 +43,7 @@
perspective projects them to screen space and maps them to screen coordinates,
storing the results in the object. */
#include &ltmath.h&gt
#include “polygon.h”/
#include “polygon.h”/
void XformAndProjectPoints(double Xform[4][4],
struct Object * ObjectToXform)
@ -54,8 +54,8 @@ void XformAndProjectPoints(double Xform[4][4],
struct Point3 * ProjectedPoints = ObjectToXform-&gtProjectedVertexList;
struct Point * ScreenPoints = ObjectToXform-&gtScreenVertexList;
for (i=0; i&ltNumPoints; i++, Points++, XformedPoints++,
ProjectedPoints++, ScreenPoints++) {
for (i=0; i&ltNumPoints; i++, Points++, XformedPoints++,
ProjectedPoints++, ScreenPoints++) {
/* Transform to view space */
XformVec(Xform, (double *)Points, (double *)XformedPoints);
/* Perspective-project to screen space */
@ -68,8 +68,8 @@ void XformAndProjectPoints(double Xform[4][4],
flip from increasing Y being up to increasing Y being down,
as expected by the polygon filler. Add in half the screen
width and height to center on the screen. */
ScreenPoints-&gtX = ((int) floor(ProjectedPoints-&gtX + 0.5)) + SCREEN_WIDTH/2;
ScreenPoints-&gtY = (-((int) floor(ProjectedPoints-&gtY + 0.5))) +
ScreenPoints-&gtX = ((int) floor(ProjectedPoints-&gtX + 0.5)) + SCREEN_WIDTH/2;
ScreenPoints-&gtY = (-((int) floor(ProjectedPoints-&gtY + 0.5))) +
SCREEN_HEIGHT/2;
}
}
@ -81,7 +81,7 @@ void XformAndProjectPoints(double Xform[4][4],
/* Draws all visible faces (faces pointing toward the viewer) in the specified
object. The object must have previously been transformed and projected, so
that the ScreenVertexList array is filled in. */
#include “polygon.h”
#include “polygon.h”
void DrawVisibleFaces(struct Object * ObjectToXform)
{
@ -94,11 +94,11 @@ void DrawVisibleFaces(struct Object * ObjectToXform)
struct PointListHeader Polygon;
/* Draw each visible face (polygon) of the object in turn */
for (i=0; i&ltNumFaces; i++, FacePtr++) {
for (i=0; i&ltNumFaces; i++, FacePtr++) {
NumVertices = FacePtr-&gtNumVerts;
/* Copy over the face’s vertices from the vertex list */
for (j=0, VertNumsPtr=FacePtr-&gtVertNums; j&ltNumVertices; j++)
Vertices[j] = ScreenPoints[*VertNumsPtr++];
/* Copy over the face’s vertices from the vertex list */
for (j=0, VertNumsPtr=FacePtr-&gtVertNums; j&ltNumVertices; j++)
Vertices[j] = ScreenPoints[*VertNumsPtr++];
/* Draw only if outside face showing (if the normal to the
polygon points toward the viewer; that is, has a positive
Z component) */
@ -110,7 +110,7 @@ void DrawVisibleFaces(struct Object * ObjectToXform)
/* It is facing the screen, so draw */
/* Appropriately adjust the extent of the rectangle used to
erase this page later */
for (j=0; j&ltNumVertices; j++) {
for (j=0; j&ltNumVertices; j++) {
if (Vertices[j].X &gt EraseRect[NonDisplayedPage].Right)
if (Vertices[j].X &lt SCREEN_WIDTH)
EraseRect[NonDisplayedPage].Right = Vertices[j].X;
@ -141,7 +141,7 @@ void DrawVisibleFaces(struct Object * ObjectToXform)
<P><A NAME="Fig3"><!-- </A><A HREF="javascript:displayWindow('images/51-03.jpg',405,203 )"> --><IMG SRC="images/51-03.jpg"><BR><!-- </A>
<BR><A HREF="javascript:displayWindow('images/51-03.jpg',405,203)"> --><FONT COLOR="#000077"><B>Figure 51.3</B></FONT></A>&nbsp;&nbsp;<I>Sample screens from the 3-D cube program.</I>
</P>
<P>The demo involves six polygons, one for each side of the cube. Each of the polygons must be transformed and projected, so it would seem that 24 vertices (four for each polygon) must be handled, but some steps have been taken to improve performance. All vertices for the object have been stored in a single list; the definition of each face contains not the vertices for that face themselves, but rather indexes into the object&#146;s vertex list, as shown in Figure 51.4. This reduces the number of vertices to be manipulated from 24 to 8, for there are, after all, only eight vertices in a cube, with three faces sharing each vertex. In this way, the transformation burden is lightened by two-thirds. Also, as mentioned earlier, backface removal is performed with integers, in screen coordinates, rather than with floating-point values in screen space. Finally, the <B>RecalcXForm</B> flag is set whenever the user changes the object-to-world transformation. Only when this flag is set is the full object-to-view transformation recalculated and the object&#146;s vertices transformed and projected again; otherwise, the values already stored within the object are reused. In the sample application, this brings no visual improvement, because there&#146;s only the one object, but the underlying mechanism is sound: In a full-blown 3-D animation application, with multiple objects moving about the screen, it would help a great deal to flag which of the objects had moved with respect to the viewer, performing a new transformation and projection only for those that had.</P>
<P>The demo involves six polygons, one for each side of the cube. Each of the polygons must be transformed and projected, so it would seem that 24 vertices (four for each polygon) must be handled, but some steps have been taken to improve performance. All vertices for the object have been stored in a single list; the definition of each face contains not the vertices for that face themselves, but rather indexes into the object&rsquo;s vertex list, as shown in Figure 51.4. This reduces the number of vertices to be manipulated from 24 to 8, for there are, after all, only eight vertices in a cube, with three faces sharing each vertex. In this way, the transformation burden is lightened by two-thirds. Also, as mentioned earlier, backface removal is performed with integers, in screen coordinates, rather than with floating-point values in screen space. Finally, the <B>RecalcXForm</B> flag is set whenever the user changes the object-to-world transformation. Only when this flag is set is the full object-to-view transformation recalculated and the object&rsquo;s vertices transformed and projected again; otherwise, the values already stored within the object are reused. In the sample application, this brings no visual improvement, because there&rsquo;s only the one object, but the underlying mechanism is sound: In a full-blown 3-D animation application, with multiple objects moving about the screen, it would help a great deal to flag which of the objects had moved with respect to the viewer, performing a new transformation and projection only for those that had.</P>
<P><A NAME="Fig4"><!-- </A><A HREF="javascript:displayWindow('images/51-04.jpg',407,308 )"> --><IMG SRC="images/51-04.jpg"><BR><!-- </A>
<BR><A HREF="javascript:displayWindow('images/51-04.jpg',407,308)"> --><FONT COLOR="#000077"><B>Figure 51.4</B></FONT></A>&nbsp;&nbsp;<I>The object data structure</I>
<P><BR></P>