A Top-Down Approach with WebGL
Slutsåld
OpenGL¿: A Primer is a concise presentation of fundamental OpenGL, providing readers with a succinct introduction to essential OpenGL commands as well as detailed listings of OpenGL functions and parameters. Angel uses a top-down philosophy to tea...
Edward Angel is a professor of computer science, electrical and computer engineering, and media arts at the University of New Mexico. He holds a PhD from the University of Southern California and a BS in engineering from the California Institute of Technology. He is also the director of Art, Research, Technology, and Science Laboratory (ARTS Lab) and the Arts Technology Center at the University of New Mexico. He is the author of Interactive Computer Graphics and Dave's been working in the computer graphics industry for the past two decades, where he's authored applications for flight simulators, scientific visualization, production animation, and numerous other disciplines. Also passionate about educating programmers about OpenGL and computer graphics, he's presented lectures and short courses at conference world wide, including SIGGRAPH and the Games Developer Conference.
CHAPTER 1 GRAPHICS SYSTEMS AND MODELS 1
1.1 Applications of Computer Graphics 2
1.1.1 Display of Information 2
1.1.2 Design 3
1.1.3 Simulation and Animation 3
1.1.4 User Interfaces 4
1.2 A Graphics System 5
1.2.1 Pixels and the Framebuffer 5
1.2.2 The CPU and the GPU 6
1.2.3 Output Devices 7
1.2.4 Input Devices 9
1.3 Images: Physical and Synthetic 10
1.3.1 Objects and Viewers 10
1.3.2 Light and Images 12
1.3.3 Imaging Models 13
1.4 Imaging Systems 15
1.4.1 The Pinhole Camera 15
1.4.2 The Human Visual System 17
1.5 The Synthetic-Camera Model 18
1.6 The Programmers Interface 20
1.6.1 The Pen-Plotter Model 21
1.6.2 Three-Dimensional APIs 23
1.6.3 A Sequence of Images 26
1.6.4 The ModelingRendering Paradigm 27
1.7 Graphics Architectures 28
1.7.1 Display Processors 29
1.7.2 Pipeline Architectures 29
1.7.3 The Graphics Pipeline 30
1.7.4 Vertex Processing 31
1.7.5 Clipping and Primitive Assembly 31
1.7.6 Rasterization 32
1.7.7 Fragment Processing 32
1.8 Programmable Pipelines 32
1.9 Performance Characteristics 33
1.10 OpenGL Versions and WebGL 34
Summary and Notes 36
Suggested Readings 36
Exercises 37
CHAPTER 2 GRAPHICS PROGRAMMING 39
2.1 The Sierpinski Gasket 39
2.2 Programming Two-Dimensional Applications 42
2.3 The WebGL Application Programming Interface 47
2.3.1 Graphics Functions 47
2.3.2 The Graphics Pipeline and State Machines 49
2.3.3 OpenGL and WebGL 50
2.3.4 The WebGL Interface 50
2.3.5 Coordinate Systems 51
2.4 Primitives and Attributes 53
2.4.1 Polygon Basics 55
2.4.2 Polygons in WebGL 56
2.4.3 Approximating a Sphere 57
2.4.4 Triangulation 58
2.4.5 Text 59
2.4.6 Curved Objects 60
2.4.7 Attributes 61
2.5 Color 62
2.5.1 RGB Color 64
2.5.2 Indexed Color 66
2.5.3 Setting of Color Attributes 67
2.6 Viewing 68
2.6.1 The Orthographic View 68
2.6.2 Two-Dimensional Viewing 71
2.7 Control Functions 71
2.7.1 Interaction with the Window System 72
2.7.2 Aspect Ratio and Viewports 73
2.7.3 Application Organization 74
2.8 The Gasket Program 75
2.8.1 Sending Data to the GPU 78
2.8.2 Rendering the Points 78
2.8.3 The Vertex Shader 79
2.8.4 The Fragment Shader 80
2.8.5 Combining the Parts 80
2.8.6 The initShaders Function 81
2.8.7 The init Function 82
2.8.8 Reading the Shaders from the Application 83
2.9 Polygons and Recursion 83
2.10 The Three-Dimensional Gasket 86
2.10.1 Use of Three-Dimensional Points 86
2.10.2 Naming Conventions 88
2.10.3 Use of Polygons in Three Dime...