【图形学】03 数学部分(三、各种变换矩阵)

数学部分(三、各种变换矩阵)

1、基本变换

  • 旋转: [ c o s θ − s i n θ s i n θ c o s θ ] \begin{bmatrix}cos\theta &-sin\theta \\sin\theta &cos\theta \end{bmatrix} [cosθsinθsinθcosθ]
  • 缩放: [ k x 0 0 k y ] \begin{bmatrix}k_x&0\\0 &k_y\end{bmatrix} [kx00ky]
  • 剪影(shear): [ 1 a 0 1 ] [ x y ] \begin{bmatrix}1&a\\0 &1\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix} [10a1][xy]
  • 平移: [ 1 0 t x 0 1 t y 0 0 1 ] \begin{bmatrix}1 &0 &t_x \\ 0& 1& t_y\\ 0 & 0&1\end{bmatrix} 100010txty1
  • 投影:
  • 镜像
  • 仿射:

2、补充说明

  按x轴旋转: [ 1 0 0 0 c o s θ − s i n θ 0 s i n θ c o s θ ] \begin{bmatrix}1 &0 &0\\0 &cos\theta &-sin\theta \\0 &sin\theta &cos\theta \end{bmatrix} 1000cosθsinθ0sinθcosθ

  按y轴旋转: [ c o s θ 0 s i n θ 0 1 0 − s i n θ 0 c o s θ ] \begin{bmatrix}cos\theta &0 &sin\theta\\0 &1 &0 \\ -sin\theta &0&cos\theta \end{bmatrix} cosθ0sinθ010sinθ0cosθ

  按z轴旋转: [ c o s θ − s i n θ 0 s i n θ c o s θ 0 0 0 1 ] \begin{bmatrix}cos\theta &-sin\theta &0\\sin\theta &cos\theta &0 \\ 0&0&1\end{bmatrix} cosθsinθ0sinθcosθ0001

  另外,额外考虑会有万向轴锁死的情况,即:某两个轴重叠的时候,就会只剩两个轴的方向可以转动了,剩下的就不能转动了。

  《3D数学基础 图形与游戏开发》这本书的第8章中也有记录按照 任意向量进行旋转 和 按照任意向量缩放的 的公式,但是这里就不记录了,推导复杂而且结果也很复杂啊。

  补充:《Games101》Lecture04:2D情况下旋转 − θ -\theta θ 角的情况:
R θ = [ c o s θ − s i n θ s i n θ c o s θ ] R − θ = [ c o s θ s i n θ − s i n θ c o s θ ] = R θ T R − θ = R θ − 1 R_{\theta}=\begin{bmatrix}cos\theta &-sin\theta \\sin\theta &cos\theta \end{bmatrix}\\ R_{-\theta}=\begin{bmatrix}cos\theta &sin\theta \\-sin\theta &cos\theta \end{bmatrix}=R_{\theta}^T\\ R_{-\theta}=R_{\theta}^{-1} Rθ=[cosθsinθsinθcosθ]Rθ=[cosθsinθsinθcosθ]=RθTRθ=Rθ1

3、行列式的计算

在这里插入图片描述

4、矩阵的逆

5、正交矩阵

  另一个特殊的方阵是正交矩阵(orthogonal matrix)。正交是矩阵的一种属性。如果一个方阵M和它的转置矩阵的乘积是单位矩阵的话,我们就说这个矩阵是正交的(orthogonal)。反过来也是成立的。也就是说,矩阵M是正交的等价于:
M M T = M T M = I MM^T=M^TM=I MMT=MTM=I

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值