Skip to main content

OpenGL: A Primer, 3rd edition

  • eText

    Digital book that you can read instantly

  • Print

    Hardcover, paperback, or loose-leaf


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 teach computer graphics based on the idea that students learn modern computer graphics best if they can start programming significant applications as soon as possible. The book makes it easy for students to find functions and their descriptions, and supplemental examples are included in every chapter to illustrate core concepts. This primer can be used both as a companion to a book introducing computer graphics principles and as a stand-alone guide and reference to OpenGL for programmers with a background in computer graphics.

Table of contents


1. Introduction.
The OpenGL API.
What's in OpenGL.
OpenGL Versions of Extensions.
Programming Conventions.
Who Should Use this Primer.

2. Two-Dimensional Programming in OpenGL.
A Simple Program.
Event Loops and Callback Functions.
Drawing a Rectangle.
Changing the GLUT Defaults.
Color in OpenGL.
Coordinate System Differences Between Gand OpenGL.
Two-Dimensional Viewing.
The Viewport.
Coordinate Systems and Transformations.
Simple C, Second Version.
Primitives and Attributes.
Polygon Types.
Color Interpolation.
Inquires and Errors.
Saving the State.

3. Interaction and Animation.
The Reshape Callback.
The Idle Callback.
A Rotating Square.
Double Buffering.
Using the Keyboard.
Using the Mouse Callback.
Mouse Motion.
The NULL Callback.
Sub and Multiple Windows.
Example: single_double.c.
Display Lists.
Picking and Selection Mode.

4. Basic Three-Dimensional Programming.
Cameras and Objects.
Orthographic Projects in OpenGL.
Viewing a Cube.
Locating the Camera.
Building Objects.
Hidden Surface Removal.
GLU and GLUT Objects.
Perspective Projects.

5. Transformations.
Line-Preserving Transformations.
Homogeneous Coordinates.
The Model-View and Projection Transformations.
A Rotating Cube.
Setting Matrices Directly.
Transformations and Coordinate Systems.
Modeling with Transformations.

6. Lights and Materials.
Light/Material Interactions.
The Phong Model.
OpenGL Lighting.
Specifying a Light Source.
Specifying a Material.
Shading the Rotating Cube.
Controlling the Lighting Calculation.
Smooth Shading.
Working with Normals.

7. Images.
Pixels and Bitmaps.
Drawing Modes.
Reading and Writing Pixels.
Selecting Buffers.
Pixel Store Modes.
Displaying a PPM Image.
Using Luminance.
Pixel Mapping.
Pixel Zoom.
Image Processing in OpenGL.

8. Texture Mapping.
What is a Texture Map?
Constructing a Texture Map.
Texture Coordinates.
Texture Parameters.
A Rotating Cube with Texture.
Applying Textures to Surfaces.
Borders and Sizing.
Automatic Texture Coordinate Generation.
Texture Maps for Image Manipulation.

9. Curves and Surfaces.
Parametric Curves.
Parametric Surfaces.
Bézier Curves and Surfaces.
One-Dimensional OpenGL Evaluators.
Two-Dimensional Evaluators.
An Interactive Example.
Other Types of Cures.
The Utah Teapot.
Normals and Shading.
Interpreting Surfaces.

10. Putting It Together.
A Demo Program.
Other OpenGL Features.
Writing Portable, Efficient, Robust Code.

11. Looking to the Future.
Versions and Extensions.
OPenGL Extensions.
Going Beyond Real-Time Graphics.
Programmable Pipelines.
Shading Languages.


For teachers

All the material you need to teach your courses.

Discover teaching material

Published by Pearson (April 25th 2007) - Copyright © 2008