計算機圖形學完整筆記(六):三維圖形變換

第六章 三維圖形變換

6.1 三維圖形幾何變換

6.1.1 幾何變換概述

三維基本幾何變換皆是相對於座標原點和座標軸進行的幾何變換。與二維變換類似,引入齊次座標表示,即三維空間中某點的變換可以表示成點的齊次座標與四階的三維變換矩陣相乘。

  • p = [ x y z 1 ] = [ x y z 1 ] [ a b c p d e f q g h i r l m n s ] p' = \left[ \begin{matrix} x^* & y^* & z^* & 1\end{matrix}\right] =\left[ \begin{matrix} x & y & z & 1 \end{matrix}\right]· \left[ \begin{matrix} a&b&c&p\\d&e&f&q\\g&h&i&r\\l&m&n&s \end{matrix} \right]

[外鏈圖片轉存失敗,源站可能有防盜鏈機制,建議將圖片保存下來直接上傳(img-mfjsdLeX-1597369958866)(assets/1559044604537.png)]

6.1.2 平移變換
  • [ x y z 1 ] = [ x y z 1 ] T t = [ x y z 1 ] [ 1 0 0 0 0 1 0 0 0 0 1 0 T x T y T z 1 ] = [ x + T x y + T y z + T z 1 ] \left[ \begin{matrix} x' & y' & z' & 1\end{matrix}\right]=\left[ \begin{matrix} x & y & z & 1\end{matrix}\right]·T_t=\left[ \begin{matrix} x & y & z & 1\end{matrix}\right] · \left[ \begin{matrix} 1&0&0&0\\0&1&0&0\\0&0&1&0\\T_x&T_y&T_z&1 \end{matrix} \right] = \left[ \begin{matrix} x+T_x & y+T_y & z+T_z & 1\end{matrix}\right]
6.1.3 比例變換
  • 局部比例變換: [ x y z 1 ] = [ x y z 1 ] T s = [ x y z 1 ] [ a 0 0 0 0 e 0 0 0 0 i 0 0 0 0 1 ] = [ a x e y i z 1 ] \left[ \begin{matrix} x' & y' & z' & 1\end{matrix}\right]=\left[ \begin{matrix} x & y & z & 1\end{matrix}\right]·T_s=\left[ \begin{matrix} x & y & z & 1\end{matrix}\right] ·\left[ \begin{matrix} a&0&0&0\\0&e&0&0\\0&0&i&0\\0&0&0&1 \end{matrix} \right] = \left[ \begin{matrix} ax&ey&iz & 1\end{matrix}\right] =[axeyiz1]
  • 整體比例變換: [ x y z 1 ] = [ x y z 1 ] T s = [ x y z 1 ] [ 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 s ] = [ x y z s ] \left[ \begin{matrix} x' & y' & z' & 1\end{matrix}\right]=\left[ \begin{matrix} x & y & z & 1\end{matrix}\right]·T_s=\left[ \begin{matrix} x & y & z & 1\end{matrix}\right] ·\left[ \begin{matrix} 1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&s \end{matrix} \right] = \left[ \begin{matrix} x&y&z & s\end{matrix}\right]
相關文章
相關標籤/搜索