ebook img

Computer Graphics, C Version (2nd Ed.) - Lia/ufc PDF

662 Pages·2002·20.16 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Computer Graphics, C Version (2nd Ed.) - Lia/ufc

Contents PREFACE xvii 1 A Survey of Computer 2-2 Graphics 2 Computer-Aided Design 2-3 Presentation Graphics 'I 2-4 Computer Art l 3 2-5 Entertainment 18 Education and Training 2 1 Visualization 25 Image Processing 3 2 Graphical User Interfaces 3 4 Overview of Graphics 2 systems 35 2-6 2-1 VideoDisplayDevices 36 2-7 Refresh Cathode-Ray Tubes 37 Raster-Scan Displays 40 Random-Scan Displays 41 Color CRT Monitors 42 Direct-View Storage Tubes 4.5 Flat-Panel Displays 45 Three-Dimensional Viewing Devices 49 Stereoscopic and Virtual-Reality Systems Raster-Scan System!; Video Controller Raster-Scan Display Processor Random-Scan Systems Graphics Monitors and Workstations Input Devices Keyboards Mouse Trackball and Spaceball Joysticks Data Glove Digitizers Image Scanners Touch Panels Light Pens Voice Systems Hard-Copy Devices Graphics Software Coordinate Representations Graphics Functions Software Standards PHIGS Workstations Summary References Exercises vii Contents 3 Outout Primitives 83 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 Summary Applications References Exercises Attributes of Output Primitives 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-Fi Attributes Bundled Text Attributes Bundled Marker Attributes Inquiry Functions Antialiasing Supersampling Straight Line Segments Pixel-Weighting Masks Contents Area Sampling Straight Line 5-6 Aff ine Transformations 208 Segments 174 5-7 Transformation Functions 208 Filtering Techniques 174 5-8 Raster Methods for Transformations 210 Pixel Phasing 1 75 Summary 212 Compensating for Line lntensity Differences 1 75 References 21 3 Antialiasing Area Boundaries 1 76 Exercises 213 Summary References Exercises Two-Dimensional 180 180 6 Viewing 21 6 6-1 The Viewing Pipeline 5 Two-Dimensional Geometric 6-2 Viewing Coordinate Reference Frame 183 6-3 Window-teviewport Coordinate Transformations Transformation 5-1 Basic Transformations Translation Rotation Scaling 5-2 Matrix Representations and Homogeneous Coordinates 5-3 Composite Transformations Translations Rotations Scalings General Pivot-Point Rotation General Fixed-Point Scaling General Scaling Directions Concatenation Properties General Composite Transformations and Computational Efficiency 5-4 Other Transformations Reflection Shear Two-Dimensional Wewing 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 Polygon Clipping Sutherland-Hodgernan Polygon Clipping Weiler-Atherton Polygon Clipping Other Polygon-Clipping Algorithms Curve Clipping Text Clipping Exterior Clipping Summary 5-5 Transformations Between Coordinate References Systems 205 Exercises 7 Structures and Hierarchical Modeling 250 7-1 Structure Concepts 250 Basic Structure Functions 250 Setting Structure Attributes 253 7-2 Editing Structures 254 Structure Lists and the Element Pointer 255 Setting the Edit Mode 250 Inserting Structure Elements 256 Replacing Structure Elements 257 Deleting Structure Elements 257 Labeling Structure Elements 258 Copying Elements from One Structure to Another 260 7-3 Basic Modeling Concepts 2 60 Mode1 Representations 261 Symbol Hierarchies 262 Modeling Packages. 263 7-4 Hierarchical Modeling with Structures 265 Local Coordinates and Modeling Transformations 265 Modeling Transformations 266 Structure Hierarchies 266 Summary 268 References 269 Exercises 2 69 Graphical User Interfaces 8 and Interactive lnput Methods 271 8-1 The User Dialogue Windows and Icons Accommodating Multiple Skill Levels Consistency Minimizing Memorization Backup and Error Handling Feed back 8-2 lnput of Graphical Data Logical Classification of Input Devices Locator Devices Stroke Devices String Devices Valuator Devices Choice Devices Pick Devices 8-3 lnput Functions Input Modes Request Mode Locator and Stroke Input in Request Mode String Input in Request Mode Valuator Input in Request Mode Choice lnput in Request Mode Pick Input in Request Mode Sample Mode Event Mode Concurrent Use of Input Modes 8-4 Initial Values for Input-Device Parameters 8-5 lnteractive Picture-Construction Techniques Basic Positioning Methods Constraints Grids Gravity Field Rubber-Band Methods Dragging Painting and Drawing 8-6 Virtual-Reality Environments 292 10-4 Summary 233 References 294 Exercises 294 10-5 10-6 9 Three-Dimensional Concepts 296 9-1 Three-Dimensional Display Methods Parallel Projection Perspective Projection Depth Cueing Visible Line and Surface Identification Surface Rendering Exploded and Cutaway Views Three-Dimensional and Stereoscopic Views 9-2 Three-Dimensional Graphics Packages 302 Three-Dimensional 10-1 Polygon Surfaces Polygon Tables Plane Equations Polygon Meshes 10-2 Curved Lines and Surfaces 10-3 Quadric Sutiaces Sphere Ellipsoid Torus Superquadrics Superellipse Superellipsoid Blobby Objects Spline Representations Interpolation and Approximation Splines Parametric Continuity Conditions Geometric Continuity Conditions Spline Specifications Cubic Spline Interpolation Methods Natural Cubic Splines Hermite Interpolation Cardinal Splines Kochanek-Bartels Splines Bezier Curves and Surfaces Bezier Curves Properties of Bezier Curves Design Techniques Using Bezier Curves Cubic Ezier Curves Bezier Surfaces B-Spline Curves and Surfaces B-Spline Curves Uniform, Periodic B-Splines Cubic, Periodic €3-Splines Open, Uniform B-Splines Nonuniform 13-Splines B-Spline Surfaces Beta-Splines Beta-Spline Continuity Conditions Cubic, Periodic Beta-Spline Matrix Representation Rational Splines Contents Conversion Between Spline Representations Displaying Spline Curves and Surfaces Homer's Rule Forward-Difference Calculations Subdivision Methods Sweep Representations Constructive Solid-Geometry Methods Octrees 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 VisuaI Representations for Vector Fields Visual Representations for Tensor Fields Visual Representations for Multivariate Data Fields 402 Summary 404 References 404 Exercises 404 Three-Dimensional 11 Geometric and Modeling Transformations 407 Translation 408 Rotation 409 Coordinate-Axes Rotations 409 General Three-Dimensional Rotations 41 3 Rotations with Quaternions 419 Scaling 420 Other Transformat~ons 422 Reflections 422 Shears 423 Conlposite Transformations 423 Three-Dimens~onal Transformation Functions 425 Modeling and Coordinate Transformations 426 Summary 429 References 429 Exercises 430 Three-Dimensional 12 Viewing 43 1 12-1 Viewing Pipeline 432 12-2 Viewing Coordinates 433 Specifying the Virbw Plane 433 Transformation from World - 40 1 to Viewing Coordinates 437 xii Contents Projections Parallel Projections Perspective IJrojections View Volumes and General Projection Transformations General Parallel-Projection Transformations General Perspective-Projection Transformations Clipping Normalized View Volumes Viewport Clipping Clipping in Homogeneous Coordinates Hardware Implementations Three-Dimensional Viewing Functions Summary References Exercises 1 3-1 2 Wireframe Methods 490 13-1 3 Visibility-Detection Functions 490 Summary 49 1 Keferences 492 Exercises 49 2 lllumination Models 14 and Surface-Rendering Methods 494 Visi ble-Su dace Detection Met hods 469 Classification of Visible-Surface D~tection Algorithms Back-Face Detection Depth-Buffer Method A-Buffer Method Scan-Line Method Depth-Sorting Method BSP-Tree Method Area-Subdivision Method Octree Methods Ray-Casting Met hod Curved Surfaces Curved-Surface Representations Surface Contour Plots Light Sources Basic lllumination 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 Polygon-Rendering Methods Constant-Intensity Shading Gouraud Shading Phong Shading Contents Fast Phong Shading Ray-Tracing Methods Basic Ray-Tracing Algorithm Ray-Surface Intersection CaIculations Reducing Object-Intersection Calculations Space-Subdivision Methods AntiaIiased Ray Tracing Distributed Ray Tracing Radiosity Lighting Model Basic Radiosity Model Progressive Refinement Radiosity Method Environment Mapping Adding Surface Detail Modeling Surface Detail with Polygons Texture Mapping Procedural Texturing Methods Bump Mapping Frame Mapping Summary References Exercises 15-6 CMY Color Model 15-7 HSV Color Model 15-8 Conversion Between HSV and RGB Models 15-9 HLS Color Model 1 5-1 0 Color Selection and Applications Summary Reierences Exercises 16 Computer Animation 583 14-1 Design of Animation Sequences 16-2 General Computer-Animation Functions 16-3 Raster Animations 16-4 Computer-Animation Languages 16-5 Key-Frame Systems Morphing Simulating Accelerations 16-6 Motion Specifications Direct Motion Specification Goal-Directed Systems Kinematics and Dynamics Color Models and Color Summary Apd ications 564 References . , Exercises 597 15-1 Properties of Light 565 15-2 Standard Primaries and the Chromaticity Diagram 568 A Mathematics for Computer XYZ Color Model 569 Graphics 599 CIE Chromaticity Diagram 569 A-1 Coordinate-Reference Frames 600 1 5-3 Intuitive Color Concepts 571 Two-Dimensional Cartesian 15-4 RGB Color Model 15-5 Y I Q Color Model 572 Reference Frames 600 5 74 Polar Coordinates in the xy Plane 601 xiv Contents Three-Dimensional Cartesian Reference Frames Three-Dimensional Curvilinear Coordinate Systems Solid Angle A-2 Points and Vectors Vector Addition and Scalar Multiplication Scalar Product of Two Vectors Vector Product of Two Vectors A-3 Basis Vectors and the Metric Tensor Orthonormal Basis Metric Tensor A-4 Matrices Matrix Transpose Determinant of a Matrix Matrix Inverse Complex Numbers Quaternions Nonparametric Representations Parametric Representations Numerical Methods Solving Sets of Linear Equations Finding Roots of Nonlinear Equations Evaluating Integrals Fitting CUN~S to Data Sets Scalar Multiplication and Matrix BIBLIOGRAPHY Addition 612 Matrix Multiplication 612 INDEX Graphics C Version C omputers have become a powerful tool for the rapid and economical pro- duction of pictures. There is virtually no area in which graphical displays cannot be used to some advantage, and so it is not surprising to find the use of computer graphics so widespread. Although early applications in engineering and science had to rely on expensive and cumbersome equipment, advances in computer technology have made interactive computer graphics a practical tool. Today, we find computer graphics used routinely in such diverse areas as science, engineering, medicine, business, industry, government, art, entertainment, ad- vertising, education, and training. Figure 1-1 summarizes the many applications of graphics in simulations, education, and graph presentations. Before we get into the details of how to do computer graphics, we first take a short tour through a gallery of graphics applications. - F ' I ~ ~ I I ~ 1 - I Examples of computer graphics applications. (Courtesy of DICOMED Corpora! ion.) A major use of computer graphics is in design processes, particularly for engi- neering and architectural systems, but almost all products are now computer de- signed. Generally referred to as CAD, computer-aided design methods are now routinely used in the design of buildings, automobiles, aircraft, watercraft, space- craft, computers, textiles, and many, many other products. For some design applications; objeck are f&t displayed in a wireframe out- line form that shows the overall sham and internal features of obiects. Wireframe displays also allow designers to qui'ckly see the effects of interacthe adjustments to design shapes. Figures 1-2 and 1-3 give examples of wireframe displays in de- sign applications. Software packages for CAD applications typically provide the designer with a multi-window environment, as in Figs. 1-4 and 1-5. The various displayed windows can show enlarged sections or different views of objects. Circuits such as the one shown in Fig. 1-5 and networks for comrnunica- tions, water supply, or other utilities aR constructed with repeated placement of a few graphical shapes. The shapes used in a design represent the different net- work or circuit components. Standard shapes for electrical, electronic, and logic circuits are often supplied by the design package. For other applications, a de- signer can create personalized symbols that are to be used to constmct the net- work or circuit. The system is then designed by successively placing components into the layout, with the graphics package automatically providing the connec- tions between components. This allows the designer t~ quickly try out alternate circuit schematics for minimizing the number of components or the space re- - quired for the system. Figure 1-2 Color-coded wireframe display for an automobile wheel assembly. (Courtesy of Emns b Sutherland.) Figure 1-3 Color-coded wireframe displays of body designs for an aircraft and an automobile. (Courtesy of (a) Ewns 6 Suthcrhnd and (b) Megatek Corporation.) Animations are often used in CAD applications. Real-time animations using wiseframe displays on a video monitor are useful for testing perfonuance of a ve- hicle or system, as demonstrated in Fig. ld. When we do not display o b j s with rendered surfaces, the calculations for each segment of the animation can be per- formed quickly to produce a smooth real-time motion on the screen. Also, wire- frame displays allow the designer to see into the interior of the vehicle and to watch the behavior of inner components during motion. Animations in virtual- reality environments are used to determine how vehicle operators are affected by Figure 1-4 Multiple-window, color-coded CAD workstation displays. (Courtesy of Intergraph Corporation.)

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.