




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





3D Primitives Transformation^ Modeling Transformation^ Projection Clipping Lighting Image Transformation^ Viewport Conversion^ Scan 2D Image Coordinates 3D Modeling Coordinates 3D World Coordinates 3D Camera Coordinates 2D Screen Coordinates 2D Screen Coordinates Transformation^ Viewing 3D World Coordinates 2D Image Coordinates
void SetPixel(int x, int y, Color rgba)
void SetPixel(int x, int y, Color rgba)
Triangle Scan Conversion
P 1 P 2 P 3 P 4 Simple Algorithm P 1 P 2 P 3 void ScanTriangle(Triangle T, Color rgba){ for each pixel P at (x,y){ if (Inside(T, P)) SetPixel(x, y, rgba); } }
L Inside Triangle Test
P L 1 L 2 L 3 Inside Triangle Test Boolean Inside(Triangle T, Point P) { for each boundary line L of T { Scalar d = L.aP.x + L.bP.y + L.c; if (d < 0.0) return FALSE; } return TRUE; }** L 1 L 2 L 3 Simple Algorithm P 1 P 2 P 3 void ScanTriangle(Triangle T, Color rgba){ for each pixel P at (x,y){ if (Inside(T, P)) SetPixel(x, y, rgba); } }
Polygon Sweep-Line Algorithm
xL xR
Polygon Sweep-Line Algorithm void ScanPolygon(Triangle T, Color rgba){ sort edges by maxy make empty “active edge list” for each scanline (top-to-bottom) { insert/remove edges from “active edge list” update x coordinate of every active edge sort active edges by x coordinate for each pair of active edges (left-to-right) SetPixels(xi, xi+1, y, rgba); } } Hardware Scan Conversion
Hardware Antialiasing
P 1 P 2 P 3 Overview
Shading
Angel Figure 6.
Watt Plate 7
Shading Issues
Summary