32
INTERACTIVE COMPUTER GRAPHICS 8TH EDITION Angel 8/e second galleys 2019/4/4 11:00 p. i (front) Windfall Software, PCA ZzT E X 17.7

INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

  • Upload
    others

  • View
    24

  • Download
    0

Embed Size (px)

Citation preview

Page 1: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

INTERACTIVE COMPUTER GRAPHICS

8TH EDITION

Angel 8/e second galleys 2019/4/4 11:00 p. i (front) Windfall Software, PCA ZzTEX 17.7

Page 2: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Angel 8/e second galleys 2019/4/4 11:00 p. ii (front) Windfall Software, PCA ZzTEX 17.7

Page 3: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

INTERACTIVE COMPUTER GRAPHICS

8TH EDITION

EDWARD ANGELUniversity of New Mexico

DAVE SHREINERARM, Inc.

Angel 8/e second galleys 2019/4/4 11:00 p. iii (front) Windfall Software, PCA ZzTEX 17.7

Page 4: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Credits and acknowledgments borrowed from other sources and reproduced, with permission, in this textbook appear on the appropriate page within text.

Copyright © 2020 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by Copyright, and permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, request forms and the appropriate contacts within the Pearson Education Global Rights & Permissions Department, please visit www.pearsoned.com/permissions/.

Many of the designations by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed in initial caps or all caps.

The programs and applications presented in this book have been included for their instructional value. They have been tested with care, but are not guaranteed for any particular purpose. The publisher does not offer any warranties or representations, nor does it accept any liabilities with respect to the programs or applications.

Library of Congress Cataloging-in-Publication Data

ISBN - 10: 0-13-525826-XISBN - 13: 978-0-13-525826-2

Senior Vice President Courseware Portfolio Management: Marcia J. Horton

Director, Portfolio Management: Engineering, Computer Science & Global Editions: Julian Partridge

Executive Portfolio Manager: Matt GoldsteinPortfolio Management Assistant: Meghan JacobyManaging Content Producer: Scott DisannoContent Producer: Carole SnyderRights and Permissions Manager: Ben FerriniManufacturing Buyer, Higher Ed, Lake Side

Communications, Inc. (LSC): Maura Zaldivar-Garcia and Deidra Smith

Inventory Manager: Bruce BoundyProduct Marketing Manager: Yvonne VannattaField Marketing Manager: Demetrius HallMarketing Assistant: Jon BryantCover Designer: SPi Global, Inc.Cover Credit: Emma Gould, Stephen Guerin,

Printer/Binder: LSC Communications, Inc.

About the Cover: The book cover shows an illustration from Simtable LLC (simtable.com) of the Santa Fe Railyard as a 3D point cloud and mesh, which is calculated and rendered in realtime in the browser using WebGL. Live imagery from mobile phones, public webcams, drones, and satellites is projection mapped onto the pointclouds. Realtime. Earth is currently used on wildfires and other emergency events to give realtime coordinated situationalawareness during an unfolding incident. Real-time camera pose estimates allow for GIS points, polylines, and polygons to be both overlaid in augmented reality views on the phones as well as annotations on the imagery from the users.

Kasra Manavi, Cody Smith and Joshua Thorp

Full-Service Project Management: Windfall Software, Paul C. Anagnostopoulos

Page 5: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

To Rose Mary —E.A.

To Vicki, Bonnie, Bob, Cookie, and Goatee —D.S.

Angel 8/e second galleys 2019/4/4 11:00 p. v (front) Windfall Software, PCA ZzTEX 17.7

Page 6: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Angel 8/e second galleys 2019/4/4 11:00 p. vi (front) Windfall Software, PCA ZzTEX 17.7

Page 7: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

CONTENTS

Preface xxi

CHAPTER 1 GRAPHICS SYSTEMS AND MODELS 1

1.1 Applications of Computer Graphics 21.1.1 Display of Information 21.1.2 Design 31.1.3 Simulation and Animation 41.1.4 User Interfaces 6

1.2 A Graphics System 71.2.1 Pixels and the Framebuffer 81.2.2 The CPU and the GPU 91.2.3 Output Devices 101.2.4 Input Devices 13

1.3 Images: Physical and Synthetic 131.3.1 Objects and Viewers 141.3.2 Light and Images 151.3.3 Imaging Models 17

1.4 Imaging Systems 191.4.1 The Pinhole Camera 191.4.2 The Human Visual System 21

1.5 The Synthetic-Camera Model 22

1.6 The Programmer’s Interface 241.6.1 The Pen-Plotter Model 251.6.2 Three-Dimensional APIs 281.6.3 A Sequence of Images 311.6.4 The Modeling–Rendering Paradigm 32

1.7 Graphics Architectures 351.7.1 Display Processors 361.7.2 Pipeline Architectures 371.7.3 The Graphics Pipeline 381.7.4 Vertex Processing 391.7.5 Clipping and Primitive Assembly 401.7.6 Rasterization 40

vii

Angel 8/e second galleys 2019/4/4 11:00 p. vii (front) Windfall Software, PCA ZzTEX 17.7

Page 8: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

viii Contents

1.7.7 Fragment Processing 40

1.8 Programmable Pipelines 41

1.9 Performance Characteristics 42

1.10 OpenGL Versions and WebGL 43

Summary and Notes 44

Suggested Readings 45

Exercises 45

CHAPTER 2 GRAPHICS PROGRAMMING 49

2.1 The Sierpinski Gasket 49

2.2 Programming Two-Dimensional Applications 52

2.3 The WebGL Application Programming Interface 582.3.1 Graphics Functions 592.3.2 The Graphics Pipeline and State Machines 612.3.3 OpenGL and WebGL 612.3.4 The WebGL Interface 622.3.5 Coordinate Systems 64

2.4 Primitives and Attributes 652.4.1 Polygon Basics 672.4.2 Polygons in WebGL 702.4.3 Triangulation 712.4.4 Text 732.4.5 Vertex Attributes 75

2.5 Color 762.5.1 RGB Color 782.5.2 Color Tables 802.5.3 Setting of Color Attributes 81

2.6 Viewing 822.6.1 The Orthographic View 832.6.2 Two-Dimensional Viewing 84

