You are previewing Computer Graphics Through OpenGL, 2nd Edition.
O'Reilly logo
Computer Graphics Through OpenGL, 2nd Edition

Book Description

From geometric primitives to animation to 3D modeling to lighting, shading, and texturing, Computer Graphics Through OpenGL®: From Theory to Experiments, Second Edition presents a comprehensive introduction to computer graphics that uses an active learning style to teach key concepts. Equally emphasizing theory and practice, the book provides an understanding not only of the principles of 3D computer graphics, but also the use of the OpenGL® Application Programming Interface (API) to code 3D scenes and animation, including games and movies.

The undergraduate core of the book is a one-semester sequence taking the student from zero knowledge of computer graphics to a mastery of the fundamental concepts with the ability to code applications using fourth-generation OpenGL. The remaining chapters explore more advanced topics, including the structure of curves and surfaces and the application of projective spaces and transformations.

New to the Second Edition

  • 30 more programs, 50 more experiments, and 50 more exercises
  • Two new chapters on OpenGL 4.3 shaders and the programmable pipeline
  • Coverage of:
    • Vertex buffer and array objects
    • Occlusion culling and queries and conditional rendering
    • Texture matrices
    • Multitexturing and texture combining
    • Multisampling
    • Point sprites
    • Image and pixel manipulation
    • Pixel buffer objects
    • Shadow mapping

Web Resource
The book’s website at www.sumantaguha.com provides program source code that runs on various platforms. It includes a guide to installing OpenGL and executing the programs, special software to help run the experiments, and figures from the book. The site also contains an instructor’s manual with solutions to 100 problems (for qualifying instructors only).

