计算机图形学笔记 #2 —— Rasterization (Triangle)
Perspective Projection - After Story~
Near Plane 的 l、r、b、t
两种情况:
- Explicit ,这种情况就非常的nice
- (也是有时候最为Prefer的)Vertical field-of-view(fovY)即竖直方向的可视范围以及Aspect ratio(宽高比),如图所示:

After MVP
所有的点都被变换到\([-1,1]^2\)的立方体中来——绘图!这个时候需要讨论如何把前面的那个立方体表达到屏幕上来
Canonical to Screen
What is a screen
- 一系列的像素点
- 像素点的规模
- 光栅化成像设备
Raster == Screen in German
rasterize == 绘图
Pixel == abbreviation of “picture element”
Pixel坐标的取值为(0,0)to (w-1,h-1)。像素中心在\((x+\frac{1}{2} , y+\frac{1}{2})\)
Transform
将正则立方体变换到屏幕空间,这个步骤与z的取值没有关系,这里暂时不考虑。将原来的xy坐标变换到屏幕空间的矩阵如下所示(在齐次坐标下)
\[\begin{pmatrix}
\frac{w}{2} & 0 & 0 & \frac{w}{2}\\
0 & \frac{h}{2} & 0 & \frac{h}{2}\\
0 & 0 & 1 & 0 \\
0& 0 & 0 &1
\end{pmatrix}
\]
这里把屏幕左下角定为原点

浙公网安备 33010602011771号