2.7 Control Functions 852.7.1 The HTML Canvas 872.7.2 Aspect Ratio and Viewports 882.7.3 Application Execution 89

2.8 The Gasket Program 902.8.1 Sending Data to the GPU 932.8.2 Rendering the Points 942.8.3 The Vertex Shader 942.8.4 The Fragment Shader 962.8.5 Combining the Parts 96

Angel 8/e second galleys 2019/4/4 11:00 p. viii (front) Windfall Software, PCA ZzTEX 17.7

Page 9: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Contents ix

2.8.6 The initShaders Function 972.8.7 The init Function 982.8.8 Reading the Shaders from the Application 99

2.9 Polygons and Recursion 100

2.10 The Three-Dimensional Gasket 1022.10.1 Use of Three-Dimensional Points 1032.10.2 Use of Polygons in Three Dimensions 1062.10.3 Hidden-Surface Removal 109

Summary and Notes 110

Code Examples 113

Suggested Readings 113

Exercises 114

CHAPTER 3 INTERACTION AND ANIMATION 119

3.1 Animation 1193.1.1 The Rotating Square 1203.1.2 The Display Process 1223.1.3 Double Buffering 1233.1.4 Using a Timer 1243.1.5 Using requestAnimationFrame 125

3.2 Interaction 125

3.3 Input Devices 127

3.4 Physical Input Devices 1273.4.1 Keyboard Codes 1283.4.2 The Mouse and the Trackball 1283.4.3 Data Tablets,Touch Pads, and Touch Screens 1303.4.4 Multidimensional Input Devices 1313.4.5 Logical Devices 1323.4.6 Input Modes 1333.4.7 Clients and Servers 134

3.5 Programming Event-Driven Input 1353.5.1 Events and Event Listeners 1353.5.2 Adding a Button 1363.5.3 Menus 1373.5.4 Using Key Codes 1383.5.5 Sliders 139

3.6 Position Input 140

3.7 Window Events 142

3.8 Gesture and Touch 143

3.9 Picking 145

Angel 8/e second galleys 2019/4/4 11:00 p. ix (front) Windfall Software, PCA ZzTEX 17.7

Page 10: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

x Contents

3.10 Building Models Interactively 146

3.11 Design of Interactive Programs 150

Summary and Notes 151

Code Examples 153

Suggested Readings 153

Exercises 154

CHAPTER 4 GEOMETRIC OBJECTS AND TRANSFORMATIONS 159

4.1 Scalars, Points, and Vectors 1604.1.1 Geometric Objects 1604.1.2 Coordinate-Free Geometry 1624.1.3 The Mathematical View: Vector and Affine Spaces 1634.1.4 The Computer Science View 1644.1.5 Geometric ADTs 1654.1.6 Lines 1664.1.7 Affine Sums 1674.1.8 Convexity 1684.1.9 Dot and Cross Products 1694.1.10 Planes 170

4.2 Three-Dimensional Primitives 172

4.3 Coordinate Systems and Frames 1754.3.1 Representations and N-Tuples 1774.3.2 Change of Coordinate Systems 1784.3.3 Example: Change of Representation 1804.3.4 Homogeneous Coordinates 1824.3.5 Example: Change in Frames 1854.3.6 Working with Representations 187

4.4 Frames in WebGL 189

4.5 Matrix and Vector Types 1934.5.1 Row Versus Column Major Matrix Representations 195

4.6 Modeling a Colored Cube 1954.6.1 Modeling the Faces 1964.6.2 Inward- and Outward-Pointing Faces 1974.6.3 Data Structures for Object Representation 1984.6.4 The Colored Cube 1984.6.5 Color Interpolation 2004.6.6 Displaying the Cube 2014.6.7 Drawing by Elements 2024.6.8 Primitive Restart 203

4.7 Affine Transformations 204

Angel 8/e second galleys 2019/4/4 11:00 p. x (front) Windfall Software, PCA ZzTEX 17.7

Page 11: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Contents xi

4.8 Translation, Rotation, and Scaling 2074.8.1 Translation 2074.8.2 Rotation 2074.8.3 Scaling 209

4.9 Transformations in Homogeneous Coordinates 2114.9.1 Translation 2124.9.2 Scaling 2134.9.3 Rotation 2144.9.4 Shear 215

4.10 Concatenation of Transformations 2174.10.1 Rotation About a Fixed Point 2184.10.2 General Rotation 2194.10.3 The Instance Transformation 2204.10.4 Rotation About an Arbitrary Axis 222

4.11 Transformation Matrices in WebGL 2264.11.1 Current Transformation Matrices 2274.11.2 Basic Matrix Functions 2284.11.3 Rotation, Translation, and Scaling 2294.11.4 Rotation About a Fixed Point 2294.11.5 Order of Transformations 230

4.12 Spinning of the Cube 2314.12.1 Uniform Matrices 233

4.13 Smooth Rotations 2354.13.1 Incremental Rotation 236

4.14 Quaternions 2374.14.1 Complex Numbers and Quaternions 2374.14.2 Quaternions and Rotation 2384.14.3 Quaternions and Gimbal Lock 240

4.15 Interfaces to Three-Dimensional Applications 2424.15.1 Using Areas of the Screen 2424.15.2 A Virtual Trackball 2434.15.3 Implementing the Trackball with Quaternions 245

Summary and Notes 247

Code Examples 247

Suggested Readings 248

Exercises 248

CHAPTER 5 VIEWING 253

5.1 Classical and Computer Viewing 2535.1.1 Classical Viewing 255

Angel 8/e second galleys 2019/4/4 11:00 p. xi (front) Windfall Software, PCA ZzTEX 17.7

Page 12: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

xii Contents

5.1.2 Orthographic Projections 2555.1.3 Axonometric Projections 2565.1.4 Oblique Projections 2585.1.5 Perspective Viewing 259

5.2 Viewing with a Computer 260

5.3 Positioning of the Camera 2625.3.1 From the Object Frame to the Camera Frame 2625.3.2 Two Viewing APIs 2675.3.3 The Look-At Function 271

5.4 Parallel Projections 2725.4.1 Orthogonal Projections 2745.4.2 Parallel Viewing with WebGL 2755.4.3 Projection Normalization 2765.4.4 Orthogonal Projection Matrices 2775.4.5 Oblique Projections 2795.4.6 An Interactive Viewer 282

