Rasterization is a technical term in PS. A grid is a pixel. Rasterization is to convert vector graphics into bitmaps (raster images). The basic rasterization algorithm renders 3D scenes represented by polygons to 2D surfaces.
Basic realization method of rasterization
1. transformation: transformation usually uses matrix operation and quaternion operation, but that is beyond the scope of this article. Add a homogeneous variable to a three-dimensional vertex to become a four-dimensional fixed point, and then multiply it by a 4×4 transformation matrix. In this way, the three-dimensional vertices can be transformed. The main transformations are translation, scaling, rotation and projection.
2. Cropping: Once the vertices of the triangle are converted to the correct two-dimensional positions, these positions may be outside the observation window or inside the screen. Cropping is the process of processing triangles to fit the display area.
The most commonly used technique is Sutherland-Hotchmann clipping algorithm. For the triangular edge that intersects the plane edge of the image, that is, one vertex of the edge is located inside the image and the other is located outside the image, a point is inserted at the intersection point and the external point is deleted.
3. Scan transformation: The last step of the traditional rasterization process is to fill the 2D triangle in the image plane, which is the scan transformation.
The slowest and most realistic method is to calculate the brightness of each point separately. Commonly used coloring models are Gouraud coloring and Phong coloring.