Computer animation and graphics–once rare, complicated, and comparatively expensive–are now prevalent in everyday life from the computer screen to the movie screen. <b> <i>Interactive Computer Graphics </i> </b>is the only introduction to computer graphics text for undergraduates that fully inte
Interactive computer graphics: a top-down approach using OpenGL
✍ Scribed by Angel, Edward
- Publisher
- Pearson/Addison-Wesley
- Year
- 2008;2009
- Tongue
- English
- Leaves
- 861
- Edition
- 5th ed. international ed
- Category
- Library
No coin nor oath required. For personal study only.
✦ Synopsis
Computer animation and graphics–once rare, complicated, and comparatively expensive–are now prevalent in everyday life from the computer screen to the movie screen.Interactive Computer Graphicsis the only introduction to computer graphics text for undergraduates that fully integrates OpenGL and emphasizes application-based programming. Using C and C++, the top-down, programming-oriented approach allows for coverage of engaging 3D material early in the course so students immediately begin to create their own 3D graphics. Low-level algorithms (for topics such as line drawing and filling polygons) are presented after students learn to create graphics.
This book is suitable for undergraduate students in computer science and engineering, for students in other disciplines who have good programming skills, and for professionals.
✦ Table of Contents
Cover......Page 1
Contents......Page 8
Preface......Page 24
CHAPTER 1 GRAPHICS SYSTEMS AND MODELS......Page 34
1.1.1 Display of Information......Page 35
1.1.3 Simulation and Animation......Page 36
1.2.1 Pixels and the Frame Buffer......Page 38
1.2.2 Output Devices......Page 40
1.3 Images: Physical and Synthetic......Page 43
1.3.1 Objects and Viewers......Page 44
1.3.2 Light and Images......Page 45
1.3.3 Image Formation Models......Page 47
1.4.1 The Pinhole Camera......Page 49
1.4.2 The Human Visual System......Page 51
1.5 The Synthetic-Camera Model......Page 52
1.6 The Programmer’s Interface......Page 54
1.6.1 The Pen-Plotter Model......Page 56
1.6.2 Three-Dimensional APIs......Page 57
1.6.3 A Sequence of Images......Page 60
1.6.4 The Modeling–Rendering Paradigm......Page 61
1.7 Graphics Architectures......Page 62
1.7.2 Pipeline Architectures......Page 63
1.7.3 The Graphics Pipeline......Page 64
1.7.5 Clipping and Primitive Assembly......Page 65
1.8 Programmable Pipelines......Page 66
1.9 Performance Characteristics......Page 67
Summary and Notes......Page 68
Exercises......Page 69
2.1 The Sierpinski Gasket......Page 72
2.2 Programming Two-Dimensional Applications......Page 73
2.2.1 Coordinate Systems......Page 78
2.3 The OpenGL API......Page 79
2.3.1 Graphics Functions......Page 80
2.3.2 The Graphics Pipeline and State Machines......Page 81
2.3.3 The OpenGL Interface......Page 82
2.4 Primitives and Attributes......Page 83
2.4.1 Polygon Basics......Page 85
2.4.2 Polygon Types in OpenGL......Page 86
2.4.3 Approximating a Sphere......Page 88
2.4.4 Text......Page 89
2.4.6 Attributes......Page 91
2.5 Color......Page 93
2.5.1 RGB Color......Page 95
2.5.2 Indexed Color......Page 96
2.5.3 Setting of Color Attributes......Page 98
2.6.1 The Orthographic View......Page 99
2.6.2 Two-Dimensional Viewing......Page 102
2.7 Control Functions......Page 103
2.7.1 Interaction with the Window System......Page 104
2.7.2 Aspect Ratio and Viewports......Page 105
2.7.3 The main, display, and myinit Functions......Page 107
2.7.4 Program Structure......Page 108
2.8 The Gasket Program......Page 109
2.9 Polygons and Recursion......Page 110
2.10.1 Use of Three-Dimensional Points......Page 113
2.10.2 Use of Polygons in Three Dimensions......Page 115
2.10.3 Hidden-Surface Removal......Page 116
2.11 Plotting Implicit Functions......Page 118
2.11.1 Marching Squares......Page 119
Summary and Notes......Page 125
Exercises......Page 127
3.1 Interaction......Page 132
3.2 Input Devices......Page 133
3.2.1 Physical Input Devices......Page 134
3.2.2 Logical Devices......Page 137
3.2.3 Input Modes......Page 138
3.3 Clients and Servers......Page 140
3.4 Display Lists......Page 142
3.4.1 Definition and Execution of Display Lists......Page 143
3.4.2 Text and Display Lists......Page 145
3.4.3 Fonts in GLUT......Page 148
3.5 Display Lists and Modeling......Page 149
3.6.1 Using the Pointing Device......Page 150
3.6.2 Window Events......Page 154
3.6.3 Keyboard Events......Page 155
3.6.4 The Display and Idle Callbacks......Page 156
3.7 Menus......Page 157
3.8 Picking......Page 159
3.8.1 Picking and Selection Mode......Page 160
3.9 A Simple CAD Program......Page 166
3.10 Building Interactive Models......Page 173
3.11 Animating Interactive Programs......Page 175
3.11.1 The Rotating Square......Page 176
3.11.2 Double Buffering......Page 177
3.11.3 Using a Timer......Page 179
3.12 Design of Interactive Programs......Page 180
3.12.1 Toolkits, Widgets, and the Frame Buffer......Page 181
3.13 Logic Operations......Page 182
3.13.1 Drawing Erasable Lines......Page 183
3.13.3 Cursors and Overlay Planes......Page 186
Summary and Notes......Page 187
Exercises......Page 188
CHAPTER 4 GEOMETRIC OBJECTS AND TRANSFORMATIONS......Page 192
4.1.1 Geometric Objects......Page 193
4.1.2 Coordinate-Free Geometry......Page 194
4.1.3 The Mathematical View: Vector and Affine Spaces......Page 195
4.1.5 Geometric ADTs......Page 196
4.1.7 Affine Sums......Page 198
4.1.9 Dot and Cross Products......Page 199
4.1.10 Planes......Page 200
4.2 Three-Dimensional Primitives......Page 201
4.3 Coordinate Systems and Frames......Page 203
4.3.2 Change of Coordinate Systems......Page 205
4.3.3 Example Change of Representation......Page 208
4.3.4 Homogeneous Coordinates......Page 209
4.3.5 Example Change in Frames......Page 212
4.3.6 Working with Representations......Page 214
4.4 Frames in OpenGL......Page 216
4.5 Modeling a Colored Cube......Page 220
4.5.1 Modeling the Faces......Page 221
4.5.3 Data Structures for Object Representation......Page 222
4.5.4 The Color Cube......Page 223
4.5.5 Bilinear Interpolation......Page 224
4.5.6 Vertex Arrays......Page 225
4.6 Affine Transformations......Page 228
4.7 Translation, Rotation, and Scaling......Page 230
4.7.2 Rotation......Page 231
4.7.3 Scaling......Page 233
4.8 Transformations in Homogeneous Coordinates......Page 235
4.8.1 Translation......Page 236
4.8.2 Scaling......Page 237
4.8.3 Rotation......Page 238
4.8.4 Shear......Page 239
4.9 Concatenation of Transformations......Page 240
4.9.1 Rotation About a Fixed Point......Page 241
4.9.2 General Rotation......Page 242
4.9.3 The Instance Transformation......Page 244
4.9.4 Rotation About an Arbitrary Axis......Page 245
4.10.1 The Current Transformation Matrix......Page 248
4.10.2 Rotation, Translation, and Scaling......Page 249
4.10.4 Order of Transformations......Page 250
4.10.5 Spinning of the Cube......Page 251
4.10.6 Loading, Pushing, and Popping Matrices......Page 252
4.11 Interfaces to Three-Dimensional Applications......Page 253
4.11.2 A Virtual Trackball......Page 254
4.11.3 Smooth Rotations......Page 257
4.11.4 Incremental Rotation......Page 258
4.12.1 Complex Numbers and Quaternions......Page 259
4.12.2 Quaternions and Rotation......Page 261
Summary and Notes......Page 263
Exercises......Page 264
5.1 Classical and Computer Viewing......Page 268
5.1.2 Orthographic Projections......Page 270
5.1.3 Axonometric Projections......Page 271
5.1.4 Oblique Projections......Page 273
5.1.5 Perspective Viewing......Page 274
5.2 Viewing with a Computer......Page 275
5.3.1 Positioning of the Camera Frame......Page 277
5.3.2 Two Viewing APIs......Page 282
5.3.3 The Look-At Function......Page 285
5.3.4 Other Viewing APIs......Page 286
5.4.1 Perspective Projections......Page 287
5.4.2 Orthogonal Projections......Page 290
5.5 Projections in OpenGL......Page 291
5.5.1 Perspective in OpenGL......Page 292
5.5.2 Parallel Viewing in OpenGL......Page 294
5.6 Hidden-Surface Removal......Page 295
5.7.1 Meshes......Page 297
5.7.2 Walking Through a Scene......Page 299
5.7.3 Polygon Offset......Page 301
5.8 Parallel-Projection Matrices......Page 302
5.8.1 Projection Normalization......Page 303
5.8.2 Orthogonal-Projection Matrices......Page 304
5.8.3 Oblique Projections......Page 306
5.9.1 Perspective Normalization......Page 309
5.9.2 OpenGL Perspective Transformations......Page 313
5.10 Projections and Shadows......Page 314
Summary and Notes......Page 317
Exercises......Page 318
CHAPTER 6 LIGHTING AND SHADING......Page 322
6.1 Light and Matter......Page 323
6.2.1 Color Sources......Page 327
6.2.2 Ambient Light......Page 328
6.2.3 Point Sources......Page 329
6.2.5 Distant Light Sources......Page 330
6.3 The Phong Lighting Model......Page 331
6.3.2 Diffuse Reflection......Page 333
6.3.3 Specular Reflection......Page 334
6.3.4 The Modified Phong Model......Page 336
6.4.1 Normal Vectors......Page 337
6.4.2 Angle of Reflection......Page 341
6.5 Polygonal Shading......Page 342
6.5.1 Flat Shading......Page 343
6.5.2 Smooth and Gouraud Shading......Page 344
6.5.3 Phong Shading......Page 346
6.6 Approximation of a Sphere by Recursive Subdivision......Page 347
6.7 Light Sources in OpenGL......Page 350
6.8 Specification of Materials in OpenGL......Page 353
6.9 Shading of the Sphere Model......Page 355
6.10 Global Illumination......Page 356
Summary and Notes......Page 358
Exercises......Page 359
CHAPTER 7 FROM VERTICES TO FRAGMENTS......Page 362
7.1 Basic Implementation Strategies......Page 363
7.2.1 Modeling......Page 365
7.2.2 Geometry Processing......Page 366
7.2.3 Rasterization......Page 367
7.2.4 Fragment Processing......Page 368
7.4 Line-Segment Clipping......Page 369
7.4.1 Cohen-Sutherland Clipping......Page 370
7.4.2 Liang-Barsky Clipping......Page 372
7.5 Polygon Clipping......Page 374
7.6 Clipping of Other Primitives......Page 376
7.6.1 Bounding Boxes and Volumes......Page 377
7.6.3 Clipping in the Frame Buffer......Page 378
7.7 Clipping in Three Dimensions......Page 379
7.8 Rasterization......Page 382
7.9 Bresenham’s Algorithm......Page 385
7.10.1 Inside–Outside Testing......Page 387
7.10.2 OpenGL and Concave Polygons......Page 388
7.10.3 Fill and Sort......Page 389
7.10.5 Singularities......Page 390
7.11.1 Object-Space and Image-Space Approaches......Page 391
7.11.3 ScanLine Algorithms......Page 393
7.11.4 Back-Face Removal......Page 394
7.11.5 The z-Buffer Algorithm......Page 395
7.11.6 Scan Conversion with the z-Buffer......Page 398
7.11.7 Depth Sort and the Painter’s Algorithm......Page 400
7.12 Antialiasing......Page 402
7.13 Display Considerations......Page 404
7.13.1 Color Systems......Page 405
7.13.2 The Color Matrix......Page 408
7.13.4 Dithering and Halftoning......Page 409
Summary and Notes......Page 410
Exercises......Page 412
8.1 Buffers......Page 416
8.2 Digital Images......Page 418
8.3 Writing into Buffers......Page 421
8.3.1 Writing Modes......Page 422
8.3.2 Writes with XOR......Page 424
8.4.1 OpenGL Buffers and the Pixel Pipeline......Page 425
8.4.2 Bitmaps......Page 427
8.4.3 Raster Fonts......Page 428
8.4.4 Pixels and Images......Page 429
8.4.5 Lookup Tables......Page 430
8.5 Examples......Page 432
8.5.2 Testing Algorithms......Page 433
8.6 Mapping Methods......Page 434
8.7 Texture Mapping......Page 436
8.7.1 Two-Dimensional Texture Mapping......Page 437
8.8 Texture Mapping in OpenGL......Page 443
8.8.1 Two-Dimensional Texture Mapping......Page 444
8.8.2 Texture Sampling......Page 447
8.8.3 Working with Texture Coordinates......Page 450
8.8.4 Texture Objects......Page 452
8.8.5 Multitexturing......Page 453
8.9 Texture Generation......Page 454
8.10 Environment Maps......Page 455
8.11 Compositing Techniques......Page 460
8.11.1 Opacity and Blending......Page 461
8.11.3 Blending and Compositing in OpenGL......Page 462
8.11.4 Antialiasing Revisited......Page 464
8.11.5 Back-to-Front and Front-to-Back Rendering......Page 465
8.11.6 Depth Cueing and Fog......Page 466
8.12 Multirendering and the Accumulation Buffer......Page 467
8.12.1 Scene Antialiasing......Page 468
8.12.3 Image Processing......Page 469
8.12.5 Other Multipass Methods......Page 471
8.13 Sampling and Aliasing......Page 472
8.13.1 Sampling Theory......Page 473
8.13.2 Reconstruction......Page 477
8.13.3 Quantization......Page 479
Summary and Notes......Page 480
Exercises......Page 481
9.1 Programmable Pipelines......Page 484
9.2.1 Shade Trees......Page 486
9.3 Extending OpenGL......Page 487
9.3.1 OpenGL Versions and Extensions......Page 488
9.4 The OpenGL Shading Language......Page 489
9.4.1 Vertex Shaders......Page 490
9.4.2 Fragment Shaders......Page 492
9.5 The OpenGL Shading Language......Page 493
9.5.2 Data Types and Qualifiers......Page 494
9.5.3 Operators and Functions......Page 497
9.6 Linking Shaders with OpenGL Programs......Page 498
9.7.1 Scaling Vertex Positions......Page 503
9.7.2 Morphing......Page 505
9.7.3 Particle Systems......Page 507
9.8.1 Phong Lighting......Page 508
9.8.2 Nonphotorealistic Shading......Page 511
9.9 Fragment Shaders......Page 512
9.10 Per-Vertex Versus Per-Fragment Lighting......Page 513
9.11 Samplers......Page 516
9.12 Cube Maps......Page 518
9.12.1 Reflection Maps......Page 519
9.12.2 Refraction......Page 520
9.12.3 Normalization Maps......Page 523
9.13.1 Finding Bump Maps......Page 525
9.13.2 Examples......Page 528
Suggested Readings......Page 532
Exercises......Page 533
CHAPTER 10 MODELING AND HIERARCHY......Page 536
10.1 Symbols and Instances......Page 537
10.2 Hierarchical Models......Page 538
10.3 A Robot Arm......Page 540
10.4 Trees and Traversal......Page 542
10.4.1 A Stack-Based Traversal......Page 544
10.5 Use of Tree Data Structures......Page 546
10.6 Animation......Page 550
10.7.1 Methods, Attributes, and Messages......Page 552
10.7.2 A Cube Object......Page 554
10.7.3 Implementing the Cube Object......Page 556
10.7.4 Objects and Hierarchy......Page 557
10.7.5 Geometric Objects......Page 558
10.8 Scene Graphs......Page 559
10.9.1 The Node Class......Page 561
10.9.2 Geometry Nodes......Page 563
10.9.3 Camera Class......Page 565
10.9.4 Lights and Materials......Page 566
10.9.6 The Robot Figure......Page 568
10.9.7 Implementing the Viewer......Page 570
10.9.8 Implementing a Node......Page 574
10.10 Open Scene Graph......Page 577
10.11.1 Networks and Protocols......Page 579
10.11.2 Hypermedia and HTML......Page 580
10.11.3 Databases and VRML......Page 581
10.12 Other Tree Structures......Page 582
10.12.1 CSG Trees......Page 583
10.12.2 BSP Trees......Page 584
10.12.3 Quadtrees and Octrees......Page 587
Summary and Notes......Page 588
Exercises......Page 589
11.1 Algorithmic Models......Page 592
11.2 Physically-Based Models and Particle Systems......Page 594
11.3 Newtonian Particles......Page 595
11.3.1 Independent Particles......Page 597
11.3.2 Spring Forces......Page 598
11.3.3 Attractive and Repulsive Forces......Page 599
11.4 Solving Particle Systems......Page 601
11.5 Constraints......Page 603
11.5.1 Collisions......Page 604
11.5.2 Soft Constraints......Page 606
11.6.1 Displaying the Particles......Page 607
11.6.3 Initialization......Page 608
11.6.4 Collisions......Page 609
11.6.6 Flocking......Page 610
11.7 Language-Based Models......Page 611
11.8.1 Rulers and Length......Page 615
11.8.2 Fractal Dimension......Page 616
11.8.3 Midpoint Division and Brownian Motion......Page 617
11.8.4 Fractal Mountains......Page 618
11.8.5 The Mandelbrot Set......Page 619
11.9 Procedural Noise......Page 623
Suggested Readings......Page 627
Exercises......Page 628
12.1.1 Explicit Representation......Page 630
12.1.2 Implicit Representations......Page 632
12.1.3 Parametric Form......Page 633
12.1.4 Parametric Polynomial Curves......Page 634
12.1.5 Parametric Polynomial Surfaces......Page 635
12.2 Design Criteria......Page 636
12.3 Parametric Cubic Polynomial Curves......Page 637
12.4 Interpolation......Page 638
12.4.1 Blending Functions......Page 640
12.4.2 The Cubic Interpolating Patch......Page 642
12.5.1 The Hermite Form......Page 644
12.5.2 Geometric and Parametric Continuity......Page 646
12.6 Bézier Curves and Surfaces......Page 647
12.6.1 Bézier Curves......Page 648
12.6.2 Bézier Surface Patches......Page 650
12.7.1 The Cubic B-Spline Curve......Page 651
12.7.2 B-Splines and Basis......Page 654
12.8 General B-Splines......Page 656
12.8.1 Recursively Defined B-Splines......Page 657
12.8.2 Uniform Splines......Page 658
12.8.4 NURBS......Page 659
12.8.5 Catmull-Rom Splines......Page 661
12.9.1 Polynomial Evaluation Methods......Page 662
12.9.2 Recursive Subdivision of Bézier Polynomials......Page 663
12.9.3 Rendering Other Polynomial Curves by Subdivision......Page 666
12.9.4 Subdivision of Bézier Surfaces......Page 667
12.10 The Utah Teapot......Page 669
12.11.1 Quadrics......Page 671
12.11.2 Rendering of Surfaces by Ray Casting......Page 672
12.11.3 Subdivision Curves and Surfaces......Page 673
12.11.4 Mesh Subdivision......Page 674
12.12.1 Bézier Curves......Page 677
12.12.2 Bézier Surfaces......Page 678
12.12.3 Displaying the Teapot......Page 679
12.12.5 Quadrics......Page 681
Summary and Notes......Page 682
Exercises......Page 683
13.1 Going Beyond Pipeline Rendering......Page 686
13.2 Ray Tracing......Page 687
13.3.1 Recursive Ray Tracing......Page 691
13.3.2 Calculating Intersections......Page 693
13.3.3 Ray-Tracing Variations......Page 696
13.4 The Rendering Equation......Page 697
13.5.1 The Radiosity Equation......Page 699
13.5.2 Solving the Radiosity Equation......Page 701
13.5.3 Computing Form Factors......Page 702
13.5.4 Carrying Out Radiosity......Page 705
13.6 RenderMan......Page 706
13.7 Parallel Rendering......Page 707
13.7.1 Sort-Middle Rendering......Page 708
13.7.2 Sort-Last Rendering......Page 710
13.7.3 Sort-First Rendering......Page 713
13.8.1 A Simple Example......Page 715
Summary and Notes......Page 717
Suggested Readings......Page 718
Exercises......Page 719
APPENDIX A: SAMPLE PROGRAMS......Page 722
A.1 Sierpinski Gasket Program......Page 723
A.2 Recursive Generation of Sierpinski Gasket......Page 725
A.3 Recursive Three-Dimensional Sierpinski Gasket......Page 726
A.4 Marching Squares......Page 729
A.5 Polygon Modeling Program......Page 734
A.6 Double-Buffering program......Page 740
A.7 Selection-Mode Picking Program......Page 743
A.8 Rotating-Cube Program......Page 745
A.9 Rotating Cube Using Vertex Arrays......Page 748
A.10 Rotating Cube with a Virtual Trackball......Page 750
A.11 Moving Viewer......Page 754
A.12 Sphere Program......Page 757
A.13 Mandelbrot Set Program......Page 760
A.14 Bresenham’s Algorithm......Page 763
A.15 Rotating Cube with Texture......Page 766
A.16 GLSL Example......Page 768
A.17 Scene Graph Program......Page 774
A.18 Particle System Program......Page 779
A.19 Program for Drawing Bézier Curves......Page 784
B.1 Scalars......Page 788
B.2 Vector Spaces......Page 789
B.3 Affine Spaces......Page 791
B.4 Euclidean Spaces......Page 792
B.5 Projections......Page 793
B.6 Gram-Schmidt Orthogonalization......Page 794
Exercises......Page 795
C.1 Definitions......Page 798
C.2 Matrix Operations......Page 799
C.3 Row and Column Matrices......Page 800
C.4 Rank......Page 801
C.5 Change of Representation......Page 802
C.6 The Cross Product......Page 804
C.7 Eigenvalues and Eigenvectors......Page 805
Suggested Readings......Page 806
Exercises......Page 807
D.1 Specifying Simple Geometry......Page 808
D.2 Attributes......Page 809
D.3 Working with the Window System......Page 810
D.4 Interaction......Page 812
D.5 Enabling Features......Page 813
D.6 Transformations......Page 814
D.7 Viewing......Page 815
D.8 Defining Discrete Primitives......Page 816
D.9 Display Lists......Page 817
D.10 Picking......Page 818
D.12 Texture Mapping......Page 819
D.14 Vertex Arrays......Page 821
D.16 Query Functions......Page 822
D.17 Curve and Surface Functions......Page 823
D.19 GLSL Functions......Page 824
References......Page 828
GL Functions......Page 838
GLUT functions......Page 839
A......Page 840
B......Page 841
C......Page 842
D......Page 844
E......Page 845
G......Page 846
H......Page 847
I......Page 848
L......Page 849
M......Page 850
N......Page 851
P......Page 852
R......Page 855
S......Page 856
T......Page 858
V......Page 859
X......Page 860
Z......Page 861
✦ Subjects
Reference;Computer Science;Programming;Nonfiction;Science;Technical
📜 SIMILAR VOLUMES
Computer animation and graphics–once rare, complicated, and comparatively expensive–are now prevalent in everyday life from the computer screen to the movie screen. Interactive Computer Graphics is the only introduction to computer graphics text for undergraduates that fully integrates OpenGL and em
<p> <em>This book is suitable for undergraduate students in computer science and engineering, for students in other disciplines who have good programming skills, and for professionals. </em> </p> <p>Computer animation and graphics–once rare, complicated, and comparatively expensive–are now prevalen
Эта книга-введение в компьютерную графику, с акцентом на программирование приложений. Первый выпуск, который был опубликован в 1997 году, был чем-то революционным в использовании стандартной графической библиотеки и подход « сверху вниз». За последующие 13 лет и пять изданий, этот подход был принят
This book is suitable for undergraduate students in computer science and engineering, for students in other disciplines who have good programming skills, and for professionals. Computer animation and graphics–once rare, complicated, and comparatively expensive–are now prevalent in everyday life fr