5.5 Perspective Projections 2845.5.1 Simple Perspective Projections 285

5.6 Perspective Projections with WebGL 2885.6.1 Perspective Functions 289

5.7 Perspective Projection Matrices 2905.7.1 Perspective Normalization 2915.7.2 WebGL Perspective Transformations 2945.7.3 Perspective Example 296

5.8 Hidden-Surface Removal 2965.8.1 Culling 298

5.9 Displaying Meshes 2995.9.1 Displaying Meshes as Surfaces 3025.9.2 Polygon Offset 3045.9.3 Walking Through a Scene 305

5.10 Projections and Shadows 3065.10.1 Projected Shadows 306

5.11 Shadow Maps 310

Summary and Notes 312

Code Examples 313

Suggested Readings 313

Exercises 313

CHAPTER 6 LIGHTING AND SHADING 317

6.1 Light and Matter 318

Angel 8/e second galleys 2019/4/4 11:00 p. xii (front) Windfall Software, PCA ZzTEX 17.7

Page 13: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Contents xiii

6.2 Light Sources 3216.2.1 Color Sources 3226.2.2 Ambient Light 3226.2.3 Point Sources 3236.2.4 Spotlights 3246.2.5 Distant Light Sources 325

6.3 The Phong Lighting Model 3266.3.1 Ambient Reflection 3286.3.2 Diffuse Reflection 3296.3.3 Specular Reflection 3306.3.4 The Modified Phong Model 333

6.4 Computation of Vectors 3346.4.1 Normal Vectors 3346.4.2 Angle of Reflection 336

6.5 Polygonal Shading 3386.5.1 Flat Shading 3396.5.2 Smooth and Gouraud Shading 3396.5.3 Phong Shading 341

6.6 Approximation of a Sphere by Recursive Subdivision 343

6.7 Specifying Lighting Parameters 3466.7.1 Light Sources 3466.7.2 Materials 347

6.8 Implementing a Lighting Model 3486.8.1 Applying the Lighting Model in the Application 3486.8.2 Efficiency 3516.8.3 Lighting in the Vertex Shader 353

6.9 Shading of the Sphere Model 357

6.10 Per-Fragment Lighting 359

6.11 Nonphotorealistic Shading 361

6.12 Global Illumination 363

Summary and Notes 364

Code Examples 365

Suggested Readings 366

Exercises 366

CHAPTER 7 TEXTURE MAPPING 369

7.1 Buffers 369

7.2 Digital Images 371

7.3 Mapping Methods 375

Angel 8/e second galleys 2019/4/4 11:00 p. xiii (front) Windfall Software, PCA ZzTEX 17.7

Page 14: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

xiv Contents

7.4 Two-Dimensional Texture Mapping 377

7.5 Texture Mapping in WebGL 3847.5.1 Texture Objects 3847.5.2 The Texture Image Array 3857.5.3 Texture Coordinates and Samplers 3867.5.4 Texture Sampling 3917.5.5 Working with Texture Coordinates 3957.5.6 3D Texture Mapping 3977.5.7 Multitexturing 403

7.6 Environment Maps 407

7.7 Reflection Map Example 412

7.8 Bump Mapping 4177.8.1 Finding Bump Maps 4187.8.2 Bump Map Example 421

Summary and Notes 425

Code Examples 427

Suggested Readings 427

Exercises 427

CHAPTER 8 WORKING WITH FRAMEBUFFERS 429

8.1 Blending Techniques 4298.1.1 Opacity and Blending 4298.1.2 Image Blending 4318.1.3 Blending in WebGL 4318.1.4 Antialiasing Revisited 4338.1.5 Back-to-Front and Front-to-Back Rendering 4358.1.6 Scene Antialiasing and Multisampling 436

8.2 Image Processing 4368.2.1 Other Multipass Methods 438

8.3 GPGPU 439

8.4 Framebuffer Objects 443

8.5 Multi-pass Rendering Techniques 4498.5.1 Ambient Occlusion 4508.5.2 Deferred Lighting 451

8.6 Buffer Ping-Ponging 452

8.7 Picking 455

8.8 Shadow Maps 460

8.9 Projective Textures 464

Summary and Notes 466

Angel 8/e second galleys 2019/4/4 11:00 p. xiv (front) Windfall Software, PCA ZzTEX 17.7

Page 15: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Contents xv

Code Examples 467

Suggested Readings 468

Exercises 468

CHAPTER 9 MODELING AND HIERARCHY 471

9.1 Geometries and Instances 472

9.2 Hierarchical Models 474

9.3 A Robot Arm 476

9.4 Trees and Traversal 4809.4.1 A Stack-Based Traversal 481

9.5 Use of Tree Data Structures 485

9.6 Animation 489

9.7 Graphical Objects 4909.7.1 Methods, Attributes, and Messages 4919.7.2 A Cube Object 4929.7.3 Instancing in WebGL 4969.7.4 Objects and Hierarchy 4989.7.5 Geometric and Nongeometric Objects 499

9.8 Scene Graphs 500

9.9 Implementing Scene Graphs 5029.9.1 three.js Examples 504

9.10 Other Tree Structures 5089.10.1 CSG Trees 5089.10.2 BSP Trees 5109.10.3 Quadtrees and Octrees 512

Summary and Notes 514

Code Examples 515

Suggested Readings 515

Exercises 516

CHAPTER 10 PROCEDURAL METHODS 519

10.1 Algorithmic Models 519

10.2 Physically Based Models and Particle Systems 521

10.3 Newtonian Particles 52210.3.1 Independent Particles 52410.3.2 Spring Forces 52410.3.3 Attractive and Repulsive Forces 526

10.4 Solving Particle Systems 527

10.5 Constraints 530

Angel 8/e second galleys 2019/4/4 11:00 p. xv (front) Windfall Software, PCA ZzTEX 17.7

Page 16: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

xvi Contents

10.5.1 Collisions 53010.5.2 Soft Constraints 533

10.6 A Simple Particle System 53310.6.1 Displaying the Particles 53410.6.2 Updating Particle Positions 53510.6.3 Collisions 53510.6.4 Forces 53610.6.5 Flocking 537

10.7 Agent-Based Models 538

