530 likes | 550 Views
Introduction and Graphics Pipeline. Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/07. with slides by Brian Curless, Zoran Popovic, Robin Chen and Doug James. Introduction. Instructor: Yung-Yu Chuang ( 莊永裕 ) E-mail : cyy@csie.ntu.edu.tw Office: CSIE 527 Web:
E N D
Introduction and Graphics Pipeline Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/07 with slides by Brian Curless, Zoran Popovic, Robin Chen and Doug James
Introduction • Instructor: Yung-Yu Chuang(莊永裕) • E-mail: cyy@csie.ntu.edu.tw • Office: CSIE 527 • Web: • http://www.csie.ntu.edu.tw/~cyy/amt/
What is Computer Graphics ? • Definition • the pictorial synthesis of real or imaginary objects from their computer-based models OUTPUT INPUT
Computer graphics • Create a 2D image/animation of a 3D world
Computer graphics modeling rendering animation
Applications • Movies • Interactive entertainment • Industrial design • Architecture • Culture heritage
Animation production pipeline storyboard story text treatment storyreal look and feel voice
Animation production pipeline animation layout modeling/articulation shading/lighting rendering final touch
Scan converting lines • A scan-converted line showing intensified pixels as black circles
Desired line (xi+1,Round(yi+m)) (xi,yi) (xi+1,yi+m) (xi,Round(yi)) The basic incremental algorithm
The basic incremental algorithm void Line (int x0, int y0, int x1, int y1, value) { int x; float dy, dx, y, m; dy=y1-y0; dx=x1-x0; m=dy/dx; y=y0; for (x=x0; x<=x1; x++) { WritePixel (x, (int)floor(y+0.5), value); y+=m; } }
12 D 10 F Scan line 8 a b c d 6 E C 4 A 2 B 2 4 6 8 10 12 14 Filling Polygons
Span extrema Other pixels in the span Filling Polygons
Filling Polygons • find the intersections of the scan line with all edges of the polygon • sort the intersections by increasing x coordinate • fill in all pixels between pairs of intersections that lie interior to the polygon
Limitations of a 2X2 matrix • Scaling • Rotation • Reflection • Shearing • What do we miss?
Parallel and perspective projections orthographic perspective
Visibility Algorithms • Painter’s algorithm • Ray casting • Z-buffer • Binary space partitioning