Fundamental of Computer Graphics (third edition) Chapter 6 Exercises

Exercises

  1. Write down the (4 imes 4) 3D matrix to move by ((x_m,y_m,z_m)).

[egin{bmatrix}1&&0&&0&&x_m\ 0&&1&&0&&y_m\0&&0&&1&&z_m\ 0&&0&&0&&1end{bmatrix}]

  1. Write down the (4 imes 4) 3D matrix to rotate by an angle ( heta) about the (y)-axis.

[egin{bmatrix}cos heta&&0&&sin heta&&0\ 0&&1&&0&&0\-sin heta&&0&&cos heta&&0\ 0&&0&&0&&1end{bmatrix}]

  1. Write down the (4 imes 4) 3D matrix to scale an object by 50% in all directions.

[egin{bmatrix}0.5&&0&&0&&0\ 0&&0.5&&0&&0\0&&0&&0.5&&0\ 0&&0&&0&&1end{bmatrix}]

  1. Write the 2D rotation matrix that rotates by 90 degrees clockwise.

顺时针90度为逆时针270度

[egin{bmatrix}0&&1&&0\-1&&0&&0\0&&0&&1end{bmatrix} ]

  1. Write the matrix from Exercise 4 as a product of three shear matrices.

根据

[egin{bmatrix}cosphi&&-sinphi \ sinphi&&cosphiend{bmatrix} = egin{bmatrix}1&&frac{cosphi-1}{sinphi} \ 0&&1end{bmatrix} egin{bmatrix} 1&&0 \ sinphi&&1 end{bmatrix} egin{bmatrix} 1&&frac{cosphi-1}{sinphi} \ 0&&1 end{bmatrix}]

[egin{bmatrix}0&&1&&0\-1&&0&&0\0&&0&&1end{bmatrix}= egin{bmatrix}1&&1&&0\0&&1&&0\0&&0&&1end{bmatrix} egin{bmatrix}1&&0&&0\-1&&1&&0\0&&0&&1end{bmatrix} egin{bmatrix}1&&1&&0\0&&1&&0\0&&0&&1end{bmatrix}]

  1. Find the inverse of the rigid body transformation:

[A = egin{bmatrix} R&&t\0: 0: 0 && 1end{bmatrix} ]

where (mathbf{R}) is a (3 imes 3) rotation matrix and (mathbf{t}) is a 3-vector

首先行列式不等于0,所以逆矩阵肯定存在,设其为(B =egin{bmatrix} X&&Y\Z && Wend{bmatrix}),根据(AB=E)

[left{egin{matrix}RX+tZ=E\RY+tW=0\Z=0\W=Eend{matrix} ight. ightarrow left{egin{matrix}Y=-R^{-1}t\X=R^{-1}end{matrix} ight. ]

( herefore B = egin{bmatrix}R^{-1} &&-R^{-1}t\0:0:0&&1end{bmatrix})

  1. Show that the inverse of the matix for an affine transformation(one that has all zeros in the bottom row except for a one in the lower right entry) also has the same form.

证明同6. 若仿射矩阵最后一项的代数余子式不为零则逆矩阵存在且仍然为仿射矩阵

  1. Describe in words what this 2D transform matrix does:

[egin{bmatrix} 0&&-1&&1\1&&0&&1\0&&0&&1end{bmatrix} ]

绕原点旋转(frac{1}{2}pi),再平移(egin{bmatrix}1,1 end{bmatrix}^T)

  1. Write down the (3 imes 3) matrix that rotates a 2D point by angle ( heta) about a point p (= (x_p,y_p)).

先把点平移到p上,旋转,再平移回来

[egin{bmatrix}1&&0&&-x_p\0&&1&&-y_p\0&&0&&1end{bmatrix} egin{bmatrix}cos heta&&-sin heta&&0\sin heta&&cos heta&&0\0&&0&&1end{bmatrix} egin{bmatrix}1&&0&&x_p\0&&1&&y_p\0&&0&&1end{bmatrix}]

[= egin{bmatrix}cos heta&&-sin heta&&x_p(cos heta-1)-y_p sin heta\sin heta&&cos heta&&x_p sin heta +y_p(cos heta-1)\0&&0&&1end{bmatrix}]

  1. Write down the (4 imes 4) rotation matrix that that takes the orthonormal 3D vectors (u = (x_u,y_u,z_u)), (v = (x_v,y_v,z_v),) and (w = (x_w,y_w,z_w),) to orthonormal 3D vectors (a = (x_a, y_a, z_a), b = (x_b,y_b,z_b),) and (c = (x_c,y_c,z_c),) So (Mu = a, Mv = b,) and (Mw = c).

根据欧拉角来转换

[cos(roll) = dot(u,a) ,cos(pitch) = dot(v,b), cos(yaw) = dot(w,c) ]

对x轴旋转(roll),对y轴旋转(pitch),对z轴旋转(yaw)

  1. What is the inverse matrix for the answer to the previous problem?

(roll,pitch,yaw)都变为(2pi- heta)

原文地址:https://www.cnblogs.com/xxrlz/p/12734959.html