10.8 Using Point Sprites 541

10.9 Language-Based Models 545

10.10 Recursive Methods and Fractals 55010.10.1 Rulers and Length 55110.10.2 Fractal Dimension 55210.10.3 Midpoint Division and Brownian Motion 55410.10.4 Fractal Mountains 55510.10.5 The Mandelbrot Set 55610.10.6 Mandelbrot Fragment Shader 559

10.11 Procedural Noise 561

Summary and Notes 563

Code Examples 565

Suggested Readings 566

Exercises 566

CHAPTER 11 CURVES AND SURFACES 569

11.1 Representation of Curves and Surfaces 56911.1.1 Explicit Representation 56911.1.2 Implicit Representations 57111.1.3 Parametric Form 57211.1.4 Parametric Polynomial Curves 57311.1.5 Parametric Polynomial Surfaces 574

11.2 Design Criteria 575

11.3 Parametric Cubic Polynomial Curves 578

11.4 Interpolation 57911.4.1 Blending Functions 58111.4.2 The Cubic Interpolating Patch 582

11.5 Hermite Curves and Surfaces 58411.5.1 The Hermite Form 58411.5.2 Geometric and Parametric Continuity 587

11.6 Bezier Curves and Surfaces 588

Angel 8/e second galleys 2019/4/4 11:00 p. xvi (front) Windfall Software, PCA ZzTEX 17.7

Page 17: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Contents xvii

11.6.1 Bezier Curves 58811.6.2 Bezier Surface Patches 591

11.7 Cubic B-Splines 59211.7.1 The Cubic B-Spline Curve 59311.7.2 B-Splines and Basis 59711.7.3 Spline Surfaces 597

11.8 General B-Splines 59811.8.1 Recursively Defined B-Splines 59911.8.2 Uniform Splines 60111.8.3 Nonuniform B-Splines 60111.8.4 NURBS 60211.8.5 Catmull-Rom Splines 603

11.9 Rendering Curves and Surfaces 60411.9.1 Polynomial Evaluation Methods 60511.9.2 Recursive Subdivision of Bezier Polynomials 60611.9.3 Rendering Other Polynomial Curves by Subdivision 60911.9.4 Subdivision of Bezier Surfaces 610

11.10 The Utah Teapot 611

11.11 Algebraic Surfaces 61411.11.1 Quadrics 61411.11.2 Rendering of Surfaces by Ray Casting 615

11.12 Subdivision Curves and Surfaces 61511.12.1 Mesh Subdivision 616

11.13 Mesh Generation from Data 61911.13.1 Height Fields Revisited 61911.13.2 Delaunay Triangulation 62011.13.3 Point Clouds 624

11.14 Graphics API support for Curves and Surfaces 62411.14.1 Tessellation Shading 62511.14.2 Geometry Shading 626

Summary and Notes 626

Code Examples 627

Suggested Readings 627

Exercises 627

CHAPTER 12 FROM GEOMETRY TO PIXELS 631

12.1 Basic Rendering Strategies 632

12.2 Rendering Pipeline 63412.2.1 Modeling 63412.2.2 Geometry Processing 635

Angel 8/e second galleys 2019/4/4 11:00 p. xvii (front) Windfall Software, PCA ZzTEX 17.7

Page 18: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

xviii Contents

12.2.3 Rasterization 63612.2.4 Fragment Processing 637

12.3 Clipping 63812.3.1 Clipping 63812.3.2 Bounding Boxes and Volumes 63912.3.3 Clipping Against Planes 640

12.4 Rasterization 642

12.5 Polygon Rasterization 64512.5.1 Inside–Outside Testing 64612.5.2 WebGL and Concave Polygons 647

12.6 Hidden-Surface Removal 64912.6.1 Object-Space and Image-Space Approaches 64912.6.2 Sorting and Hidden-Surface Removal 65112.6.3 Scan Line Algorithms 65112.6.4 Back-Face Removal 65312.6.5 The z-Buffer Algorithm 65512.6.6 Depth Sort and the Painter’s Algorithm 657

12.7 Hardware Implementations 660

12.8 Antialiasing 663

12.9 Display Considerations 66612.9.1 Color Systems 66612.9.2 The Color Matrix 66912.9.3 Gamma Correction 67112.9.4 Dithering and Halftoning 671

Summary and Notes 672

Suggested Readings 674

Exercises 675

CHAPTER 13 ADVANCED RENDERING 679

13.1 Going Beyond Pipeline Rendering 679

13.2 Ray Tracing 680

13.3 Building a Simple Ray Tracer 68413.3.1 Recursive Ray Tracing 68513.3.2 Calculating Intersections 68613.3.3 Ray-Tracing Variations 689

13.4 The Rendering Equation 690

13.5 Global Illumination and Path Tracing 693

13.6 RenderMan 695

13.7 Parallel Rendering 696

Angel 8/e second galleys 2019/4/4 11:00 p. xviii (front) Windfall Software, PCA ZzTEX 17.7

Page 19: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Contents xix

13.7.1 Sort-Middle Rendering 69913.7.2 Sort-Last Rendering 69913.7.3 Sort-First Rendering 703

13.8 Implicit Functions and Contour Maps 70413.8.1 Marching Squares 70413.8.2 Marching Triangles 709

13.9 Volume Rendering 71013.9.1 Volumetric Data Sets 71113.9.2 Visualization of Implicit Functions 712

13.10 Isosurfaces and Marching Cubes 714

13.11 Marching Tetrahedra 716

13.12 Mesh Simplification 717

13.13 Direct Volume Rendering 71913.13.1 Assignment of Color and Opacity 71913.13.2 Splatting 72013.13.3 Volume Ray Tracing 72213.13.4 Texture Mapping of Volumes 723

13.14 Image-Based Rendering 72313.14.1 Distance from Stereo Pairs 72413.14.2 The Fundamental Matrix 727

13.15 Virtual, Augmented, and Mixed Reality 727

13.16 A Final Example 729

Summary and Notes 731

Suggested Readings 732

Exercises 733

APPENDIX A INITIALIZING SHADERS 735

A.1 Shaders in the HTML file 735

A.2 Reading Shaders from Source Files 738

APPENDIX B SPACES 741

B.1 Scalars 741

B.2 Vector Spaces 742

