1. 程式人生 > >《計算機圖形學基礎(OpenGL版)》勘誤表

《計算機圖形學基礎(OpenGL版)》勘誤表

頁碼 行或位置 原內容 更正為 備註
38 9 (1MB) (128KB)
41 16 k=Δx/Δyk=\Delta x/\Delta y k=Δy/Δxk=\Delta y/\Delta x
43 9 d0d \leq 0 d0d \geq 0
46 6 st=sΔxΔy(xi+1)+2b+2yi1 s-t = s \frac{\Delta x}{\Delta y}(x_i+1)+2b+2y_i-1 st=sΔxΔy(xi+1)+2b2yi1 s-t = s \frac{\Delta x}{\Delta y}(x_i+1)+2b -2y_i-1
46 倒數第4行 110-1\leq1\leq0 0k10\leq k\leq 1
47 26 int curx = x1; int curx = x1 + 1;
48 12 b=x0x1b=x_0-x_1 b=x1x0b=x_1-x_0
51 19 TT點的座標為xi,yi)(x_i, y_i) PP點的座標為xi,yi)(x_i, y_i)
52 10,12 yi1y_{i-1} yi+1y_{i+1}
52 倒數第3行 Cirpot(x0, y0, x, y) Cirpot(x0, y0, x, y, color)
53 9 Cirpot(x0, y0, x, y) Cirpot(x0, y0, x, y, color)
57 7 FloodFill FloodFill4
57 13-16 FloodFill4(…, newcolor) FloodFill4(…, newcolor, boundaryColor)
58-59 58頁倒數第2行~59頁第11行 見教材 從點P向任意方向發出一條射線,若該射線與多邊形交點的個數為奇數,則P位於多邊形內;若為偶數,則P位於多邊形外部。當射線與多邊形邊界點的交點是多邊形頂點時(該交點稱為奇點,如圖3-13的P
3P_3
P4P_4P5P_5P6P_6情況),如果把每一個奇點簡單地計為一個交點,則交點個數為偶數時P點可能在內部,如圖3-13中的P4P_4情況。但若將每一個奇點都簡單地計為兩個交點,同樣會導致錯誤的結果,如圖3-13中的P3P_3P5P_5情況。因此,必須按不同情況區別對待。一般來說,多邊形的頂點可分為兩類:極值點和非極值點。如果頂點相鄰的兩邊在射線的同側時,則稱該頂點為極值點(如圖3-13中的Q0Q_0Q1Q_1);否則稱該頂點為非極值點(如圖3-13中的Q2Q_2)。為了保證射線法判別結果的正確性,奇點交點的計數可以根據上述分類來採用不同的方式。當奇點是多邊形的極值點時,交點按照兩個交點計算,否則,按一個交點計算,如圖3.13所示。
59 圖3-13 見教材 圖片描述
60 圖3.16 這裡寫圖片描述 這裡寫圖片描述
65 倒數第4行 圖3.22 圖3.23
65 倒數第3行 yi+m/2y_i+m/2 yiint(yi)+m/2y_i-int(y_i)+m/2
73 6 y=rsin(ϕ+θ)=rcosϕsinθrsinϕcosθ y'=rsin(\phi+\theta)=rcos \phi sin \theta - rsin \phi cos \theta y=rsin(ϕ+θ)=rcosϕsinθ+rsinϕcosθ y'=rsin(\phi+\theta)=rcos \phi sin \theta + rsin \phi cos \theta
75 8 相對於y軸的反射 相對於x軸的反射
82/87 式(4.40/57) [cosθsinθ0sinθcosθ0001]\begin{bmatrix} cos\theta & \mathbf{-sin\theta} & 0 \\ \mathbf{sin\theta} & cos\theta & 0 \\ 0 & 0 & 1 \\ \end{bmatrix} [cosθsinθ0sinθcosθ0001]\begin{bmatrix} cos\theta & \mathbf{sin\theta} & 0 \\ \mathbf{-sin\theta} & cos\theta & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}
117 2 T=R(θ)T(x0,y0)=[cosθsinθ0sinθcosθ0001][10x001y0001]T=R(\theta)T(-x_0, -y_0) =\begin{bmatrix} cos\theta & \mathbf{sin\theta} & 0 \\ \mathbf{-sin\theta} & cos\theta & 0 \\ 0 & 0 & 1 \\ \end{bmatrix} \begin{bmatrix} 1 & 0 & -x_0 \\0 & 1 & -y_0 \\0 & 0 & 1 \end{bmatrix} T=R(θ)T(x0,y0)=[cosθsinθ0sinθcosθ0001][10x001y0001]T=R(\theta)T(-x_0, -y_0) = \begin{bmatrix} cos\theta & -sin\theta & 0 \\sin\theta & cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & -x_0 \\0 & 1 & -y_0 \\0 & 0 & 1 \end{bmatrix}