📄 errata.graphicsgems
字号:
Errata to _Graphics Gems_, first edition, edited by Andrew Glassner(andrew_glassner@yahoo.com), Academic Press 1990. Code available online athttp://www.graphicsgems.org/compiled by Eric Haines (erich@acm.org) from author and reader contributionsversion 1.27date: 7/5/2001-----Errors in the text:p. 3, bottom: The equation "N . P + c = 0" is better expressed as "N . P - c = 0" in order to match Figure 1a. [also see p. 9 errata]p. 5, V2 Perpendicular: change "N <- (-Vx, Vy)" to "N <- (-Vy, Vx)"p. 5, V2 Reflect: change "N <- (-Vy, -Vx)" to "N <- (-Vx, -Vy)"p. 6: change P1 and P2 lines to P1 <- (( -b+sqrt(d) ) / 2a) * lv + lu P2 <- (( -b-sqrt(d) ) / 2a) * lv + lu i.e. the value computed is multiplied by the direction vector and the line's origin is added to this new vector to get the intersection point.p. 9-10, starting at bottom: If the equation on p. 3 is expressed as "N . P - c = 0", then change all "+ c" references to "- c" and "l-sub-c" to "- l-sub-c".p. 10, for "if not l-normalized", the operation in the next line should divide q by "( l-sub-n dot l-sub-n)", not "Length( l-sub-n )".p. 11, bottom: change the lower bound of the sum (sigma) from i=1 to i=0.p. 16, Product Relations. In the right hand parts of the equations the cosine and sine functions should be applied only to the numerator, then the division by 2 is done. Specifically: sin(a)*sin(b) = cos(a-b)/2 - cos(a+b)/2 cos(a)*cos(b) = cos(a-b)/2 + cos(a+b)/2 sin(a)*cos(b) = sin(a+b)/2 + sin(a-b)/2p. 105, last sentence of first paragraph: "ajacent" to "adjacent".p. 216, caption for figure 2: "54" should read "45" to be consistent with the figure (error in two places in caption).p. 224, the Bit Width 23 mask is listed as 0x00400000, it should be 0x00420000.p. 282, 5 and 7 lines from bottom: should read "then PUSH(dadRx + 1, rx, pushlx, pushrx, y-dir, -dir )" and "then PUSH(lx, dadLx-1, pushlx, pushrx, y-dir, -dir )" i.e. the final "dir" should be "-dir".p. 283, 3 lines from bottom: add an "end" above the "else begin".p. 284, 12 lines down: move "x <- x + 1;" to after the next "end" statement (move it down only one line).p. 299, bottom: P1 and P2 as shown are actually the distances along the line from the line's origin (l.sub.U). Change the P1 and P2 lines to t1 = (-b + sqrt(d)) / 2a t2 = (-b - sqrt(d)) / 2a P1 <- l.sub.U + t1 * l.sub.V P2 <- l.sub.U + t2 * l.sub.Vp. 365, last line: "Kajia" to "Kajiya".p. 375, "revlect v" to "reflect v".p. 395, first paragraph: change "discussed by Haines (1989)" to "discussed by Haines in Glassner (1989)".p. 406, last equation: if q is negative, the same signs should be used for the square root terms, i.e. y^2 +- y sqrt(2z - p) + z +- sqrt(z^2 - r) = 0p. 448, last sentence of second paragraph: change "and now nearly as simple" to "and not nearly as simple".p. 463, second to last line: change "then alpha <- alpha + pi/2" to "then alpha <- pi - alpha".p. 479, Table 1: the number of Multiplies for rotation should be 16, not 12.p. 495, equation 5: this should have an equal sign (=) before the plus-or-minus (+/-).p. 499, middle of page: change "and i,j,K" to "and i,j,k".p. 503, last sentence: change "Let P' = Rot_(alpha, N) ..." to "Let P' = Rot_(theta, N) ...".p. 516, last paragraph: a reader notes an additional reference which predates Berger and Salmon & Slater, namely "The Viewing Transformation," Technical Memo. no. 84, Alvy Ray Smith, Computer Graphics Project, Lucasfilm, June 24, 1983 (rev. May 4, 1984).p. 602, second paragraph: the matrix Tij should be: [ 1 0 0 0 ] [ 0 1/2 0 0 ] [ 0 0 1/4 0 ] [ 0 0 0 1/8 ]p. 610: the binomial "( n-i [over] j )" should be "( n-1 [over] j )". This error appears on the fifth line of the long derivation and within the Zi,j definition.p. 614: the equation "Bi,n(t) = (1-t)Bi-1,n-1 + tBi-1,n-1(t)" should be "Bi,n(t) = (1-t)Bi,n-1(t) + tBi-1,n-1(t)"; the first right-hand side term had an incorrect subscript and was missing a "(t)".p. 809: the author of "Approximation of Sweep Surfaces by Tensor Product B-Splines" is M. (not J.) Bloomenthal. The author is correctly attributed in the text (page 569).p. 814: 5th line from bottom. "Knuth 1981" should read "Knuth 1981b" and "Vol. 2" should read "Vol. 1". The reference above this should be "Knuth 1981a".p. 820, 9th line from bottom: "D.P. Greenburg" should be "D.P. Greenberg".-----The following are errors in the code listings (corrected in the online code athttp://www.graphicsgems.org/).Serious errors (ones your compiler cannot or may not catch):p. 630: Delete FLOOR and CEILING macros (they're more like truncations). Change ROUND macro to (i.e. add parentheses around "a"): #define ROUND(a) ((a)>0 ? (int)((a)+0.5) : -(int)(0.5-(a))) Change SGN macro to (i.e. change positive condition result to "1"): #define SGN(a) (((a)<0) ? -1 : 1)p. 632: procedure declarations for routines in the "2D and 2D Vector C Library" (next pages) are missing from "GraphicsGems.h", e.g. double V2SquaredLength() ; double V2Length() ; Vector2 *V2Negate() ; ...p. 638, third line from bottom: in V3Combine change last "result->y" to "result->z"p. 640: V3MulPointByMatrix() does not work. A separate local Point3 (e.g. "Point3 q ;") should be used in place of "p" for assignment and then passed back.p. 649, top: add "#include <math.h>"p. 655, top: add the code: if ((px == qx) && (py == qy)) if ((tx == px) && (ty == py)) return 2; else return 0; in order to test for the special case where the line endpoints are the same.p. 656, line 23: change "return ((R->min.x * R->min.x) < Rad2);" to "return ((R->min.x * R->min.x + R->max.y * R->max.y) < Rad2);"p. 662, line 10: add "#include <math.h>"p. 665, line 1: change "FLOOR(...)" to "(floor((double)(...))".p. 663, line 45: change first "+" to "="; should read "VnextLeft = (Vleft=VnextLeft) + 1;"p. 667, line 6: change "POLY_NMAX 8" to "POLY_NMAX 10" (for triangles and quadrilaterals). Six clipping planes used on convex polygons gives +6 potential extra vertices generated.p. 670-673, throughout: change "int mask" declarations to "unsigned long mask" declarations. This avoids an infinite loop occuring when the highest bit is set.p. 676, line 11: add the line "up = (double *)u;"p. 671, line 1: add at top of page the following test (or make sure the Poly_vert structure has <= 32 doubles at compilation time): if (sizeof(Poly_vert)/sizeof(double) > 32) { fprintf(stderr, "Poly_vert structure too big; must be <=32 doubles\n"); exit(1); }p. 687, line 8: Identical points cause two points to be drawn. Between the first two plot() commands, add the line: if ( pixels_left < 0 ) return ;p. 714, line 20: the last "1" in "if (i + 1 < l * 1)" should be an "l"p. 716, line 27: missing "/" at end of comment (if not fixed, code compiles but is wrong)p. 720, lines 3 and 6 from bottom: change "m+1>>1" to "(m+1)>>1" to establish correct evaluation order.p. 737, lines 19-24, from "if ((quadrant..." to "}", should read (and note corrected indentations on "else" statement): if (coord[i] < minB[i] || coord[i] > maxB[i]) return (FALSE); } else { coord[i] = candidatePlane[i]; }p. 742, lines 18-24 should read:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -