home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / graphics / 13697 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  7.2 KB

  1. Path: sparky!uunet!psinntp!eye!erich
  2. From: erich@eye.com (Eric Haines)
  3. Newsgroups: comp.graphics
  4. Subject: Graphics Gems III errata
  5. Message-ID: <1993Jan12.153702.28762@eye.com>
  6. Date: Tue, 12 Jan 93 20:37:02 GMT
  7. Summary: errata, new code available
  8. Sender: erich@eye.com (Eric Haines)
  9. Organization: 3D/EYE, Inc.  Ithaca, NY
  10. Lines: 200
  11.  
  12. Attached is an errata listing for the book _Graphics Gems III_.  There is only
  13. one (known by me) error in the text itself.  All of the cod errors (most of
  14. which are very minor) have been incorporated into the online code at
  15. princeton.edu:pub/Graphics/GraphicsGems/GemsIII.  Let me know of any errors
  16. you run into in any of the Gems books.
  17.  
  18. Eric Haines
  19.  
  20.  
  21. Errata to _Graphics Gems III_, first edition, edited by David Kirk
  22. (dk@egg.gg.caltech.edu), Academic Press 1992.  Code available online in
  23. princeton.edu:pub/Graphics/GraphicsGems/GemsIII.
  24.  
  25. compiled by Eric Haines (erich@eye.com) from author and reader contributions
  26.  
  27. version 1.0
  28. date:  12/14/92
  29.  
  30. -----
  31.  
  32. Errors in the text:
  33.  
  34. p. 285, third paragraph, first sentence:  change "with the complement of the
  35.     residency mask" to "with the residency mask".
  36.  
  37. -----
  38.  
  39. The following are errors in the code listings (corrected in the online code at
  40. princeton.edu:pub/Graphics/GraphicsGems/GemsII).  Note that many of the code
  41. listings online are different in minor and major ways from the code in the
  42. book (see Addenda, at the end, for new code not in the book).
  43.  
  44.  
  45. Serious errors (ones your compiler cannot or may not catch):
  46.  
  47. p. 425-427:  bitbuf is used before being set; initialized bitbuf = 0 before
  48.     use in the three scale_bitmap_* routines.
  49.  
  50. p. 474:  the variable "rho" is not used, delete it.
  51. p. 477, next to last two lines:  call sq_ellipsoid_tensor with five "1."'s and
  52.     sq_toroid_tensor with six "1."'s.
  53.  
  54. p. 498, lines 53-54:  put "&" in front of a1,b1,c1 and a2,b2,c2.
  55. p. 499, lines 27-28:  put "&" in front of xa,ya and xb,yb.
  56.  
  57. p. 547, beginning:  add line "#include <math.h>"
  58.  
  59. p. 570, line 49:  change to "major = V3New(0.0, 0.0, 1.0);"
  60.  
  61. p. 580, line 19:  change "f+= acos(VDOT(s, t)) * VDOT(sxt, Ns);" to
  62.     "f+= acos(VDOT(s, t)) * VDOT(sxt, Nr);", i.e. "Ns" becomes "Nr".
  63.     "Ns" can be removed from the list of calling parameters for
  64.     "computeUnoccludedFormFactor()".
  65.  
  66. p. 606, beginning:  add "#include <string.h>"
  67.  
  68. -----
  69.  
  70. Syntax errors (ones that are not usually harmful, or are easily caught):
  71.  
  72. p. 396-404, throughout:  replace "};" with "}" to make lint happy
  73. p. 402, gcd():  the variable "k" is set but not used - remove it
  74.  
  75. p. 411, top:  for ANSI compatibility, add procedure declarations:
  76.     void RectStretch(long xs1,long ys1,long xs2,long ys2,long xd1,long yd1,
  77.         long xd2,long yd2) ;
  78.     void Stretch(long x1,long x2,long y1,long y2,long yr,long yw) ;
  79.     void CircleStretch(long SBMINX,long SBMAXX,long xc,long yc,long r) ;
  80.     void Stretch2Lines(long x1,long x2,long y1,long y2,long yr1,long yw1,
  81.         long yr2,long yw2) ;
  82.  
  83. p. 411-413:  cast expressions inside "abs()" calls to type "(int)".
  84.  
  85. p. 414-424:  replace "ceiling" with "ceil" (on some machines)
  86. p. 416, lines 18-19:  remove "char *p;" and "int width, height;" declarations;
  87.     unused.
  88. p. 420-421:  replace "(*filter)" with "(*filterf)" to avoid redeclaration of
  89.     "filter".
  90. p. 423, line 23:  remove "register char *p;" declaration; unused.
  91.  
  92. p. 425, line 33 and p. 426, line 51:  remove declaration of "i", as it is
  93.     unused.
  94.  
  95. p. 427, line 29:  remove declarations for "*p" and "*q"; unused.
  96.  
  97. p. 428, line 35:  remove declarations for "i" and "j"; unused.
  98.  
  99. p. 441, line 37:  remove "nx" declaration; unused.
  100. p. 443, line 2:  remove "xl, xr, yt, yb" declarations; unused.
  101. p. 443, lines 3-4:  remove "k" and "ptb" declarations; unused.
  102.  
  103. p. 472, line 19:  remove "result" declaration; unused.
  104. p. 474, lines 17-18:  remove "iworld" and "R" declarations; unused.
  105. p. 477, line 32:  remove "x" declaration; unused.
  106. p. 476-477:  note that sqellipsoidposn() and sqtoroidposn() are not
  107.     particularly useful in their current forms; they do not return any
  108.     values, e.g. x,y,z are computed but not returned.
  109.  
  110. p. 489, line 50:  cast "intsct" to "(void *)" to make lint happy.
  111.  
  112. p. 496, line 10:  remove global "r, p1, p2, p3, p4" declarations.
  113. p. 496, line 10 and p. 499, throughout:  change "v1" to "gv1" and "v1" to
  114.     "gv2".
  115. p. 497, line 31:  remove "xt" and "yt" declarations; unused.
  116. p. 498, line 27:  remove "t" and "u" declarations; unused.
  117.  
  118. p. 500, line 25:  remove "temp" declaration; unused.
  119. p. 500, line 26:  remove "x3lo,x3hi" and "y3lo,y3hi" declarations; unused.
  120.  
  121. p. 513, line 17:  add the declarations for the static routines:
  122.     static void computePlaneEq() ;
  123.     static Node *insertPlaneEq() ;
  124.     static int comparePlaneEqs() ;
  125.  
  126. p. 522, line 5:  remove "vect23, vect31" declarations; unused.
  127.  
  128. p. 543, line 45:  change "malloc" to "(StackPtr)malloc"
  129. p. 544, line 54:  change "malloc" to "(BinNodePtr)malloc"
  130. p. 546, line 17:  change "malloc" to "(BinNodePtr)malloc"
  131.  
  132. p. 551-554:  Note that this code uses definitions and subroutines that are
  133.     found in Rayshade.  Most are easy enough to understand and code (or
  134.     use Steve Hollasch's vector macros on pages 405-407).
  135.  
  136. p. 559, line 22:  remove "tmp" declaration; unused.
  137.  
  138. p. 570, line 9:  remove "j" declaration; unused.
  139. p. 572, line 18:  remove "a, b, c" and "x1, y1, z1" declarations; unused (i.e.
  140.     replace line with "double d;".
  141. p. 573, lines 15 and 28:  remove "i" declarations; unused.
  142.  
  143. p. 577, line 12:  add the declarations for the static routines:
  144.     static float computeFormFactor() ;
  145.     static float computeUnoccludedFormFactor() ;
  146.     static void splitQuad() ;
  147.     static float quadArea() ;
  148.  
  149. p. 579, last line:  remove "j" declaration, as "j" is not used.
  150.  
  151. p. 607, line 40:  change to "memset((void *)acc, ..." to make lint happy.
  152.  
  153. -----
  154.  
  155. The following are typographical errors in the comments:
  156.  
  157. p. 429, line 24:  change "varables" to "variables"
  158.  
  159. p. 443, line 54:  change "seqment" to "segment"
  160.  
  161. p. 454, line 3:  change "architechture" to "architecture"
  162.  
  163. p. 458, line 21:  change "consistancy" to "consistency"
  164.  
  165. p. 484, line 46:  change "Inplementation" to "Implementation"
  166.  
  167. p. 493, lines 20 and 23:  change "subsegements" to "subsegments"
  168.  
  169. p. 539, line 18:  change "upto" to "up to"
  170.  
  171. p. 550, line 6:  change "parrallel" to "parallel"
  172.  
  173. p. 556, line 48:  change "miminum" to "minimum"
  174.  
  175. p. 572, line 7:  change "homogenous" to "homogeneous"
  176.  
  177. p. 578, line 15:  change "visiblity" to "visibility"
  178.  
  179. p. 606, line 32:  change "initialzed" to "initialized"
  180.  
  181. -----
  182.  
  183. Addenda:
  184.  
  185. There is test software (not in the text) for the "Fast n-Dimensional Extent
  186. Overlap Testing" (exthit), "Accurate Polygon Scan Conversion Using Half-Open
  187. Intervals" (accurate_scan), and "Partitioning a 3-D Convex Polygon with an
  188. Arbitrary Plane" (partition3d).
  189.  
  190. There is C code for Badouel and Wurthrich's Gem II.9 (ndline.c) in the code
  191. distribution (but not in the text).
  192.  
  193. There is more explanatory C code for Woo's Gem VII.1 in the code distribution.
  194.  
  195. Here is a little additional explanation to the "Use of Residency Masks..."
  196. gem on p. 284-287 from Joe Cychosz (note errata correction above):
  197.  
  198.     The process goes something like this:
  199.  
  200.     ray_mask = 0
  201.  
  202.     foreach (cell the ray passes through) {
  203.         foreach (object in the cell) {
  204.         if  (ray_mask & object_mask == 0) {
  205.             compute the ray-object intersection
  206.         }
  207.         }
  208.         update ray_mask marking for cell
  209.     }
  210.  
  211.     The important thing here is to mark the cell after it is processed.
  212.