腾讯游戏学院 游戏程序设计第三章(个人总结)——三维几何学

第三章学习打卡

旋转

欧拉角分别绕xyz轴旋转矩阵

R x ( θ ) ( 1 0 0 0 c o s θ − s i n θ 0 s i n θ c o s θ ) R_x(θ)\left( \begin{matrix} 1 & 0 & 0 \\ 0 & cosθ & -sinθ \\ 0 & sinθ & cosθ \end{matrix} \right) Rx(θ)1000cosθsinθ0sinθcosθ
R y ( θ ) ( c o s θ 0 − s i n θ 0 1 0 s i n θ 0 c o s θ ) R_y(θ)\left( \begin{matrix} cosθ & 0 & -sinθ \\ 0 & 1 & 0 \\ sinθ & 0 & cosθ \end{matrix} \right) Ry(θ)cosθ0sinθ010sinθ0cosθ
R z ( θ ) ( c o s θ − s i n θ 0 s i n θ c o s θ 0 0 0 1 ) R_z(θ)\left( \begin{matrix} cosθ & -sinθ & 0 \\ sinθ & cosθ & 0 \\ 0 & 0 & 1 \end{matrix} \right) Rz(θ)cosθsinθ0sinθcosθ0001

给定每个轴的缩放因子

S ( S x , S y , S z ) ( S x 0 0 0 S y 0 0 0 S z ) S(S_x,S_y,S_z)\left( \begin{matrix} S_x & 0 & 0 \\ 0 & S_y & 0 \\ 0 & 0 & S_z \end{matrix} \right) S(Sx,Sy,Sz)Sx000Sy000Sz

给定每个轴的平移因子

T ( T x , T y , T z ) ( 1 0 0 T x 0 1 0 T y 0 0 1 T z ) T(T_x,T_y,T_z)\left( \begin{matrix} 1 & 0 & 0 & T_x \\ 0 & 1 & 0 & T_y \\ 0 & 0 & 1 & T_z \end{matrix} \right) T(Tx,Ty,Tz)100010001TxTyTz
在这里插入图片描述

已知平移、旋转、缩放矩阵为T、R、S,计算出混合变换矩阵TRS

设初始坐标点的坐标向量为X0,X0缩放变换得到坐标向量X1,对X1平移变换得到坐标向量X2,对X2作旋转变换得到最终坐标点X3.
(1)缩放 X1 = SX0;
(2)旋转 X2 = RX1 = R(SX0);
(3)平移 X3 = TX2 = T [R(SX0)] = (TRS)X0.
所得混合矩阵为TRS
经过缩放、旋转、平移所得

猜你喜欢

转载自blog.csdn.net/lr_shadow/article/details/107214991