B.3 Affine Spaces 744

B.4 Euclidean Spaces 747

B.5 Projections 747

B.6 Gram-Schmidt Orthogonalization 748

Suggested Readings 749

Exercises 749

Angel 8/e second galleys 2019/4/4 11:00 p. xix (front) Windfall Software, PCA ZzTEX 17.7

Page 20: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

xx Contents

APPENDIX C MATRICES 751

C.1 Definitions 751

C.2 Matrix Operations 752

C.3 Row and Column Matrices 753

C.4 Rank 754

C.5 Change of Representation 755

C.6 The Cross Product 757

C.7 Eigenvalues and Eigenvectors 757

C.8 Vector and Matrix Objects 759

Suggested Readings 759

Exercises 760

APPENDIX D SAMPLING AND ALIASING 761

D.1 Sampling Theory 761

D.2 Reconstruction 766

D.3 Quantization 768

Suggested Readings 769

References 771

Angel 8/e second galleys 2019/4/4 11:00 p. xx (front) Windfall Software, PCA ZzTEX 17.7

Page 21: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

PREFACE

This book is an introduction to computer graphics with an emphasis on applica-tions programming. The first edition, which was published in 1997, was some-

what revolutionary in using OpenGL and a top-down approach. Over the succeeding22 years and seven editions, this approach has been adopted by most introductoryclasses in computer graphics and by virtually all the competing textbooks.

A Top-Down ApproachRecent advances and the success of the first seven editions continue to reinforce ourbelief in a top-down, programming-oriented approach to introductory computergraphics. Although many computer science and engineering departments now sup-port more than one course in computer graphics, most students will take only asingle course. Such a course usually is placed in the curriculum after students have al-ready studied programming, data structures, algorithms, software engineering, andbasic mathematics. Consequently, a class in computer graphics allows the instruc-tor to build on these topics in a way that can be both informative and fun. We wantthese students to be programming three-dimensional applications as soon as possi-ble. Low-level algorithms, such as those that draw lines or fill polygons, can be dealtwith later, after students are creating graphics.

When asked “why teach programming?,” John Kemeny, a pioneer in computereducation, used a familiar automobile analogy: You don’t have to know what’s underthe hood to be literate, but unless you know how to program, you’ll be sitting in theback seat instead of driving. That same analogy applies to the way we teach computergraphics. One approach—the algorithmic approach—is to teach everything aboutwhat makes a car function: the engine, the transmission, the combustion process.A second approach—the survey approach—is to hire a chauffeur, sit back, and seethe world as a spectator. The third approach—the programming approach that wehave adopted here—is to teach you how to drive and how to take yourself whereveryou want to go. As an old auto rental commercial used to say, “Let us put you in thedriver’s seat.”

The sixth and seventh editions reflected the major changes in graphics appli-cation development due to advances in graphics hardware. In particular, the sixthedition was fully shader-based, enabling readers to create applications that couldfully exploit the capabilities of modern GPUs. We noted that these changes werepart of OpenGL ES 2.0, which was being used to develop applications for embed-ded systems and handheld devices, such as cell phones and tablets, and of WebGL,its JavaScript implementation. At the time, we did not anticipate the extraordinary

xxi

Angel 8/e second galleys 2019/4/4 11:00 p. xxi (front) Windfall Software, PCA ZzTEX 17.7

Page 22: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

xxii Preface

interest in WebGL that began as soon as web browsers became available that sup-port WebGL through HTML5. For the seventh edition, we switched from desktopOpenGL to WebGL.

As we noted then, WebGL applications were running everywhere, including onsome of the latest smart phones, and even though WebGL lacks some of the advancedfeatures of the latest versions of OpenGL, the ability to integrate it with HTML5opened up a wealth of new application areas. As an added benefit, we found it muchbetter suited than desktop OpenGL for teaching computer graphics. Our hopes forthe seventh edition were more than fulfilled. WebGL has proven to be excellent APIfor both teaching and developing real applications that run on all platforms.

In particular, features of the seventh edition included:

WebGL 1.0 was used for all examples and programs.

All code was written in JavaScript.

All code runs in recent web browsers.

A new chapter on interaction was added.

Additional material on render-to-texture was added.

Additional material on displaying meshes also was added.

An efficient matrix–vector package was included.

An introduction to agent-based modeling was added.

For the eighth edition, building on the success of using WebGL, we have:

Updated all examples and programs to WebGL 2.0.

Added many additional examples.

Switched to a fully electronic version that includes links to examples so theycan be viewed with the code while reading.

Expanded coverage of render-to-texture in a separate chapter that includesnew topics, including shadow maps and projective textures.

Added coverage of three-dimensional texture mapping.

Updated the chapter on modeling to include an introduction to three.js, apopular higher-level JavaScript scene-graph API.

Added coverage of point sprites for simulation.

Expanded and updated our coverage of rendering.

Enhanced discussions of hardware implementation and GPU architectures.

Programming with WebGL and JavaScriptWhen Ed began teaching computer graphics 35 years ago, the greatest impedimentto implementing a programming-oriented course, and to writing a textbook for thatcourse, was the lack of a widely accepted graphics library or application programminginterface (API). Difficulties included high cost, limited availability, lack of generality,and high complexity. The development of OpenGL resolved most of the difficulties

Angel 8/e second galleys 2019/4/4 11:00 p. xxii (front) Windfall Software, PCA ZzTEX 17.7

Page 23: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Preface xxiii

many of us had experienced with other APIs and with the alternative of using home-brewed software. OpenGL today is supported on all platforms and is widely acceptedas the cross-platform standard. WebGL builds on OpenGL’s wide acceptance (it’seffectively the same API), but provides a more accessible development platform usingweb technologies.

A graphics class teaches far more than the use of a particular API, but a goodAPI makes it easier to teach key graphics topics, including three-dimensional trans-formations, lighting and shading, client–server graphics, modeling, and implemen-tation algorithms. We believe that OpenGL’s extensive capabilities and well-definedarchitecture lead to a stronger foundation for teaching both theoretical and practicalaspects of the field and for teaching advanced concepts, including texture mapping,compositing, and programmable shaders.

