GAMES101_Lecture_03

transformation

modeling translation rotation
viewing scaling (3D to 2D) projection

  • scale
    x ′ = s x y ′ = s y x'=sx\\ y'=sy x=sxy=sy
    scale matrix
    [ x ′ y ′ ] = [ s x 0 0 s y ] [ x y ] \left[ \begin{matrix} x'\\ y' \end{matrix} \right]= \left[ \begin{matrix} s_x & 0\\ 0 & s_y \end{matrix} \right] \left[ \begin{matrix} x\\ y \end{matrix} \right] [xy]=[sx00sy][xy]
    Reflection matrix   Shear matrix  Rotation Matrix
    [ − 1 0 0 1 ] [ − 1 a 0 1 ] [ c o s θ − s i n θ s i n θ c o s θ ] \left[ \begin{matrix} -1 & 0\\ 0 & 1 \end{matrix} \right] \left[ \begin{matrix} -1 & a\\ 0 & 1 \end{matrix} \right] \left[ \begin{matrix} cos\theta & -sin\theta\\ sin\theta & cos\theta \end{matrix} \right] [1001][10a1][cosθsinθsinθcosθ]
    不想让平移作为特例,引入齐次坐标,希望包含所有变换
    2D point = ( x , y , 1 ) T (x,y,1)^T (x,y,1)T   2D vector = ( x , y , 0 ) T (x,y,0)^T (x,y,0)T
    [ x ′ y ′ w ′ ] = ( 1 0 t x 0 1 t y 0 0 1 ) ( x y 1 ) = ( x + t x y + t y 1 ) \left[ \begin{matrix} x'\\ y'\\ w' \end{matrix} \right]= \left( \begin{matrix} 1 & 0 & t_x\\ 0 & 1 & t_y\\ 0 & 0 & 1 \end{matrix} \right) \left( \begin{matrix} x\\ y\\ 1 \end{matrix} \right)= \left( \begin{matrix} x+t_x\\ y+t_y\\ 1 \end{matrix} \right) xyw=100010txty1xy1=x+txy+ty1
    先旋转、后平移
    在这里插入图片描述
    矩阵的转置=矩阵的逆 ---------> 正交矩阵
    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= \left[ \begin{matrix} cos\theta & -sin\theta\\ sin\theta & cos\theta \end{matrix} \right] \\ R_{-\theta}= \left[ \begin{matrix} cos\theta & sin\theta\\ -sin\theta & cos\theta \end{matrix} \right]=R_\theta^T\\ R_{-\theta}=R_\theta^{-1} Rθ=[cosθsinθsinθcosθ]Rθ=[cosθsinθsinθcosθ]=RθTRθ=Rθ1
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值