透視投影的定義更為複雜。可以將其理解為透過攝像機取景器對於被投影物體進行觀察。攝像機的位置、朝向和視野都將影響投影變換的結果。我們定義以下變量來對這一變換進行描述:
:將被投影的三維空間中的點。
:攝像機的位置。
:攝像機的旋轉角度。當
=<0,0,0>且
=<0,0,0>, 三維向量<1,2,0>將被投影到二維向量<1,2>。
:觀測者相對顯示平面的位置。[1]
最終結果為:
:
所產生的二維投影。
首先我們定義點
作為點
向攝像機坐標系所作的變換,其中攝像機坐標系由攝像機的位置
和旋轉
所決定。該過程為:先用
減去
,然後使用由
產生的旋轉矩陣乘上該結果。該變換通常稱為攝像機變換(注意該計算過程假設使用左手法則):
[2]
[3]
[4]
或者使用以下這種非矩陣表示的形式,其中角度的正負號與矩陣表示形式不同:
![{\displaystyle {\begin{array}{lcl}d_{x}&=&\cos \theta _{y}\cdot (\sin \theta _{z}\cdot (a_{y}-c_{y})+\cos \theta _{z}\cdot (a_{x}-c_{x}))-\sin \theta _{y}\cdot (a_{z}-c_{z})\\d_{y}&=&\sin \theta _{x}\cdot (\cos \theta _{y}\cdot (a_{z}-c_{z})+\sin \theta _{y}\cdot (\sin \theta _{z}\cdot (a_{y}-c_{y})+\cos \theta _{z}\cdot (a_{x}-c_{x})))+\cos \theta _{x}\cdot (\cos \theta _{z}\cdot (a_{y}-c_{y})-\sin \theta _{z}\cdot (a_{x}-c_{x}))\\d_{z}&=&\cos \theta _{x}\cdot (\cos \theta _{y}\cdot (a_{z}-c_{z})+\sin \theta _{y}\cdot (\sin \theta _{z}\cdot (a_{y}-c_{y})+\cos \theta _{z}\cdot (a_{x}-c_{x})))-\sin \theta _{x}\cdot (\cos \theta _{z}\cdot (a_{y}-c_{y})-\sin \theta _{z}\cdot (a_{x}-c_{x}))\\\end{array}}}](//wikimedia.org/api/rest_v1/media/math/render/svg/c3469af63e4264d6a806576df1c794210d183c59)
然後將變換後的該點通過以下方程投影到二維平面(此處投影平面為x/y平面,有時也使用x/z):[5]
![{\displaystyle {\begin{array}{lcl}\mathbf {b} _{x}&=&(\mathbf {d} _{x}-\mathbf {e} _{x})(\mathbf {e} _{z}/\mathbf {d} _{z})\\\mathbf {b} _{y}&=&(\mathbf {d} _{y}-\mathbf {e} _{y})(\mathbf {e} _{z}/\mathbf {d} _{z})\\\end{array}}}](//wikimedia.org/api/rest_v1/media/math/render/svg/d66191db1d23684b243322417254ae3cb6d03a71)
或在齊次坐標系下可以表示為:
![{\displaystyle {\begin{bmatrix}\mathbf {f} _{x}\\\mathbf {f} _{y}\\\mathbf {f} _{z}\\\mathbf {f} _{w}\\\end{bmatrix}}={\begin{bmatrix}1&0&0&-\mathbf {e} _{x}\\0&1&0&-\mathbf {e} _{y}\\0&0&1&0\\0&0&1/\mathbf {e} _{z}&0\\\end{bmatrix}}{\begin{bmatrix}\mathbf {d} _{x}\\\mathbf {d} _{y}\\\mathbf {d} _{z}\\1\\\end{bmatrix}}}](//wikimedia.org/api/rest_v1/media/math/render/svg/5481ab4d4e4418cfe77362cdac787f19c41b19b4)
和
![{\displaystyle {\begin{array}{lcl}\mathbf {b} _{x}&=&\mathbf {f} _{x}/\mathbf {f} _{w}\\\mathbf {b} _{y}&=&\mathbf {f} _{y}/\mathbf {f} _{w}\\\end{array}}}](//wikimedia.org/api/rest_v1/media/math/render/svg/6c4671eaabae641a127ee63db971ed12eaf992a0)
觀測者到顯示平面的距離,
,直接關係到視野的大小。
為可視角度。(這裡假設屏幕的兩角為(-1,-1)和(1,1))
如果要在一些特定的顯示設備上顯示該二維平面,之後還要進行一些必要的剪裁和縮放操作。