Ed switched his classes to OpenGL about 24 years ago and the results as-tounded him. By the middle of the semester, every student was able to write amoderately complex three-dimensional application that required understanding ofthree-dimensional viewing and event-driven input. In the previous years of teachingcomputer graphics, he had never come even close to this result. That class led to thefirst edition of this book.

This book is a textbook on computer graphics; it is not an OpenGL or WebGLmanual. Consequently, it does not cover all aspects of the WebGL API but ratherexplains only what is necessary for mastering this book’s contents. It presents WebGLat a level that should permit users of other APIs to have little difficulty with thematerial.

Unlike earlier editions, this one uses WebGL and JavaScript for all the examples.WebGL 2.0 is a JavaScript implementation of OpenGL ES 3.0 and runs in most recentbrowsers. Because it is supported by HTML5, not only does it provide compatibilitywith other applications but also there are no platform dependences; WebGL runswithin the browser and makes use of the local graphics hardware. Although JavaScriptis not the usual programming language with which we teach most programmingcourses, it is the language of the Web. Over the past few years, JavaScript has becomeincreasingly more powerful, and our experience is that students who are comfortablewith Java, Python, C, or C++ will have little trouble programming in JavaScript.So that we can continue to support a wide audience with varied backgrounds, wehave kept with a very basic JavaScript requiring only ES5. Students who have moreexperience with JavaScript should have little trouble updating our examples andlibraries to exploit powerful new JavaScript features contained in ES6.

All the modern versions of OpenGL, including WebGL, require every applica-tion to provide two shaders written in the OpenGL Shading Language (GLSL). GLSLis similar to C but adds vectors and matrices as basic types, along with some C++features, such as operator overloading. We provide a JavaScript library, MV.js, thatsupports both our presentation of graphics functions and the types and operationsin GLSL. It also contains many functions that perform operations equivalent to dep-recated functions from the earlier fixed-function versions of OpenGL.

Angel 8/e second galleys 2019/4/4 11:00 p. xxiii (front) Windfall Software, PCA ZzTEX 17.7

Page 24: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

xxiv Preface

Intended AudienceThis book is suitable for advanced undergraduates and first-year graduate studentsin computer science and engineering and for students in other disciplines who havegood programming skills. The book also will be useful to many professionals. Be-tween us, we have taught well over 100 short courses for professionals (includingmany courses presented at the annual SIGGRAPH conferences, two of which areavailable on YouTube within the SIGGRAPH University channel), and even a MassiveOnline Course (MOOC) with Coursera. Our experiences with these nontraditionalstudents have had a great influence on what we chose to include in the book.

Prerequisites for the book are good programming skills in JavaScript, Python,C, C++, or Java; an understanding of basic data structures (arrays, linked lists, trees);and a rudimentary knowledge of linear algebra and trigonometry. We have found thatthe mathematical backgrounds of computer science students, whether undergradu-ates or graduates, vary considerably. Hence, we have chosen to integrate into the textmuch of the linear algebra and geometry that is required for fundamental computergraphics.

Organization of the BookThe book is organized as follows:

Chapter 1 provides an overview of the field and introduces image formationby optical devices; thus, we start with three-dimensional concepts immedi-ately.

Chapter 2 introduces programming using WebGL. Although the first exampleprogram that we develop (each chapter has one or more complete program-ming examples) is two-dimensional, it is embedded in a three-dimensionalsetting and leads to a three-dimensional extension.

Chapter 3 introduces interactive graphics and develops event-driven graphicswithin the browser environment.

Chapters 4 and 5 concentrate on three-dimensional concepts. Chapter 4is concerned with defining and manipulating three-dimensional objects,whereas Chapter 5 is concerned with viewing them.

Chapter 6 introduces light–material interactions and shading.

Chapters 7 and 8 introduce many of the new discrete capabilities that are nowsupported in graphics hardware and by WebGL. All these techniques involveworking with various buffers. Chapter 7 focuses on classical texture mappingwith a single texture, whereas Chapter 8 concentrates on texture mappingusing off-screen buffers.

These chapters should be covered in order and can be taught in about 10 weeks of a15-week semester.

The last five chapters can be read in almost any order. All five are somewhatopen-ended and can be covered at a survey level, or individual topics can be pursuedin depth.

Angel 8/e second galleys 2019/4/4 11:00 p. xxiv (front) Windfall Software, PCA ZzTEX 17.7

Page 25: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Preface xxv

Chapter 9 includes a number of topics that fit loosely under the heading ofhierarchical modeling. The topics range from building models that encapsu-late the relationships between the parts of a model, to high-level approachesto graphics over the Internet. Chapter 9 also includes an introduction to scenegraphs.

Chapter 10 introduces a number of procedural methods, including particlesystems, fractals, and procedural noise.

Chapter 11 discussed curves and surfaces, including subdivision surfaces.

Chapter 12 surveys implementations. It gives one or two major algorithms foreach of the basic steps, including clipping, line generation, and polygon fill.

Finally, Chapter 13 surveys alternate approaches to rendering. It includesexpanded discussions of ray tracing and radiosity, and an introduction toimage-based rendering, parallel rendering, and concepts of virtual and aug-mented reality.

Several appendices are included to provide additional reference:

Appendix A presents the details of the WebGL functions needed to read,compile, and link the application and shaders.

Appendices B and C contain a review of the background mathematics.

Appendix D discusses sampling and aliasing starting with Nyquist’s theoremand applying these results to computer graphics.

Changes from the Seventh EditionThe reaction of readers to the first seven editions of this book was overwhelminglypositive, especially to the use of OpenGL/WebGL and the top-down approach. In thesixth edition, we abandoned the fixed-function pipeline and went to full shader-basedOpenGL. In the seventh edition, we moved to WebGL, which is not only fully shaderbased—each application must provide a vertex shader and a fragment shader—butalso a version that works within the latest web browsers.

Moving to an only online format for this edition allowed us make some inter-esting, and, we think, positive changes. First, all the figures are now in full color.We have moved the images from the color insert into regular figures in the chap-ters, which places them where they should be. We were also able to add screenshots from our examples as regular figures. The URLs for these examples are inthe figure captions. Thus, students will be able to use the URL to open anotherbrowser window to run the example. Most browsers will also let the student ex-amine the full code in another window. We believe these features will greatly en-hance the examples. We have also added many new examples to the book’s website(www.interactivecomputergraphics.com/Code), which are accessible through links atthe end of each chapter.

