-
What is a screen?
- An array of pixels
- Size of the array: resolution
- A typical kind of raster display
-
Raster == screen in German
- Rasterize == drawing onto the screen
-
Pixel (FYI, short for “picture element”)
- For now: A pixel is a little square with uniform color
- Color is a mixture of (red, green, blue)
-
Defining the screen space
- Slightly different from the “tiger book”
- 左下角是原点$(0, 0)$,$x$轴往右,$y$轴往上
- Pixel’s indices are in the form of $(x, y)$, where both x and y are integers
- Pixel’s indices are from $(0, 0)$ to $(width-1, height-1)$
- Pixel $(x, y)$ is centered at $(x+0.5, y+0.5)$
- The screen covers range $(0, 0)$ to $(width, height)$
-
Irrelevant to $z$
-
Transform in $xy$ plane: $[-1, -1]^2$ to $[0, width]\times[0, height]$
-
Viewport transform matrix:
$$
M_{viewport} = \begin{pmatrix}\frac{width}{2}&0&0&\frac{width}{2}\\0&\frac{height}{2}&0&\frac{height}{2}\\0&0&1&0\\0&0&0&1\end{pmatrix}
$$