Title: Computer Graphics
1Computer Graphics
- Panos Trahanias
- e-mail trahania_at_csd.uoc.gr
??358 Spring 2009
2?st????? ??ad??µ?
Architecture of a Vector Display
3?st????? ??ad??µ?
Architecture of a Raster Display
4?st????? ??ad??µ?
Random scan versus raster scan
5Conceptual Framework of CG
6Line Drawing Midpoint Algorithm
7Line Drawing Midpoint Algorithm
8Line Drawing Midpoint Algorithm
9Line Drawing Midpoint Algorithm
10Line Drawing Midpoint Algorithm
11Line Drawing Midpoint Algorithm
12Line Drawing Midpoint Algorithm
13Circle Drawing Midpoint Algorithm
14Circle Drawing Midpoint Algorithm
15Circle Drawing Midpoint Algorithm
Eight-way symmetry
16Circle Drawing Midpoint Algorithm
17Circle Drawing Midpoint Algorithm
18Circle Drawing Midpoint Algorithm
19Circle Drawing Midpoint Algorithm
20Circle Drawing Midpoint Algorithm
21Ellipse Drawing Midpoint Algorithm
22Ellipse Drawing Midpoint Algorithm
23Ellipse Drawing Midpoint Algorithm
24Antialiasing Midpoint Line Algorithm
Increasing Resolution
25Antialiasing Midpoint Line Algorithm
Unweighted Area Sampling
26Antialiasing Midpoint Line Algorithm
- Properties of Unweighted Area Sampling
- Intensity of a pixel intersected by a line
decreases as the distance between the pixel
center and the edge increases. - A primitive (e.g. line) does not influence a
pixel at all if they are not intersected. - Equal areas contribute equal intensity,
regardless of the distance between the pixels
center and the area.
27Antialiasing Midpoint Line Algorithm
Unweighted Area Sampling Box Filter
28Antialiasing Midpoint Line Algorithm
Weighted Area Sampling Cone Filter
29Antialiasing Midpoint Line Algorithm
Dramatic Effects of the cone filter.
30Antialiasing Midpoint Line Algorithm
31Antialiasing Midpoint Line Algorithm
32Antialiasing Midpoint Line Algorithm
33Antialiasing Midpoint Line Algorithm
34Polygon Filling
35Polygon Filling
36Polygon Filling
Calculation of Span Extrema
37Polygon Filling
38Polygon Filling
39Polygon Filling
40Polygon Filling
41Polygon Filling
Polygon Filling Algorithm
42Polygon Filling
43Filling Ellipse Arcs
44Clipping Lines
45Clipping Lines
Cohen-Sutherland Line-Clipping Algorithm
46Clipping Lines
47Clipping Lines
48Clipping Lines
49Clipping Lines
50Clipping Lines
Parametric Line-Clipping Algorithm
51Clipping Lines
52Clipping Lines
53Clipping Lines
54Geometrical Transformations
2D Transformations - Translation
55Geometrical Transformations
2D Transformations - Scaling
56Geometrical Transformations
2D Transformations - Rotation
57Geometrical Transformations
Homogeneous Coordinates
The XYW homogeneous coordinate space, with the
W1 plane and point P(X,Y,W) projected onto the
W1 plane.
58Geometrical Transformations
2D Transformations Affine Transformations
45o rotation and then nonuniform scaling of the
unit cube. The result is an affine transformation.
59Geometrical Transformations
2D Transformations Shear Transformations
60Geometrical Transformations
Composition of 2D Transformations
61Geometrical Transformations
2D Transformations the Window-to-Viewport
Transformation
62Geometrical Transformations
2D Transformations the Window-to-Viewport
Transformation
63Geometrical Transformations
2D Transformations the Window-to-Viewport
Transformation
64Geometrical Transformations
3D Transformations Coordinate Systems
Left-handed Coordinate System
Right-handed Coordinate System
65Geometrical Transformations
Composition of 3D Transformations
66Geometrical Transformations
Composition of 3D Transformations 1st Approach
67Geometrical Transformations
Composition of 3D Transformations 2nd Approach
68Geometrical Transformations
Composition of 3D Transformations
69Viewing in 3D
Conceptual model of 3D viewing
70Viewing in 3D
Projections - Projectors
71Viewing in 3D
Perspective Projections 1-point PP
72Viewing in 3D
Perspective Projections 2-point PP
73Viewing in 3D
Parallel Projections
74Viewing in 3D
Parallel Projections Isometric Projection
75Viewing in 3D
Parallel Projections Oblique Projection
76Viewing in 3D
77Viewing in 3D
Specifying an Arbitrary 3D View
78Viewing in 3D
Specifying an Arbitrary 3D View
79Viewing in 3D
80Viewing in 3D
81Viewing in 3D
82Viewing in 3D
83Viewing in 3D
The Mathematics of Planar Geometric Projections
84Viewing in 3D
Alternative Perspective Projection
85Viewing in 3D
Alternative Perspective Projection
86Viewing in 3D
Implementation of Planar Geometric Projections
87Viewing in 3D
Implementation of 3D Viewing
88Viewing in 3D
Parallel Projection
89Viewing in 3D
Parallel Projection
90Viewing in 3D
Parallel Projection
91Viewing in 3D
Parallel Projection
92Viewing in 3D
Shearing Matrix
93Viewing in 3D
Final Translation / Scaling Step
94Viewing in 3D
Perspective Projection
95Viewing in 3D
Perspective Projection
96Viewing in 3D
Perspective Projection
97Viewing in 3D
Perspective Projection
98Viewing in 3D
Perspective Projection
99Viewing in 3D
Perspective Projection Step 4 - Shear
100Viewing in 3D
Perspective Projection
101Viewing in 3D
Perspective Projection
102Viewing in 3D
Perspective Projection
103Viewing in 3D
Implementation Summary
104Visible Surface Determination
Image Precision Approaches
Object Precision Approaches
for (each pixel in the image) determine the
object closest to the viewer that is pierced by
the projector through the pixel draw the pixel
in the appropriate color
for (each object in the world) determine those
parts of the object whose view is unobstructed by
other parts of it or any other object draw
those parts in the appropriate color
105Techniques for Efficient Visible-surface
Algorithms
Extents and Bounding Volumes
106Techniques for Efficient Visible-surface
Algorithms
Back-face Culling
107Z-Buffer Algorithm
108Z-Buffer Algorithm
109Z-Buffer Algorithm
110Scan-Line Algorithms
Much like polygon scan-conversion
algorithms Each ET entry contains
111Scan-Line Algorithms
112Scan-Line Algorithms
113Scan-Line Algorithms
114Scan-Line Algorithms
115Scan-Line Algorithms
116Scan-Line Algorithms
Pseudocode for a general scan-line algorithm
117Visible-Surface Ray Tracing
118Visible-Surface Ray Tracing
Pseudocode for a simple ray tracer
119Visible-Surface Ray Tracing
120Visible-Surface Ray Tracing
Anti-alised ray tracing
121List-Priority Algorithms
The Depth-Sort Algorithm
122List-Priority Algorithms
Depth Comparisons
123List-Priority Algorithms
The Depth-Sort Algorithm Tests to resolve
ambiguities
The Depth-Sort Algorithm Tests with polygons
reversed
124List-Priority Algorithms
The Depth-Sort Algorithm Results of Tests
125List-Priority Algorithms
The Depth-Sort Algorithm Unnecessary polygon
split
126Illumination and Shading
127Illumination and Shading
Diffuse Reflection
128Illumination and Shading
129Illumination and Shading
Atmospheric Attenuation
130Illumination and Shading
Depth Cueing
131Illumination and Shading
Specular Reflection
132Illumination and Shading
133Illumination and Shading
134Illumination and Shading
135Illumination and Shading
136Illumination and Shading
Surface Normals
137Illumination and Shading
138Illumination and Shading
Normal Vector Interpolation
139Illumination and Shading
Gouraud Shading Phong Shading
140Illumination and Shading
Texture Mapping
141Illumination and Shading
Scan-line Shadow Algorithm
142Illumination and Shading
Two-Pass Object Precision Shadow Algorithm
143Illumination and Shading
Transparency
144Illumination and Shading
Calculating the refraction vector