For this edition, we updated all our code to use WebGL 2.0. Although we intro-duce few additional WebGL 2.0 features—three-dimensional texture mapping being

Angel 8/e second galleys 2019/4/4 11:00 p. xxv (front) Windfall Software, PCA ZzTEX 17.7

Page 26: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

xxvi Preface

an exception—the newer version of GLSL results in much clearer shader code. For ex-amples that do not use new features, we will keep WebGL 1.0 versions on the book’swebsite.

Applications are written in JavaScript. Although JavaScript has its own idiosyn-crasies and may not be the language used in students’ programming courses, we havenot observed any problems with students using JavaScript. JavaScript has many vari-ants, which students and instructors may prefer to use. In addition, there are manyways to develop code in other languages and use a transpiler to produce JavaScript.Because many of these options are new and perhaps transient, we have stuck with avery basic JavaScript that should run everywhere.

We have added additional material on off-screen rendering and render-to-texture, including techniques such as projective textures and shadow maps. Wehave also added material on using GPUs for a variety of compute-intensive appli-cations, such as image processing and simulation. We have also added coverage ofthree-dimensional texture, an added feature in WebGL 2.0, and its use for volumevisualization. Because of the large amount of added material, we split the formerChapter 7 into two chapters: 7 and 8.

Given the positive feedback we have received on the core material from Chap-ters 1–6 in previous editions, other than updating the code to WebGL 2.0, we havetried to keep the changes to those chapters to a minimum. We see Chapters 1–8 asthe core of any introductory course in computer graphics. Chapters 9–13 can be usedin almost any order, either as a survey in a one-semester course or as the basis of atwo-semester sequence.

Chapter 9 has been updated to be more consistent with three.js scene graphs, andincludes a short introduction to the three.js API. Chapter 11 adds material on usingpoint sprites in particle simulations.

Chapter 11 is largely unchanged. Material on implementation that was formerlyin Chapter 8 in the seventh edition has been moved to Chapter 12. As interesting aswe find many of the classic algorithms for tasks such as line generation and clipping,this material is no longer a core part of most first courses on Computer Graphics. Wehave kept the parts of the chapter that are still highly relevant and taken out partsthat are no longer used in modern GPUs. Chapter 13 (formerly Chapter 12) has beenupdated to cover some additional approaches to rendering such as deferred shading.

AcknowledgmentsEd has been fortunate over the past few years to have worked with wonderful studentsat the University of New Mexico. They were the first to get him interested in OpenGL,and he has learned much from them. They include Ye Cong, Pat Crossno, TommieDaniel, Chris Davis, Lisa Desjarlais, Kim Edlund, Lee Ann Fisk, Maria Gallegos,Brian Jones, Christopher Jordan, Takeshi Hakamata, Max Hazelrigg, Sheryl Hurley,Thomas Keller, Ge Li, Pat McCormick, Al McPherson, Ken Moreland, Martin Muller,David Munich, Jim Pinkerton, Jim Prewett, Dave Rogers, Hal Smyer, Dave Vick, Hue(Bumgarner-Kirby) Walker, Brian Wylie, and Jin Xiong.

Many of the examples in the color plates were created by these students.

Angel 8/e second galleys 2019/4/4 11:00 p. xxvi (front) Windfall Software, PCA ZzTEX 17.7

Page 27: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Preface xxvii

The first edition of this book was written during Ed’s sabbatical; various partswere written in five different countries. The task would not have been accomplishedwithout the help of a number of people and institutions that made their facilitiesavailable to him. He is greatly indebted to Jonas Montilva and Chris Birkbeck ofthe Universidad de los Andes (Venezuela), to Rodrigo Gallegos and Aristides Novoaof the Universidad Tecnologica Equinoccial (Ecuador), to Long Wen Chang of theNational Tsing Hua University (Taiwan), and to Kim Hong Wong and Pheng AnnHeng of the Chinese University of Hong Kong. Ramiro Jordan of ISTEC and theUniversity of New Mexico made possible many of these visits. John Brayer and JasonStewart at the University of New Mexico and Helen Goldstein at Addison-Wesleysomehow managed to get a variety of items to him wherever he happened to be. Hiswebsite contains a description of his adventures writing the first edition.

David Kirk and Mark Kilgard at NVIDIA were kind enough to provide graphicscards for testing many of the algorithms. A number of other people provided sig-nificant help. Ed thanks Ben Bederson, Gonzalo Cartagenova, Tom Caudell, KathiCollins, Kathleen Danielson, Roger Ehrich, Robert Geist, Chuck Hansen, MarkHenne, Bernard Moret, Dick Nordhaus, Helena Saona, Vicki Shreiner, Gwen Syl-van, and Mason Woo. Mark Kilgard, Brian Paul, and Nate Robins are owed a greatdebt by the OpenGL community for creating software that enables OpenGL code tobe developed over a variety of platforms. Our many SIGGRAPH courses have con-tributed to our ideas and presentations. Eric Haines (NVIDIA) and Patrick Cozzi(Analytic Graphics) have been especially helpful as reviewers, sounding boards, andco-presenters.

At the University of New Mexico, the Art, Research, Technology, and ScienceLaboratory (ARTS Lab) and the Center for High Performance Computing have pro-vided support for many of Ed’s projects. The Computer Science Department, theArts Technology Center in the College of Fine Arts, the National Science Foundation,Sandia National Laboratories, and Los Alamos National Laboratory have supportedmany of Ed’s students and research projects that led to parts of this book. David Bein-ing, formerly with the Lodestar Astronomy Center and now at the ARTS Lab, hasprovided tremendous support for the Fulldome Project. Sheryl Hurley, ChristopherJordan, Laurel Ladwig, Jon Strawn, and Hue (Bumgarner-Kirby) Walker providedsome of the images in the color plates through Fulldome projects. Hue Walker hasdone the wonderful covers for previous editions and some of the examples.

Ed would also like to acknowledge the informal group that started at the SantaFe Complex and has continued with Redfish and Simtable, including Jeff Bowles,Ruth Chabay, Emma Gould, Stephen Guerin, Kaz Manavi, Bruce Sherwood, ScottWittenberg, and especially JavaScript evangelist Owen Densmore, who convincedhim to teach a graphics course in Santa Fe in exchange for getting him involved withJavaScript. We have all gained by the experience.