Table of Contents

  1. Preliminaries
  2. Preface
    1. About the Book
    2. Specs
    3. New in the Second Edition
    4. Pedagogical Approach
      1. Why use an API?
      2. How to teach modern shader-based OpenGL?
    5. Target Audience
    6. Prerequisites
    7. Resources
    8. Capsule Chapter Descriptions
    9. Suggested Course Outlines
    10. Code
    11. Acknowledgments
    12. Website and Contact Information
  3. About the Author
  4. Part I Hello World
    1. Chapter 1 An Invitation to Computer Graphics
      1. 1.1 Brief History of Computer Graphics
      2. 1.2 Overview of a Graphics System
        1. 1.2.1 Input Devices
        2. 1.2.2 Output Devices
      3. 1.3 Quick Preview of the Adventures Ahead
      1. Figure 1.1
      2. Figure 1.2
      3. Figure 1.3
      4. Figure 1.4
      5. Figure 1.5
      6. Figure 1.6
      7. Figure 1.7
      8. Figure 1.8
      9. Figure 1.9
      10. Figure 1.10
      11. Figure 1.11
      12. Figure 1.12
      13. Figure 1.13
      14. Figure 1.14
      15. Figure 1.15
      16. Figure 1.16
    2. Chapter 2 On to Opengl and 3D Computer Graphics
      1. 2.1 First Program
      2. 2.2 Orthographic Projection, Viewing Box and World Coordinates
        1. Fixed World System
      3. 2.3 The OpenGL Window and Screen Coordinates
      4. 2.4 Clipping
      5. 2.5 Color, OpenGL State Machine and Interpolation
      6. 2.6 OpenGL Geometric Primitives
      7. 2.7 Approximating Curved Objects
      8. 2.8 Three Dimensions, the Depth Buffer and Perspective Projection
        1. 2.8.1 A Vital 3D Utility: The Depth Buffer
        2. 2.8.2 A Helix and Perspective Projection
      9. 2.9 Drawing Projects
      10. 2.10 Approximating Curved Objects Once More
      11. 2.11 An OpenGL Program End to End
      12. 2.12 Summary, Notes and More Reading
      1. Figure 2.1
      2. Figure 2.2
      3. Figure 2.3
      4. Figure 2.4
      5. Figure 2.5
      6. Figure 2.6
      7. Figure 2.7
      8. Figure 2.8
      9. Figure 2.9
      10. Figure 2.10
      11. Figure 2.11
      12. Figure 2.12
      13. Figure 2.13
      14. Figure 2.14
      15. Figure 2.15
      16. Figure 2.16
      17. Figure 2.17
      18. Figure 2.18
      19. Figure 2.19
      20. Figure 2.20
      21. Figure 2.21
      22. Figure 2.22
      23. Figure 2.23
      24. Figure 2.24
      25. Figure 2.25
      26. Figure 2.26
      27. Figure 2.27
      28. Figure 2.28
      29. Figure 2.29
      30. Figure 2.30
      31. Figure 2.31
      32. Figure 2.32
      33. Figure 2.33
      34. Figure 2.34
      35. Figure 2.35
      36. Figure 2.36
      37. Figure 2.37
      38. Figure 2.38
      39. Figure 2.39
      40. Figure 2.40
      41. Figure 2.41
      42. Figure 2.42
  5. Part II Tricks of the Trade
    1. Chapter 3 An OpenGL Toolbox
      1. 3.1 Vertex Arrays and Their Drawing Commands
      2. 3.2 Vertex Buffer Objects
      3. 3.3 Vertex Array Objects
      4. 3.4 Display Lists
      5. 3.5 Drawing Text
      6. 3.6 Programming the Mouse
        1. Clicks
        2. Motion
        3. Turning the Wheel
      7. 3.7 Programming Non-ASCII Keys
      8. 3.8 Menus
      9. 3.9 Line Stipples
        1. A 2D Drawing Program
      10. 3.10 FreeGLUT Objects
      11. 3.11 Clipping Planes
      12. 3.12 <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="code">gluPerspective()</span>
      13. 3.13 Viewports
      14. 3.14 Multiple Windows
      15. 3.15 Summary, Notes and More Reading
      1. Figure 3.1
      2. Figure 3.2
      3. Figure 3.3
      4. Figure 3.4
      5. Figure 3.5
      6. Figure 3.6
      7. Figure 3.7
      8. Figure 3.8
      9. Figure 3.9
      10. Figure 3.10
      11. Figure 3.11
      12. Figure 3.12
      13. Figure 3.13
      14. Figure 3.14
      15. Figure 3.15
      16. Figure 3.16
      17. Figure 3.17
      18. Figure 3.18
      19. Figure 3.19
      20. Figure 3.20
      21. Figure 3.21
      22. Figure 3.22
      23. Figure 3.23
      24. Figure 3.24
      25. Figure 3.25
      26. Figure 3.26
  6. Part III Movers and Shapers
    1. Chapter 4 Transformation, Animation and Viewing
      1. 4.1 Modeling Transformations
        1. 4.1.1 Translation
        2. 4.1.2 Scaling
        3. 4.1.3 Rotation
      2. 4.2 Composing Modeling Transformations
      3. 4.3 Placing Multiple Objects
      4. 4.4 Modelview Matrix Stack and Isolating Transformations
      5. 4.5 Animation
        1. 4.5.1 Animation Technicals
          1. Controlling Animation
          2. Double Buffering
        2. 4.5.2 Animation Code
          1. Ball Flying About a Torus
          2. Throwing a Ball
          3. Ball Facing Friction
          4. Clown Head
          5. Blooming Flower
        3. 4.5.3 Animation Projects
      6. 4.6 Viewing Transformation
        1. 4.6.1 Understanding the Viewing Transformation
          1. Sidebar on Dot Products
          2. Back to OpenGL
        2. 4.6.2 Simulating a Viewing Transformation with Modeling Transformations
        3. 4.6.3 Orientation and Euler Angles
        4. 4.6.4 Viewing Transformation and Collision Detection in Animation
          1. Viewing Transformation
          2. Collision Detection
      7. 4.7 More Animation Code
        1. 4.7.1 Animating an Articulated Figure
        2. 4.7.2 Simple Shadow Animation
      8. 4.8 Selection and Picking
        1. 4.8.1 Selection
        2. 4.8.2 Picking
          1. Picking by Color Coding
      9. 4.9 Summary, Notes and More Reading
      1. Figure 4.1
      2. Figure 4.2
      3. Figure 4.3
      4. Figure 4.4
      5. Figure 4.5
      6. Figure 4.6
      7. Figure 4.7
      8. Figure 4.8
      9. Figure 4.9
      10. Figure 4.10
      11. Figure 4.11
      12. Figure 4.12
      13. Figure 4.13
      14. Figure 4.14
      15. Figure 4.15
      16. Figure 4.16
      17. Figure 4.17
      18. Figure 4.18
      19. Figure 4.19
      20. Figure 4.20
      21. Figure 4.21
      22. Figure 4.22
      23. Figure 4.23
      24. Figure 4.24
      25. Figure 4.25
      26. Figure 4.26
      27. Figure 4.27
      28. Figure 4.28
      29. Figure 4.29
      30. Figure 4.30
      31. Figure 4.31
      32. Figure 4.32
      33. Figure 4.33
      34. Figure 4.34
      35. Figure 4.35
      36. Figure 4.36
      37. Figure 4.37
      38. Figure 4.38
      39. Figure 4.39
      40. Figure 4.40
      41. Figure 4.41
      42. Figure 4.42
      43. Figure 4.43
      44. Figure 4.44
      45. Figure 4.45
      46. Figure 4.46
      47. Figure 4.47
      48. Figure 4.48
      49. Figure 4.49
      50. Figure 4.50
      51. Figure 4.51
      52. Figure 4.52
      53. Figure 4.53
      54. Figure 4.54
      55. Figure 4.55
      56. Figure 4.56
      57. Figure 4.57
      58. Figure 4.58
      59. Figure 4.59
      60. Figure 4.60
      61. Figure 4.61
      62. Figure 4.62
      63. Figure 4.63
    2. Chapter 5 Inside Animation: The Theory of Transformations
      1. 5.1 Geometric Transformations in 2-Space
        1. 5.1.1 Translation
        2. 5.1.2 Scaling
        3. 5.1.3 Rotation
        4. 5.1.4 Reflection
      2. 5.2 Affine Transformations
        1. 5.2.1 Affine Transformations Defined
        2. 5.2.2 Affine Transformations and OpenGL
        3. 5.2.3 Affine Transformations and Homogeneous Coordinates
      3. 5.3 Geometric Transformations in 2-Space Continued
        1. 5.3.1 Affine Geometric Transformations
          1. Geometric Transformation Equations Using Homogeneous Coordinates
          2. Factoring Affine Transformations
        2. 5.3.2 Euclidean and Rigid Transformations
        3. 5.3.3 Shear
      4. 5.4 Geometric Transformations in 3-Space
        1. 5.4.1 Translation
        2. 5.4.2 Scaling
        3. 5.4.3 Rotation
          1. Rotation about the Coordinate Axes
          2. Rotation about an Arbitrary Radial Axis
          3. A Method to Compute the Rotation Matrix Which Is Mainly Geometric
          4. Sidebar on Cross-Products
          5. A Method to Compute the Rotation Matrix Which Is Part Geometry and Part Algebra
        4. 5.4.4 Reflection
        5. 5.4.5 Affine Geometric Transformations
          1. OpenGL and Affine Transformations
          2. Verifying the Matrices Generated by OpenGL
          3. Projection Transformations
        6. 5.4.6 Accessing and Manipulating the Current Modelview Matrix
        7. 5.4.7 Euclidean and Rigid Transformations
          1. Proof of Proposition 5.10
        8. 5.4.8 Shear
      5. 5.5 Summary, Notes and More Reading
      1. Figure 5.1
      2. Figure 5.2
      3. Figure 5.3
      4. Figure 5.4
      5. Figure 5.5
      6. Figure 5.6
      7. Figure 5.7
      8. Figure 5.8
      9. Figure 5.9
      10. Figure 5.10
      11. Figure 5.11
      12. Figure 5.12
      13. Figure 5.13
      14. Figure 5.14
      15. Figure 5.15
      16. Figure 5.16
      17. Figure 5.17
      18. Figure 5.18
      19. Figure 5.19
      20. Figure 5.20
      21. Figure 5.21
      22. Figure 5.22
      23. Figure 5.23
      24. Figure 5.24
      25. Figure 5.25
      26. Figure 5.26
      27. Figure 5.27
      28. Figure 5.28
      29. Figure 5.29
      30. Figure 5.30
      31. Figure 5.31
      32. Figure 5.32
      33. Figure 5.33
      34. Figure 5.34
      35. Figure 5.35
    3. Chapter 6 Advanced Animation Techniques
      1. 6.1 Frustum Culling by Space Partitioning
        1. 6.1.1 Space Partitioning
        2. 6.1.2 Quadtrees
        3. 6.1.3 Implementation
        4. 6.1.4 More about Space Partitioning
      2. 6.2 Occlusion Culling
        1. Conditional Rendering
      3. 6.3 Animating Orientation Using Euler Angles
        1. 6.3.1 Euler Angles and the Orientation of a Rigid Body
        2. 6.3.2 Animating Orientation
        3. 6.3.3 Problems with Euler Angles: Gimbal Lock and Ambiguity
      4. 6.4 Quaternions
        1. 6.4.1 Quaternion Math 101
        2. 6.4.2 Quaternions and Orientation
          1. Quaternion to Rotation Matrix
          2. Spherical Linear Interpolation
          3. Interpolating Orientations via Quaternions
      5. 6.5 Summary, Notes and More Reading
      1. Figure 6.1
      2. Figure 6.2
      3. Figure 6.3
      4. Figure 6.4
      5. Figure 6.5
      6. Figure 6.6
      7. Figure 6.7
      8. Figure 6.8
      9. Figure 6.9
      10. Figure 6.10
      11. Figure 6.11
      12. Figure 6.12
      13. Figure 6.13
      14. Figure 6.14
      15. Figure 6.15
      16. Figure 6.16
  7. Part IV Geometry for the Home Office
    1. Chapter 7 Convexity and Interpolation
      1. 7.1 Motivation
      2. 7.2 Convex Combinations
        1. Segments
        2. Triangles
      3. 7.3 Interpolation
      4. 7.4 Convexity and the Convex Hull
        1. Extreme Points
        2. Interpolation and Convexity
        3. Planarity
      5. 7.5 Summary, Notes and More Reading
      1. Figure 7.1
      2. Figure 7.2
      3. Figure 7.3
      4. Figure 7.4
      5. Figure 7.5
      6. Figure 7.6
      7. Figure 7.7
      8. Figure 7.8
      9. Figure 7.9
      10. Figure 7.10
      11. Figure 7.11
      12. Figure 7.12
      13. Figure 7.13
      14. Figure 7.14
      15. Figure 7.15
      16. Figure 7.16
    2. Chapter 8 Triangulation
      1. 8.1 Definition and Justification
      2. 8.2 Steiner Vertices and the Quality of a Triangulation
      3. 8.3 Triangulation in OpenGL and the Trouble with Non-Convexity
      4. 8.4 Summary, Notes and More Reading
      1. Figure 8.1
      2. Figure 8.2
      3. Figure 8.3
      4. Figure 8.4
      5. Figure 8.5
      6. Figure 8.6
      7. Figure 8.7
      8. Figure 8.8
      9. Figure 8.9
    3. Chapter 9 Orientation
      1. 9.1 Motivation
      2. 9.2 OpenGL Procedure to Determine Front and Back Faces
        1. Algorithm to Decide the Orientation Perceived by a Viewer
      3. 9.3 Consistently Oriented Triangulation
        1. Non-Orientable Surfaces
      4. 9.4 Culling Obscured Faces
      5. 9.5 Transformations and the Orientation of Geometric Primitives
      6. 9.6 Summary, Notes and More Reading
      1. Figure 9.1
      2. Figure 9.2
      3. Figure 9.3
      4. Figure 9.4
      5. Figure 9.5
      6. Figure 9.6
      7. Figure 9.7
      8. Figure 9.8
      9. Figure 9.9
      10. Figure 9.10
      11. Figure 9.11
      12. Figure 9.12
      13. Figure 9.13
      14. Figure 9.14
      15. Figure 9.15
      16. Figure 9.16
  8. Part V Making Things Up
    1. Chapter 10 Modeling in 3D Space
      1. 10.1 Curves
        1. 10.1.1 Specifying Plane Curves
          1. Implicit
          2. Parametric
        2. 10.1.2 Specifying Space Curves
          1. Implicit
          2. Parametric
        3. 10.1.3 Drawing Curves
          1. Superellipses
        4. 10.1.4 Polynomial and Rational Parametrizations
        5. 10.1.5 Conic Sections
          1. Geometric Construction
        6. 10.1.6 Curves More Formally
      2. 10.2 Surfaces
        1. 10.2.1 Polygons
        2. 10.2.2 Meshes
        3. 10.2.3 Planar Surfaces
        4. 10.2.4 General Surfaces
        5. 10.2.5 Drawing General Surfaces
          1. Cylinder
          2. Helical Pipe
        6. 10.2.6 Swept Surfaces
          1. Torus
          2. Table
          3. Doubly-Curled Cone
          4. Extruded Helix
        7. 10.2.7 Drawing Projects
        8. 10.2.8 Ruled Surfaces
          1. Bilinear Patches
          2. Generalized Cones
          3. Generalized Cylinders
        9. 10.2.9 Quadric Surfaces
        10. 10.2.10 GLU Quadric Objects
        11. 10.2.11 Regular Polyhedra
          1. Modeling Regular Polyhedra
          2. Duality
        12. 10.2.12 Surfaces More Formally
      3. 10.3 Bézier Phrase Book
        1. 10.3.1 Curves
          1. End Tangents
        2. 10.3.2 Surfaces
          1. Bicubic Bézier Patches and How to Join Them
          2. Utah Teapot
          3. Torpedo
      4. 10.4 Fractals
      5. 10.5 Summary, Notes and More Reading
      1. Figure 10.1
      2. Figure 10.2
      3. Figure 10.3
      4. Figure 10.4
      5. Figure 10.5
      6. Figure 10.6
      7. Figure 10.7
      8. Figure 10.8
      9. Figure 10.9
      10. Figure 10.10
      11. Figure 10.11
      12. Figure 10.12
      13. Figure 10.13
      14. Figure 10.14
      15. Figure 10.15
      16. Figure 10.16
      17. Figure 10.17
      18. Figure 10.18
      19. Figure 10.19
      20. Figure 10.20
      21. Figure 10.21
      22. Figure 10.22
      23. Figure 10.23
      24. Figure 10.24
      25. Figure 10.25
      26. Figure 10.26
      27. Figure 10.27
      28. Figure 10.28
      29. Figure 10.29
      30. Figure 10.30
      31. Figure 10.31
      32. Figure 10.32
      33. Figure 10.33
      34. Figure 10.34
      35. Figure 10.35
      36. Figure 10.36
      37. Figure 10.37
      38. Figure 10.38
      39. Figure 10.39
      40. Figure 10.40
      41. Figure 10.41
      42. Figure 10.42
      43. Figure 10.43
      44. Figure 10.44
      45. Figure 10.45
      46. Figure 10.46
      47. Figure 10.47
      48. Figure 10.48
      49. Figure 10.49
      50. Figure 10.50
      51. Figure 10.51
      52. Figure 10.52
      53. Figure 10.53
      54. Figure 10.54
      55. Figure 10.55
      56. Figure 10.56
      57. Figure 10.57
      58. Figure 10.58
      59. Figure 10.59
      60. Figure 10.60
      61. Figure 10.61
      62. Figure 10.62
      63. Figure 10.63
      64. Figure 10.64
      65. Figure 10.65
      66. Figure 10.66
      67. Figure 10.67
      68. Figure 10.68
      69. Figure 10.69
      70. Figure 10.70
      71. Figure 10.71
      72. Figure 10.72
      73. Figure 10.73
      74. Figure 10.74
      75. Figure 10.75
      76. Figure 10.76
      77. Figure 10.77
      78. Figure 10.78
      79. Figure 10.79
      80. Figure 10.80
      81. Figure 10.81
  9. Part VI Lights, Camera, Equation
    1. Chapter 11 Color and Light
      1. 11.1 Vision and Color Models
        1. 11.1.1 RGB Color Model
          1. RGB Color Model and Computer Graphics
        2. 11.1.2 CMY and CMYK Color Models
        3. 11.1.3 HSV (or HSB) Color Model
        4. 11.1.4 Summary of the Models
      2. 11.2 Phong’s Lighting Model
        1. 11.2.1 Phong Basics
        2. 11.2.2 Specifying Light and Material Values
        3. 11.2.3 Calculating the Reflected Light
          1. Ambient
          2. Diffuse
          3. Specular
        4. 11.2.4 First Lighting Equation
      3. 11.3 OpenGL Light and Material Properties
        1. 11.3.1 Light Properties
        2. 11.3.2 Material Properties
        3. 11.3.3 Experimenting with Properties
        4. 11.3.4 Color Material Mode
      4. 11.4 OpenGL Lighting Model
      5. 11.5 Directional Lights, Positional Lights and Attenuation of Intensity
        1. Directional and Positional Light Sources
        2. Attenuation of Light
      6. 11.6 Spotlights
      7. 11.7 OpenGL Lighting Equation
      8. 11.8 OpenGL Shading Models
      9. 11.9 Animating Light
      10. 11.10 Partial Derivatives, Tangent Planes and Normal Vectors 101
        1. Normals from Function Gradients
      11. 11.11 Computing Normals and Lighting Surfaces
        1. 11.11.1 Polygons and Planar Surfaces
        2. 11.11.2 Meshes
        3. 11.11.3 General Surfaces
          1. Cylinder
          2. Doubly-curled Cone
          3. Programmed Normal Calculation
        4. 11.11.4 Bézier and Quadric Surfaces
          1. Canoe
          2. Movie with a Ship and Torpedo
        5. 11.11.5 Transforming Normals
        6. 11.11.6 Normalizing Normals
      12. 11.12 Phong’s Shading Model
      13. 11.13 Lighting Exercises
      14. 11.14 Summary, Notes and More Reading
      1. Figure 11.1
      2. Figure 11.2
      3. Figure 11.3
      4. Figure 11.4
      5. Figure 11.5
      6. Figure 11.6
      7. Figure 11.7
      8. Figure 11.8
      9. Figure 11.9
      10. Figure 11.10
      11. Figure 11.11
      12. Figure 11.12
      13. Figure 11.13
      14. Figure 11.14
      15. Figure 11.15
      16. Figure 11.16
      17. Figure 11.17
      18. Figure 11.18
      19. Figure 11.19
      20. Figure 11.20
      21. Figure 11.21
      22. Figure 11.22
      23. Figure 11.23
      24. Figure 11.24
      25. Figure 11.25
      26. Figure 11.26
      27. Figure 11.27
      28. Figure 11.28
      29. Figure 11.29
      30. Figure 11.30
      31. Figure 11.31
      32. Figure 11.32
      33. Figure 11.33
      34. Figure 11.34
      35. Figure 11.35
      36. Figure 11.36
      37. Figure 11.37
      38. Figure 11.38
      39. Figure 11.39
      40. Figure 11.40
      41. Figure 11.41
      42. Figure 11.42
      43. Figure 11.43
      44. Figure 11.44
      45. Figure 11.45
      46. Figure 11.46
      47. Figure 11.47
      48. Figure 11.48
    2. Chapter 12 Texture
      1. 12.1 Texture Basics and the Texture Map
        1. Texture Coordinates
      2. 12.2 Repeating and Clamping Textures
      3. 12.3 Filtering
      4. 12.4 Specifying Texture Coordinates
        1. 12.4.1 Parametrized Surfaces
        2. 12.4.2 Bézier and Quadric Surfaces
        3. 12.4.3 Texture Matrix and Animating Textures
      5. 12.5 Lighting Textures
      6. 12.6 Multitexturing and Texture Combining
      7. 12.7 Summary, Notes and More Reading
      1. Figure 12.1
      2. Figure 12.2
      3. Figure 12.3
      4. Figure 12.4
      5. Figure 12.5
      6. Figure 12.6
      7. Figure 12.7
      8. Figure 12.8
      9. Figure 12.9
      10. Figure 12.10
      11. Figure 12.11
      12. Figure 12.12
      13. Figure 12.13
      14. Figure 12.14
      15. Figure 12.15
      16. Figure 12.16
      17. Figure 12.17
      18. Figure 12.18
      19. Figure 12.19
      20. Figure 12.20
      21. Figure 12.21
      22. Figure 12.22
      23. Figure 12.23
      24. Figure 12.24
      25. Figure 12.25
      26. Figure 12.26
      27. Figure 12.27
      28. Figure 12.28
    3. Chapter 13 Special Visual Techniques
      1. 13.1 Blending
        1. 13.1.1 Theory
          1. No Blending
          2. The Difference with Blending
          3. Specifying Blending Factors: Alpha
        2. 13.1.2 Experiments
        3. 13.1.3 Opaque and Translucent Objects Together
        4. 13.1.4 Blending Textures
        5. 13.1.5 Creating Reflections
      2. 13.2 Fog
      3. 13.3 Billboarding
      4. 13.4 Antialiasing Points and Lines, Multisampling Polygons
        1. 13.4.1 Antialiasing
          1. Rendering points
        2. 13.4.2 Multisampling
      5. 13.5 Point Sprites
      6. 13.6 Environment Mapping
        1. 13.6.1 Sphere Mapping
          1. Getting It to Work
          2. How It Works
          3. Bottom Line
          4. Preparing the Environment Texture
        2. 13.6.2 Cube Mapping
      7. 13.7 Stencil Buffer Techniques
        1. 13.7.1 OpenGL Buffers
        2. 13.7.2 Using the Stencil Buffer
          1. Scissor Test
      8. 13.8 Image and Pixel Data Manipulation
        1. Pixel Buffer Objects
      9. 13.9 Bump Mapping
      10. 13.10 Summary, Notes and More Reading
      1. Figure 13.1
      2. Figure 13.2
      3. Figure 13.3
      4. Figure 13.4
      5. Figure 13.5
      6. Figure 13.6
      7. Figure 13.7
      8. Figure 13.8
      9. Figure 13.9
      10. Figure 13.10
      11. Figure 13.11
      12. Figure 13.12
      13. Figure 13.13
      14. Figure 13.14
      15. Figure 13.15
      16. Figure 13.16
      17. Figure 13.17
      18. Figure 13.18
      19. Figure 13.19
      20. Figure 13.20
      21. Figure 13.21
      22. Figure 13.22
      23. Figure 13.23
      24. Figure 13.24
      25. Figure 13.25
      26. Figure 13.26
      27. Figure 13.27
      28. Figure 13.28
      29. Figure 13.29
  10. Part VII Pixels, Pixels, Everywhere
    1. Chapter 14 Raster Algorithms
      1. 14.1 Cohen-Sutherland Line Clipper
        1. Outcodes and Trivial Termination
        2. Recursion
        3. Complexity
      2. 14.2 Sutherland-Hodgeman Polygon Clipper
        1. Output Rules for Left Clipper
        2. Pipelining
      3. 14.3 DDA and Bresenham’s Line Rasterizers
        1. DDA Algorithm – Floating Point Heavy
        2. Eliminating Floating Points – Bresenham’s Algorithm
      4. 14.4 Scan-Based Polygon Rasterizer
        1. Parity Test
        2. Ownership of Boundary Pixels
        3. 14.4.1 Algorithms
        4. 14.4.2 Optimizing Using Edge Coherence – Active Edge List
          1. Initialization – Edge Table
          2. Processing the AEL
          3. Flood-fill
      5. 14.5 Summary, Notes and More Reading
      1. Figure 14.1
      2. Figure 14.2
      3. Figure 14.3
      4. Figure 14.4
      5. Figure 14.5
      6. Figure 14.6
      7. Figure 14.7
      8. Figure 14.8
      9. Figure 14.9
      10. Figure 14.10
      11. Figure 14.11
      12. Figure 14.12
      13. Figure 14.13
      14. Figure 14.14
      15. Figure 14.15
      16. Figure 14.16
      17. Figure 14.17
      18. Figure 14.18
      19. Figure 14.19
      20. Figure 14.20
      21. Figure 14.21
      22. Figure 14.22
      23. Figure 14.23
      24. Figure 14.24
      25. Figure 14.25
      26. Figure 14.26
      27. Figure 14.27
      28. Figure 14.28
  11. Part VIII Anatomy of Curves and Surfaces
    1. Chapter 15 Bézier
      1. 15.1 Bézier Curves
        1. 15.1.1 Linear Bézier Curves
        2. 15.1.2 Quadratic Bézier Curves
        3. 15.1.3 Cubic Bézier Curves
        4. 15.1.4 General Bézier Curves
          1. Recursive de Casteljau
          2. Affine Invariance of Bézier Curves
          3. End Tangents and Joining Bézier Curves
          4. Polynomial Curves and Bézier Curves
      2. 15.2 Bézier Surfaces
      3. 15.3 Summary, Notes and More Reading
      1. Figure 15.1
      2. Figure 15.2
      3. Figure 15.3
      4. Figure 15.4
      5. Figure 15.5
      6. Figure 15.6
      7. Figure 15.7
      8. Figure 15.8
      9. Figure 15.9
      10. Figure 15.10
      11. Figure 15.11
      12. Figure 15.12
      13. Figure 15.13
      14. Figure 15.14
      15. Figure 15.15
    2. Chapter 16 B-Spline
      1. 16.1 Problems with Bézier Primitives: Motivating B-Splines
      2. 16.2 B-Spline Curves
        1. 16.2.1 First-Order B-Splines
          1. First-Order B-Spline Curves
          2. First-order B-Spline Properties
        2. 16.2.2 Linear B-Splines
          1. Linear B-Spline Curves
          2. Linear B-Spline Properties
        3. 16.2.3 Quadratic B-Splines
          1. Quadratic B-Spline Curves
          2. Quadratic B-Spline Properties
        4. 16.2.4 Cubic B-Splines
          1. Cubic B-Spline Curves
          2. Cubic B-Spline Properties
        5. 16.2.5 General B-Splines and Non-uniform Knot Vectors
          1. General B-Spline Curves
          2. Non-uniform Knot Vectors
          3. Multiple Knots
          4. Bézier Curves and Spline Curves
      3. 16.3 B-Spline Surfaces
      4. 16.4 Drawing B-Spline Curves and Surfaces
        1. 16.4.1 B-Spline Curves
        2. 16.4.2 B-Spline Surfaces
        3. 16.4.3 Lighting and Texturing a B-Spline Surface
        4. 16.4.4 Trimmed B-Spline Surface
      5. 16.5 Summary, Notes and More Reading
      1. Figure 16.1
      2. Figure 16.2
      3. Figure 16.3
      4. Figure 16.4
      5. Figure 16.5
      6. Figure 16.6
      7. Figure 16.7
      8. Figure 16.8
      9. Figure 16.9
      10. Figure 16.10
      11. Figure 16.11
      12. Figure 16.12
      13. Figure 16.13
      14. Figure 16.14
      15. Figure 16.15
      16. Figure 16.16
      17. Figure 16.17
      18. Figure 16.18
      19. Figure 16.19
      20. Figure 16.20
      21. Figure 16.21
      22. Figure 16.22
      23. Figure 16.23
      24. Figure 16.24
      25. Figure 16.25
      26. Figure 16.26
      27. Figure 16.27
      28. Figure 16.28
      29. Figure 16.29
      30. Figure 16.30
      31. Figure 16.31
      32. Figure 16.32
      33. Figure 16.33
      34. Figure 16.34
      35. Figure 16.35
      36. Figure 16.36
      37. Figure 16.37
      38. Figure 16.38
      39. Figure 16.39
      40. Figure 16.40
      41. Figure 16.41
    3. Chapter 17 Hermite
      1. 17.1 Hermite Splines
      2. 17.2 Natural Cubic Splines
      3. 17.3 Cardinal Splines
      4. 17.4 Hermite Surface Patches
        1. Lagrange Interpolation
      5. 17.5 Summary, Notes and More Reading
      1. Figure 17.1
      2. Figure 17.2
      3. Figure 17.3
      4. Figure 17.4
      5. Figure 17.5
      6. Figure 17.6
      7. Figure 17.7
  12. Part IX Well Projected
    1. Chapter 18 Applications of Projective Spaces
      1. 18.1 OpenGL Projection Transformations
        1. 18.1.1 Viewing Box to Canonical Viewing Box
        2. 18.1.2 Viewing Frustum to Canonical Viewing Box
          1. Projection Matrix of gluPerspective()
        3. 18.1.3 Projection Matrix in the Pipeline
      2. 18.2 Shadow Mapping
      3. 18.3 Rational Bézier and NURBS Curves and Surfaces
        1. 18.3.1 Rational Bézier Curves Basics
        2. 18.3.2 Drawing Rational Bézier Curves
        3. 18.3.3 Rational Bézier Curves and Conic Sections
        4. 18.3.4 Properties of Rational Bézier Curves
        5. 18.3.5 Rational Bézier Curves and Projective Invariance
        6. 18.3.6 Rational Bézier Curves in the Real World
        7. 18.3.7 Rational Bézier Surfaces
          1. Drawing Rational Bézier Surfaces
        8. 18.3.8 The ‘R’ in NURBS
          1. Drawing NURBS Curves and Surfaces
      4. 18.4 Summary, Notes and More Reading
      1. Figure 18.1
      2. Figure 18.2
      3. Figure 18.3
      4. Figure 18.4
      5. Figure 18.5
      6. Figure 18.6
      7. Figure 18.7
      8. Figure 18.8
      9. Figure 18.9
      10. Figure 18.10
      11. Figure 18.11
      12. Figure 18.12
      13. Figure 18.13
      14. Figure 18.14
  13. Part X The Time is Pipe
    1. Chapter 19 Fixed-Functionality Pipelines
      1. 19.1 Synthetic-Camera Pipeline
        1. 19.1.1 Pipeline: Preliminary Version
        2. 19.1.2 Perspective Division by Zero
        3. 19.1.3 Rasterization with Perspectively Correct Interpolation
        4. 19.1.4 Revised Pipeline
        5. 19.1.5 OpenGL Fixed-function Pipeline
        6. 19.1.6 1D Primitive Example
        7. 19.1.7 Exercising the Pipeline
      2. 19.2 Ray Tracing Pipeline
        1. 19.2.1 Going Global: Shadows
        2. 19.2.2 Going Even More Global: Recursive Reflection and Transmission
        3. 19.2.3 Implementing Ray Tracing
      3. 19.3 Radiosity
        1. 19.3.1 Introduction
        2. 19.3.2 Basic Theory
        3. 19.3.3 Computing Form Factors
        4. 19.3.4 Solving the Radiosity Equation to Determine Patch Brightnesses
        5. 19.3.5 Implementing Radiosity
      4. 19.4 Summary, Notes and More Reading
      1. Figure 19.1
      2. Figure 19.2
      3. Figure 19.3
      4. Figure 19.4
      5. Figure 19.5
      6. Figure 19.6
      7. Figure 19.7
      8. Figure 19.8
      9. Figure 19.9
      10. Figure 19.10
      11. Figure 19.11
      12. Figure 19.12
      13. Figure 19.13
      14. Figure 19.14
      15. Figure 19.15
      16. Figure 19.16
      17. Figure 19.17
      18. Figure 19.18
      19. Figure 19.19
      20. Figure 19.20
      21. Figure 19.21
      22. Figure 19.22
      23. Figure 19.23
      24. Figure 19.24
  14. Part XI Rendering Pipe Dreams
    1. Chapter 20 OpenGL 4.3, Shaders and the Programmable Pipeline: Liftoff
      1. 20.1 New Pipeline for OpenGL
        1. 20.1.1 Shaders in the Rendering Pipeline
        2. 20.1.2 New OpenGL
          1. Defining the OpenGL Context
      2. 20.2 GLSL Basics
      3. 20.3 First Core GL 4.3 Program (Dissected)
        1. Compiling and Linking Shaders
        2. Initializing Data and Communicating with the Vertex Shader
        3. Remaining Routines
        4. Vertex Shader
        5. Fragment Shader
      4. 20.4 Animation
        1. OpenGL Mathematics (GLM)
      5. 20.5 Lighting
        1. 20.5.1 Per-Vertex Lighting
        2. 20.5.2 Per-Pixel Lighting
      6. 20.6 Textures
      7. 20.7 Summary, Notes and More Reading
      1. Figure 20.1
      2. Figure 20.2
      3. Figure 20.3
      4. Figure 20.4
      5. Figure 20.5
      6. Figure 20.6
      7. Figure 20.7
      8. Figure 20.8
      9. Figure 20.9
      10. Figure 20.10
      11. Figure 20.11
      1. Table 20.1
      2. Table 20.2
    2. Chapter 21 OpenGL 4.3, Shaders and the Programmable Pipeline: Escape Velocity
      1. 21.1 Toolbox
        1. Vertex Arrays, VBOs and VAOs
        2. 21.1.1 VAOs and Instanced Rendering Instead of Display Lists
          1. Instanced Vertex Attributes
          2. Instance Counter in the Shader
          3. Text Drawing, Mouse Programming, Special Keys and Menus
        3. 21.1.2 Do-It-Yourself Line Stipples
          1. FreeGLUT Objects not Free Anymore
        4. 21.1.3 Clipping Planes
          1. gluPerspective() and GLU in General
          2. Viewports and Multiple Windows
      2. 21.2 Shader Subroutines
      3. 21.3 More Animation
        1. 21.3.1 Picking
        2. 21.3.2 Transform Feedback
      4. 21.4 Special Visual Techniques
        1. Blending
        2. Not the Foggiest
        3. Billboarding
        4. Antialiasing Lines
        5. 21.4.1 Points
          1. Point Sprites
          2. Multisampling
          3. Difficult Environment for Mapping
          4. Stencils and Scissors
          5. Image Manipulation and PBOs
          6. Bump Mapping
      5. 21.5 Tessellation Shaders
        1. 21.5.1 TCS (Tessellation Control Shader)
        2. 21.5.2 TES (Tessellation Evaluation Shader)
        3. 21.5.3 TPG (Tessellation Primitive Generator)
          1. quads
          2. Isolines
          3. Triangles
      6. 21.6 Geometry Shaders
        1. Adjacency Primitive Types
      7. 21.7 Summary, Notes and More Reading
      1. Figure 21.1
      2. Figure 21.2
      3. Figure 21.3
      4. Figure 21.4
      5. Figure 21.5
      6. Figure 21.6
      7. Figure 21.7
      8. Figure 21.8
      9. Figure 21.9
      10. Figure 21.10
      11. Figure 21.11
      12. Figure 21.12
      13. Figure 21.13
      14. Figure 21.14
      15. Figure 21.15
      16. Figure 21.16
      17. Figure 21.17
      18. Figure 21.18
      19. Figure 21.19
      20. Figure 21.20
      21. Figure 21.21
      22. Figure 21.22
      23. Figure 21.23
      24. Figure 21.24
      1. Table 21.1
      2. Table 21.2
  15. Appendices
    1. Appendix A Projective Spaces and Transformations
      1. A.1 Motivation and Definition of the Projective Plane
      2. A.2 Geometry on the Projective Plane and Point-Line Duality
      3. A.3 Homogeneous Coordinates
      4. A.4 Structure of the Projective Plane
        1. A.4.1 Embedding the Real Plane in the Projective Plane
        2. A.4.2 A Thought Experiment
        3. A.4.3 Regular Points and Points at Infinity
      5. A.5 Snapshot Transformations
      6. A.6 Homogeneous Polynomial Equations
        1. A.6.1 More About Point-Line Duality
        2. A.6.2 Lifting an Algebraic Curve from the Real to the Projective Plane
        3. A.6.3 Snapshot Transformations Algebraically
      7. A.7 The Dimension of the Projective Plane and Its Generalization to Higher Dimensions
      8. A.8 Projective Transformations Defined
      9. A.9 Projective Transformations Geometrically
      10. A.10 Relating Projective, Snapshot and Affine Transformations
        1. A.10.1 Snapshot Transformations via Projective Transformations
        2. A.10.2 Affine Transformations via Projective Transformations
          1. A Roundup of the Three Kinds of Transformations
      11. A.11 Designer Projective Transformations
        1. Figure A.1
        2. Figure A.2
        3. Figure A.3
        4. Figure A.4
        5. Figure A.5
        6. Figure A.6
        7. Figure A.7
        8. Figure A.8
        9. Figure A.9
        10. Figure A.10
        11. Figure A.11
        12. Figure A.12
        13. Figure A.13
        14. Figure A.14
        15. Figure A.15
        16. Figure A.16
        17. Figure A.17
        18. Figure A.18
        19. Figure A.19
        20. Figure A.20
        21. Figure A.21
        22. Figure A.22
        23. Figure A.23
        24. Figure A.24
        25. Figure A.25
        26. Figure A.26
    2. Appendix B Math Self-Test
      1. Figure B.1
      2. Figure B.2
      3. Figure B.3
    3. Appendix C Math Self-Test Solutions
      1. Figure C.1
      2. Figure C.2
      3. Figure C.3
      4. Figure C.4
  16. Bibliography