SECOND EDITION omputer Graphics С Version Donald Hearn Department of Computer Science and National Center for Supercomputing Applications University of Illinois M. Pauline Baker National Center for Supercomputing Applications University of Illinois PRENTICE HALL Upper Saddle River, New Jersey 07458
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
SECOND EDITION
omputer Graphics С Version
Donald Hearn Department of Computer Science and National Center for Supercomputing Applications University of Illinois
M. Pauline Baker National Center for Supercomputing Applications University of Illinois
PRENTICE HALL Upper Saddle River, New Jersey 07458
Contents
PREFACE
1 1 1-1
1-2 1-3
1-4
1-5
1-6
1-7
1-8
2 2-1
A Survey of Computer Graphics Computer-Aided Design
Points and Lines Line-Drawing Algorithms DDA Algorithm Bresenham's Line Algorithm Parallel Line Algorithms Loading the Frame Buffer Line Function Circle-Generating Algorithms Properties of Circles Midpoint Circle Algorithm Ellipse-Generating Algorithms Properties of Ellipses Midpoint Ellipse Algorithm Other Curves Conic Sections Polynomials and Spline Curves Parallel Curve Algorithms Curve Functions Pixel Addressing and Object Geometry Screen Grid Coordinates Maintaining Geometric Properties of Displayed Objects Filled-Area Primitives Scan-Line Polygon Fill Algorithm Inside-Outside Tests Scan-Line Fill of Curved Boundary Areas Boundary-Fill Algorithm Flood-Fill Algorithm Fill-Area Functions Cell Array Character Generation
84 86 87 88 92 94 95 97 97 98
102 102 103 110 110 112 112 113
114 114
114 117 117 125
126 127 130 131 131 131
Л 4-1
4-2 4-3
4-4
4-5
4-6
4-7 4-8
Summary Applications References Exercises
Attributes of Output Primitives
134 136 140 140
143
Line Attributes Line Type Line Width Pen and Brush Options Line Color Curve Attributes Color and Grayscale Levels Color Tables Grayscale Area-Fill Attributes Fill Styles Pattern Fill Soft Fill Character Attributes Text Attributes Marker Attributes Bundled Attributes Bundled Line Attributes Bundled Area-Fill Attributes Bundled Text Attributes Bundled Marker Attributes Inquiry Functions Antialiasing Supersampling Straight Line Segments Pixel-Weighting Masks
Area Sampling Straight Line Segments 174 Filtering Techniques 174 Pixel Phasing 175 Compensating for Line Intensity Differences 175 Antialiasing Area Boundaries 176
Composite Transformations 191 Translations 191 Rotations 191 Scalings 192 General Pivot-Point Rotation 192 General Fixed-Point Scaling 193 General Scaling Directions 193 Concatenation Properties 194 General Composite Transformations and Computational Efficiency 195
5-4 Other Transformations 201 Reflection 201
Shear 203
5-5 Transformations Between Coordinate Systems 205
5-2
5-3
5-6 Affine Transformations
Transformation Functions
5-8 Raster Methods for Transformations
Summary
References
Exercises
Two-Dimensional Viewing
208
208
210
212
213
213
216
6-1
6-2
6-3
6-4
6-5
6-6
6-7
6-8
6-9
6-10
6-11
The Viewing Pipeline
Viewing Coordinate Reference Frame
Window-to-Viewport Coordinate Transformation
Two-Dimensional Viewing Functions
Clipping Operations
Point Clipping
Line Clipping Cohen-Sutherland Line Clipping Liang-Barsky Line Clipping Nicholl-Lee-Nicholl Line Clipping Line Clipping Using Nonrectangular Clip Windows Splitting Concave Polygons
7-2 Editing Structures Structure Lists and the Element Pointer Setting the Edit Mode Inserting Structure Elements Replacing Structure Elements Deleting Structure Elements Labeling Structure Elements Copying Elements from One Structure to Another
7-3 Basic Modeling Concepts Model Representations Symbol Hierarchies Modeling Packages
7-4 Hierarchical Modeling with Structures Local Coordinates and Modeling Transformations Modeling Transformations Structure Hierarchies
Summary
References
Exercises
250 250 253
254
255 256 256 257 257 258
260
260 261 262 263
265
265 266 266
268
269
269
8 Graphical User Interfaces and Interactive Input Methods 271
Conversion Between Spline Representations Displaying Spline Curves and Surfaces Horner's Rule Forward-Difference Calculations Subdivision Methods Sweep Representations Constructive Solid-Geometry Methods
10-16 Octrees 10-17 BSP Trees
Fractal-Geometry Methods Fractal-Generation Procedures Classification of Fractals Fractal Dimension Geometric Construction of Deterministic Self-Similar Fractals Geometric Construction of Statistically Self-Similar Fractals Affine Fractal-Construction Methods Random Midpoint-Displacement Methods Controlling Terrain Topography Self-Squaring Fractals Self-Inverse Fractals Shape Grammars and Other Procedural Methods Particle Systems Physically Based Modeling Visualization of Data Sets Visual Representations for Scalar Fields Visual Representations for Vector Fields Visual Representations for Tensor Fields
349
351 351 351 353 355
356
Visual Representations for Multivariate Data Fields 402 Summary 404 References 404 Exercises 404
Three-Dimensional
1* | Geometric and Modeling JL Transformations 407
362
362 363 364 364
367
369
372
373 376 378 385
387 390 393 395
11 11
11 11
11 11
11
-1 -2
-3 -4
-5 -6
-7
И ,1
Translation Rotation Coordinate-Axes Rotations General Three-Dimensional Rotations Rotations w i th Quaternions
View Volumes and General Projection Transformations 447 General Parallel-Projection Transformations 452 General Perspective-Projection Transformations 454
Illumination Models and Surface-Rendering Methods 494
Light Sources
Basic Illumination Models Ambient Light Diffuse Reflection Specular Reflection and the Phong Model Combined Diffuse and Specular Reflections with Multiple Light Sources Warn Model Intensity Attenuation Color Considerations Transparency Shadows
Displaying Light Intensities Assigning Intensity Levels Gamma Correction and Video Lookup Tables Displaying Continuous-Tone Images
Halftone Patterns and Dithering Techniques Halftone Approximations Dithering Techniques