Viewport transform

The last transform to be applied in the chain (3.41) is the viewport transform $ T_{vp}$. After $ T_{can}$ has been applied, the $ x$ and $ y$ coordinates each range from $ -1$ to $ 1$. One last step is required to bring the projected points to the coordinates used to index pixels on a physical display. Let $ m$ be the number of horizontal pixels and $ n$ be the number of vertical pixels. For example, $ n = 1080$ and $ m = 1920$ for a 1080p display. Suppose that the display is indexed with rows running from 0 to $ n-1$ and columns from 0 to $ m-1$. Furthermore, $ (0,0)$ is in the lower left corner. In this case, the viewport transform is

$\displaystyle T_{vp} = \begin{bmatrix}\frac{m}{2} & 0 & 0 & \frac{m-1}{2}  0 ...
...rac{n}{2} & 0 & \frac{n-1}{2}  0 & 0 & 1 & 0  0 & 0 & 0 & 1 \end{bmatrix} .$ (3.49)



Steven M LaValle 2020-11-11