Dave would like first to thank Ed for asking him to participate in this project.We have exchanged ideas on OpenGL and how to teach it for many years, and it’sexciting to advance those concepts to new audiences. Dave would also like to thankthose who created OpenGL, and who worked at Silicon Graphics Computer Systems,leading the way in their day. He would like to recognize the various Khronos workinggroups who continue to evolve the API and bring graphics to unexpected places.

Angel 8/e second galleys 2019/4/4 11:00 p. xxvii (front) Windfall Software, PCA ZzTEX 17.7

Page 28: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

xxviii Preface

Finally, as Ed mentioned, SIGGRAPH has featured prominently in the developmentof these materials, and is definitely owed a debt of gratitude for providing access toenthusiastic test subjects for exploring our ideas.

Reviewers of the manuscript drafts and instructors who have used previous edi-tions provided a variety of viewpoints on what we should include and what level ofpresentation we should use. These reviewers and instructors include Gur Saran Ad-har (University of North Carolina at Wilmington), Mario Agrular (Jacksonville StateUniversity), Michael Anderson (University of Hartford), Norman I. Badler (Univer-sity of Pennsylvania), Mike Bailey (Oregon State University), Marty Barrett (EastTennessee State University), C. S. Bauer (University of Central Florida), BedrichBenes (Purdue University), Kabekode V. Bhat (The Pennsylvania State University),Isabelle Bichindaritz (University of Washington, Tacoma), Cory D. Boatright (Uni-versity of Pennsylvania), Eric Brown, Robert P. Burton (Brigham Young University),Sam Buss (University of California, San Diego), Kai H. Chang (Auburn University),Patrick Cozzi (University of Pennsylvania and Analytic Graphics, Inc), James Cre-mer (University of Iowa), Ron DiNapoli (Cornell University), John David N. Dionisio(Loyola Marymount University), Eric Alan Durant (Milwaukee School of Engineer-ing), David S. Ebert (Purdue University), Richard R. Eckert (Binghamton University),W. Randolph Franklin (Rensselaer Polytechnic Institute), Natacha Gueorguieva (CityUniversity of New York/College of Staten Island), Jianchao (Jack) Han (CaliforniaState University, Dominguez Hills), Chenyi Hu (University of Central Arkansas),George Kamberov (Stevens Institute of Technology), Mark Kilgard (NVIDIA Cor-poration), Lisa B. Lancor (Southern Connecticut State University), Chung Lee (Cal-ifornia State Polytechnic University, Pomona), John L. Lowther (Michigan Tech-nological University), R. Marshall (Boston University and Bridgewater State Col-lege), Hugh C. Masterman (University of Massachusetts, Lowell), Bruce A. Maxwell(Swathmore College), Tim McGraw (West Virginia University), James R. Miller (Uni-versity of Kansas), Rodrigo Obando (Columbus State University), Jeff Parker (Har-vard University), Jon A. Preston (Southern Polytechnic State University), HaraldSaleim (Bergen University College), Andrea Salgian (The College of New Jersey),Lori L. Scarlatos (Brooklyn College, CUNY), Han-Wei Shen (The Ohio State Uni-versity), Oliver Staadt (University of California, Davis), Stephen L. Stepoway (South-ern Methodist University), Bill Toll (Taylor University), Michael Wainer (South-ern Illinois University, Carbondale), Yang Wang (Southern Methodist State Univer-sity), Steve Warren (Kansas State University), Mike Way (Florida Southern College),George Wolberg (City College of New York), Xiaoyu Zhang (California State Uni-versity San Marcos), Ye Zhao (Kent State University), and Ying Zhu (Georgia StateUniversity). Although the final decisions may not reflect their views—which oftendiffered considerably from one another—each one forced us to reflect on every pageof the manuscript.

We would also like to acknowledge the entire production team at Addison-Wesley. Ed’s editors, Peter Gordon, Maite Suarez-Rivas, and Matt Goldstein, havebeen a pleasure to work with through eight editions of this book and the OpenGLprimer. For this edition, Carole Snyder at Pearson has provided considerable help.Starting with the second edition, Paul Anagnostopoulos at Windfall Software has al-ways been more than helpful in assisting with TEX problems. Ed is especially grateful

Angel 8/e second galleys 2019/4/4 11:00 p. xxviii (front) Windfall Software, PCA ZzTEX 17.7

Page 29: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Preface xxix

to Lyn Dupre. If the readers could see the original draft of the first edition, they wouldunderstand the wonders that Lyn does with a manuscript.

Ed wants to particularly recognize his wife, Rose Mary Molnar, who did thefigures for his first graphics book, many of which form the basis for the figuresin this book. Probably only other authors can fully appreciate the effort that goesinto the book production process and the many contributions and sacrifices ourpartners make to that effort. The dedication to this book is a sincere but inadequaterecognition of all of Rose Mary’s contributions to Ed’s work.

Dave would like to recognize the support and encouragement of Vicki, his wife,without whom creating works like this would never occur. Not only does she pro-vide warmth and companionship but also invaluable feedback on our presentationand materials. She’s been a valuable, unrecognized partner in all of Dave’s OpenGLendeavors.

Ed AngelDave Shreiner

Angel 8/e second galleys 2019/4/4 11:00 p. xxix (front) Windfall Software, PCA ZzTEX 17.7

Page 30: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Angel 8/e second galleys 2019/4/4 11:00 p. xxx (front) Windfall Software, PCA ZzTEX 17.7

Page 31: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Preface xxxi

INTERACTIVE COMPUTER GRAPHICS

8TH EDITION

Angel 8/e second galleys 2019/4/4 11:00 p. xxxi (front) Windfall Software, PCA ZzTEX 17.7

Page 32: INTERACTIVE COMPUTER GRAPHICS...INTERACTIVE COMPUTER GRAPHICS 8 TH EDITION EDWARD ANGEL University of New Mexico DAVE SHREINER ARM, Inc. Angel 8/e second galleys 2019/4/4 11:00 …

Angel 8/e second galleys 2019/4/4 11:00 p. xxxii (front) Windfall Software, PCA ZzTEX 17.7