Home > Store

OpenGL® Programming Guide: The Official Guide to Learning OpenGL, Version 1.2, 3rd Edition

Register your product to gain access to bonus material or receive a coupon.

OpenGL® Programming Guide: The Official Guide to Learning OpenGL, Version 1.2, 3rd Edition

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 1999
  • Edition: 3rd
  • Book
  • ISBN-10: 0-201-60458-2
  • ISBN-13: 978-0-201-60458-0

OpenGL is a powerful software interface used to produce high-quality computer generated images and interactive applications using 2D and 3D objects and color bitmaps and images.

The OpenGL Programming Guide, Third Edition, provides definitive and comprehensive information on OpenGL and the OpenGL Utility Library. This book discusses all OpenGL functions and their syntax shows how to use those functions to create interactive applications and realistic color images.

You will find clear explanations of OpenGL functionality and many basic computer graphics techniques such as building and rendering 3D models; interactively viewing objects from different perspective points; and using shading, lighting, and texturing effects for greater realism. In addition, this book provides in-depth coverage of advanced techniques, including texture mapping, antialiasing, fog and atmospheric effects, NURBS, image processing, and more. The text also explores other key topics such as enhancing performance, OpenGL extensions, and cross-platform techniques.

This third edition has been extensively updated to include the newest features of OpenGL, Version 1.2, including:

  • 3D texture mapping
  • Multitexturing
  • New pixel storage formats, including packed and reversed (BGRA) formats
  • Specular lighting after texturing
  • The OpenGL imaging subset
  • New GLU routines and functionality
Numerous code examples are provided to practical programming techniques. The color plate section illustrates the power and sophistication of the newest version of OpenGL.

The OpenGL Technical Library provides tutorial and reference books for OpenGL. The library enables programmers to gain a practical understanding of OpenGL and shows them how to unlock its full potential.

The OpenGL Technical Library was originally developed by SGI and continues to evelove under the auspices of the Architecture Review Board (ARB), an industry consortium responsible for guiding the evolution of OpenGL and related technologies. The OpenGL ARB is composed of industry leaders, such as 3Dlabs, Compaq, Evans & Sutherland, Hewlett-Packard, IBM, Intel, Intergraph, Microsoft, NVIDIA, and SGI.

The OpenGL Programming Guide, Third Edition was written by Mason Woo, Jackie Neider, Tom Davis, and Dave Shreiner.

0201604582B04062001

Downloads

Source Code

Click below for Source Code related to this title:
Source Code

Sample Content

Table of Contents



About This Guide.


What This Guide Contains.


What's New in This Edition.


What You Should Know Before Reading This Guide.


How to Obtain the Sample Code.


Nate Robins' OpenGL Tutors.


Errata.


Style Conventions.


Acknowledgments.


Figures.


Tables.


Examples.


1. Introduction to OpenGL.

What Is OpenGL?

A Smidgen of OpenGL Code.

OpenGL Command Syntax.

OpenGL as a State Machine.

OpenGL Rendering Pipeline.

Display Lists.

Evaluators.

Per-Vertex Operations.

Primitive Assembly.

Pixel Operations.

Texture Assembly.

Rasterization.

Fragment Operations.

OpenGL-Related Libraries.

Include Files.

GLUT, the OpenGL Utility Toolkit.

Animation.

The Refresh That Pauses.

Motion = Redraw + Swap.



2. State Management and Drawing Geometric Objects.

A Drawing Survival Kit.

Clearing the Window.

Specifying a Color.

Forcing Completion of Drawing.

Coordinate System Survival Kit.

Describing Points, Lines, and Polygons.

What Are Points, Lines, and Polygons?

Specifying Vertices.

OpenGL Geometric Drawing Primitives.

Basic State Management.

Displaying Points, Lines, and Polygons.

Point Details.

Line Details.

Polygon Details.

Normal Vectors.

Vertex Arrays.

Step 1: Enabling Arrays.

Step 2: Specifying Data for the Arrays.

Step 3: Dereferencing and Rendering.

Interleaved Arrays.

Attribute Groups.

Some Hints for Building Polygonal Models of Surfaces.

An Example: Building an Icosahedron.



3. Viewing.

Overview: The Camera Analogy.

A Simple Example: Drawing a Cube.

General-Purpose Transformation Commands.

Viewing and Modeling Transformations.

Thinking about Transformations.

Modeling Transformations.

Viewing Transformations.

Projection Transformations.

Perspective Projection.

Orthographic Projection.

Viewing Volume Clipping.

Viewport Transformation.

Defining the Viewport.

The Transformed Depth Coordinate.

Troubleshooting Transformations.

Manipulating the Matrix Stacks.

The Modelview Matrix Stack.

The Projection Matrix Stack.

Additional Clipping Planes.

Examples of Composing Several Transformations.

Building a Solar System.

Building an Articulated Robot Arm.

Reversing or Mimicking Transformations.



4. Color.

Color Perception.

Computer Color.

RGBA versus Color-Index Mode.

RGBA Display Mode.

Color-Index Display Mode.

Choosing between RGBA and Color-Index Mode.

Changing between Display Modes.

Specifying a Color and a Shading Model.

Specifying a Color in RGBA Mode.

Specifying a Color in Color-Index Mode.

Specifying a Shading Model.



5. Lighting.

A Hidden-Surface Removal Survival Kit.

Real-World and OpenGL Lighting.

Ambient, Diffuse, Specular, and Emissive Light.

Material Colors.

RGB Values for Lights and Materials.

A Simple Example: Rendering a Lit Sphere.

Creating Light Sources.

Color.

Position and Attenuation.

Spotlights.

Multiple Lights.

Controlling a Light's Position and Direction.

Selecting a Lighting Model.

Global Ambient Light.

Local or Infinite Viewpoint.

Two-Sided Lighting.

Separate Specular Color.

Enabling Lighting.

Defining Material Properties.

Diffuse and Ambient Reflection.

Specular Reflection.

Emission.

Changing Material Properties.

Color Material Mode.

The Mathematics of Lighting.

Material Emission.

Scaled Global Ambient Light.

Contributions from Light Sources.

Putting It All Together.

Separate Specular Color.

Lighting in Color-Index Mode.

The Mathematics of Color-Index Mode Lighting.



6. Blending, Antialiasing, Fog, and Polygon Offset.

Blending.

The Source and Destination Factors.

Sample Uses of Blending.

A Blending Example.

Three-Dimensional Blending with the Depth Buffer.

Antialiasing.

Antialiasing Points or Lines.

Antialiasing Polygons.

Fog.

Using Fog.

Fog Equations.

Polygon Offset.



7. Display Lists.

An Example of Using a Display List.

Display List Design Philosophy.

Creating and Executing a Display List.

Naming and Creating a Display List.

What's Stored in a Display List?

Executing a Display List.

Hierarchical Display Lists.

Managing Display List Indices.

Executing Multiple Display Lists.

Managing State Variables with Display Lists.

Encapsulating Mode Changes.



8. Drawing Pixels, Bitmaps, Fonts, and Images.

Bitmaps and Fonts.

The Current Raster Position.

Drawing the Bitmap.

Choosing a Color for the Bitmap.

Fonts and Display Lists.

Defining and Using a Complete Font.

Images.

Reading, Writing, and Copying Pixel Data.

Imaging Pipeline.

Pixel Packing and Unpacking.

Controlling Pixel-Storage Modes.

Pixel-Transfer Operations.

Pixel Mapping.

Magnifying, Reducing, or Flipping an Image.

Reading and Drawing Pixel Rectangles.

The Pixel Rectangle Drawing Process.

Tips for Improving Pixel Drawing Rates.

Imaging Subset.

Color Tables.

Convolutions.

Color Matrix.

Histogram.

Minmax.

Combining Pixels Using Blending Equations.

Constant Blending Factors.



9. Texture Mapping.

An Overview and an Example.

Steps in Texture Mapping.

A Sample Program.

Specifying the Texture.

Texture Proxy.

Replacing All or Part of a Texture Image.

One-Dimensional Textures.

Three-Dimensional Textures.

Using a Texture's Borders.

Multiple Levels of Detail.

Filtering.

Texture Objects.

Naming A Texture Object.

Creating and Using Texture Objects.

Cleaning Up Texture Objects.

A Working Set of Resident Textures.

Texture Functions.

Post-Texture Application of Specular Color.

Assigning Texture Coordinates.

Computing Appropriate Texture Coordinates.

Repeating and Clamping Textures.

Automatic Texture-Coordinate Generation.

Creating Contours.

Environment Mapping.

Advanced Features.

The Texture Matrix Stack.

Multitexturing.



10. The Framebuffer.

Buffers and Their Uses.

Color Buffers.

Clearing Buffers.

Selecting Color Buffers for Writing and Reading.

Masking Buffers.

Testing and Operating on Fragments.

Scissor Test.

Alpha Test.

Stencil Test.

Depth Test.

Blending, Dithering, and Logical Operations.

The Accumulation Buffer.

Scene Antialiasing.

Motion Blur.

Depth of Field.

Soft Shadows.

Jittering.



11. Tessellators and Quadrics.

Polygon Tessellation.

Creating a Tessellation Object.

Tessellation Callback Routines.

Tessellation Properties.

Polygon Definition.

Deleting a Tessellation Object.

Tessellation Performance Tips.

Describing GLU Errors.

Backward Compatibility.

Quadrics: Rendering Spheres, Cylinders, and Disks.

Managing Quadrics Objects.

Controlling Quadrics Attributes.

Quadrics Primitives.



12. Evaluators and NURBS.

Prerequisites.

Evaluators.

One-Dimensional Evaluators.

Two-Dimensional Evaluators.

Using Evaluators for Textures.

The GLU NURBS Interface.

A Simple NURBS Example.

Managing a NURBS Object.

Creating a NURBS Curve or Surface.

Trimming a NURBS Surface.



13. Selection and Feedback.

Selection.

The Basic Steps.

Creating the Name Stack.

The Hit Record.

A Selection Example.

Picking.

Hints for Writing a Program That Uses Selection.

Feedback.

The Feedback Array.

Using Markers in Feedback Mode.

A Feedback Example.



14. Now That You Know.

Error Handling.

Which Version Am I Using?

Utility Library Version.

Window System Extension Versions.

Extensions to the Standard.

Extensions to the Standard for Microsoft Windows (WGL).

Cheesy Translucency.

An Easy Fade Effect.

Object Selection Using the Back Buffer.

Cheap Image Transformation.

Displaying Layers.

Antialiased Characters.

Drawing Round Points.

Interpolating Images.

Making Decals.

Drawing Filled, Concave Polygons Using the Stencil Buffer.

Finding Interference Regions.

Shadows.

Hidden-Line Removal.

Hidden-Line Removal with Polygon Offset.

Hidden-Line Removal with the Stencil Buffer.

Texture Mapping Applications.

Drawing Depth-Buffered Images.

Dirichlet Domains.

Life in the Stencil Buffer.

Alternative Uses for glDrawPixels() and glCopyPixels().



A. Order of Operations.

Overview.

Geometric Operations.

Per-Vertex Operations.

Primitive Assembly.

Pixel Operations.

Texture Memory.

Fragment Operations.

Odds and Ends.



B. State Variables.

The Query Commands.

OpenGL State Variables.

Current Values and Associated Data.

Vertex Array.

Transformation.

Coloring.

Lighting.

Rasterization.

Texturing.

Pixel Operations.

Framebuffer Control.

Pixels.

Evaluators.

Hints.

Implementation-Dependent Values.

Implementation-Dependent Pixel Depths.

Miscellaneous.



C. OpenGL and Window Systems.

GLX: OpenGL Extension for the X Window System.

Initialization.

Controlling Rendering.

GLX Prototypes.

AGL: OpenGL Extensions for the Apple Macintosh.

Initialization.

Rendering and Contexts.

Managing an OpenGL Rendering Context.

On-Screen Rendering.

Off-Screen Rendering.

Full-Screen Rendering.

Swapping Buffers.

Updating the Rendering Buffers.

Using an Apple Macintosh Font.

Error Handling.

AGL Prototypes.

PGL: OpenGL Extension for IBM OS/2 Warp.

Initialization.

Controlling Rendering.

PGL Prototypes.

WGL: OpenGL Extension for Microsoft Windows 95/98/NT.

Initialization.

Controlling Rendering.

WGL Prototypes.



D. Basics of GLUT: The OpenGL Utility Toolkit.

Initializing and Creating a Window.

Handling Window and Input Events.

Loading the Color Map.

Initializing and Drawing Three-Dimensional Objects.

Managing a Background Process.

Running the Program.



E. Calculating Normal Vectors.

Finding Normals for Analytic Surfaces.

Finding Normals from Polygonal Data.



F. Homogeneous Coordinates and Transformation Matrices.

Homogeneous Coordinates.

Transforming Vertices.

Transforming Normals.

Transformation Matrices.

Translation.

Scaling.

Rotation.

Perspective Projection.

Orthographic Projection.



G. Programming Tips.

OpenGL Correctness Tips.

OpenGL Performance Tips.

GLX Tips.



H. OpenGL Invariance.


Glossary.


Index.

Preface

The OpenGL graphics system is a software interface to graphics hardware. (The GL stands for Graphics Library.) It allows you to create interactive programs that produce color images of moving three-dimensional objects. With OpenGL, you can control computer-graphics technology to produce realistic pictures or ones that depart from reality in imaginative ways. This guide explains how to program with the OpenGL graphics system to deliver the visual effect you want.

What This Guide Contains

This guide has 14 chapters. The first five chapters present basic information that you need to understand to be able to draw a properly colored and lit three-dimensional object on the screen.

Chapter 1, "Introduction to OpenGL," provides a glimpse into the kinds of things OpenGL can do. It also presents a simple OpenGL program and explains essential programming details you need to know for subsequent chapters.

Chapter 2, "State Management and Drawing Geometric Objects," explains how to create a three-dimensional geometric description of an object that is eventually drawn on the screen.

Chapter 3, "Viewing," describes how such three-dimensional models are transformed before being drawn on a two-dimensional screen. You can control these transformations to show a particular view of a model.

Chapter 4, "Color," describes how to specify the color and shading method used to draw an object.

Chapter 5, "Lighting," explains how to control the lighting conditions surrounding an object and how that object responds to light (that is, how it reflects or absorbs light). Lighting is an important topic, since objects usually don't look three-dimensional until they're lit. The remaining chapters explain how to optimize or add sophisticated features to your three-dimensional scene. You might choose not to take advantage of many of these features until you're more comfortable with OpenGL. Particularly advanced topics are noted in the text where they occur.

Chapter 6, "Blending, Antialiasing, Fog, and Polygon Offset," describes techniques essential to creating a realistic scene--alpha blending (to create transparent objects), antialiasing (to eliminate jagged edges), atmospheric effects (to simulate fog or smog), and polygon offset (to remove visual artifacts when highlighting the edges of filled polygons).

Chapter 7, "Display Lists," discusses how to store a series of OpenGL commands for execution at a later time. You'll want to use this feature to increase the performance of your OpenGL program.

Chapter 8, "Drawing Pixels, Bitmaps, Fonts, and Images," discusses how to work with sets of two-dimensional data as bitmaps or images. One typical use for bitmaps is describing characters in fonts.

Chapter 9, "Texture Mapping," explains how to map one- and two-dimensional images called textures onto three-dimensional objects. Many marvelous effects can be achieved through texture mapping.

Chapter 10, "The Framebuffer," describes all the possible buffers that can exist in an OpenGL implementation and how you can control them. You can use the buffers for such effects as hidden-surface elimination, stenciling, masking, motion blur, and depth-of-field focusing.

Chapter 11, "Tessellators and Quadrics," shows how to use the tessellation and quadrics routines in the GLU (OpenGL Utility Library).

Chapter 12, "Evaluators and NURBS," gives an introduction to advanced techniques for efficient generation of curves or surfaces.

Chapter 13, "Selection and Feedback," explains how you can use OpenGL's selection mechanism to select an object on the screen. Additionally, the chapter also explains the feedback mechanism, which allows you to collect the drawing information OpenGL produces rather than having it be used to draw on the screen.

Chapter 14, "Now That You Know," describes how to use OpenGL in several clever and unexpected ways to produce interesting results. These techniques are drawn from years of experience with both OpenGL and the technological precursor to OpenGL, the Silicon Graphics IRIS Graphics Library. In addition, there are several appendices that you will likely find useful.

Appendix A, "Order of Operations," gives a technical overview of the operations OpenGL performs, briefly describing them in the order in which they occur as an application executes.

Appendix B, "State Variables," lists the state variables that OpenGL maintains and describes how to obtain their values.

Appendix C, "OpenGL and Window Systems," briefly describes the routines available in window-system-specific libraries, which are extended to support OpenGL rendering. Window system interfaces to the X Window System, Apple MacIntosh, IBM OS/2, and Microsoft Windows NT and Windows 95 are discussed here.

Appendix D, "Basics of GLUT: The OpenGL Utility Toolkit," discusses the library that handles window system operations. GLUT is portable and it makes code examples shorter and more comprehensible.

Appendix E, "Calculating Normal Vectors," tells you how to calculate normal vectors for different types of geometric objects.

Appendix F, "Homogeneous Coordinates and Transformation Matrices," explains some of the mathematics behind matrix transformations.

Appendix G, "Programming Tips," lists some programming tips based on the intentions of the designers of OpenGL that you might find useful.

Appendix H, "OpenGL Invariance," describes when and where an OpenGL implementation must generate the exact pixel values described in the OpenGL specification.

Finally, an extensive Glossary defines the key terms used in this guide.

What's New in This Edition

The third edition of the OpenGL Programming Guide includes this new material:

  • Coverage of the following new core capabilities of OpenGL Version 1.2 have been added:
    -New vertex array functionality
    -Rescaling vertex normals
    -New pixel formats (packed pixels and BGRA)
    -Texturing enhancements, including 3D textures, texture coordinate edge clamping, new level of detail control, and support for specular highlights to be applied after texturing
  • Descriptions of the following new optional capabilities of OpenGL Version 1.2 have been added
    -The OpenGL imaging subset, which is a set of advanced image processing operations
    -Multitexturing
  • Documentation of new routines in Version 1.3 of GLU (OpenGL Utility Library)
  • Introduction to additional functionality in Version 1.3 of GLX (OpenGL Extension to the X Window System)
  • Bug fixes for the 2nd edition

What You Should Know Before Reading This Guide

This guide assumes only that you know how to program in the C language and that you have some background in mathematics (geometry, trigonometry, linear algebra, calculus, and differential geometry). Even if you have little or no experience with computer-graphics technology, you should be able to follow most of the discussions in this book. Of course, computer graphics is a huge subject, so you may want to enrich your learning experience with supplemental reading.

Computer Graphics: Principles and Practice by James D. Foley, Andries van Dam, Steven K. Feiner, and John F. Hughes (Reading, MA: Addison-Wesley, 1990)--This book is an encyclopedic treatment of the subject of computer graphics. It includes a wealth of information but is probably best read after you have some experience with the subject.

3D Computer Graphics: A User's Guide for Artists and Designers by Andrew S. Glassner (New York: Design Press, 1989)--This book is a nontechnical, gentle introduction to computer graphics. It focuses on the visual effects that can be achieved rather than on the techniques needed to achieve them.

Another great place for all sorts of general information is the Official OpenGL Web Site. This Web site contains software, documentation, FAQs, and news. It is always a good place to start any search for answers to your OpenGL questions: http://www.opengl.org

Once you begin programming with OpenGL, you might want to obtain the OpenGL Reference Manual by the OpenGL Architecture Review Board (Reading, MA: Addison-Wesley), which is designed as a companion volume to this guide. The Reference Manual provides a technical view of how OpenGL operates on data that describes a geometric object or an image to produce an image on the screen. It also contains full descriptions of each set of related OpenGL commands--the parameters used by the commands, the default values for those parameters, and what the commands accomplish. Many OpenGL implementations have this same material on-line, in the form of manual pages or other help documents, which are probably more up-to-date. There are also versions on the World Wide Web; consult the previously mentioned Official OpenGL Web Site.

OpenGL is really a hardware-independent specification of a programming interface, and you use a particular implementation of it on a particular kind of hardware. This guide explains how to program with any OpenGL implementation. However, since implementations may vary slightly--in performance and in providing additional, optional features, for example--you might want to investigate whether supplementary documentation is available for the particular implementation you're using. In addition, you might have OpenGL-related utilities, toolkits, programming and debugging support, widgets, sample programs, and demos available to you with your system.

How to Obtain the Sample Code

This guide contains many sample programs to illustrate the use of particular OpenGL programming techniques. These programs make use of Mark Kilgard's OpenGL Utility Toolkit (GLUT). GLUT is documented in OpenGL Programming for the X Window System by Mark Kilgard (Reading, MA: Addison-Wesley Developers Press, 1996). The section "OpenGL-Related Libraries" in Chapter 1 and Appendix D give more information about using GLUT. If you have access to the Internet, you can obtain the source code for both the sample programs and GLUT for free via anonymous ftp (file-transfer protocol).

For the source code examples found in this book, download the files from the ftp site:ftp://ftp.sgi.com/opengl/

Use the appropriate tools to uncompress and/or extract the source code from these archive files.

For Mark Kilgard's source code for GLUT (for Microsoft Windows 95/98/NT or the X Window System), check this Web page to find out what current version of GLUT is available and from where to download the source code:http://reality.sgi.com/opengl/glut3/glut3.html.

Many implementations of OpenGL might also include the code samples as part of the system. This source code is probably the best source for your implementation, because it might have been optimized for your system. Read your machine-specific OpenGL documentation to see where the code samples can be found.

Nate Robins' OpenGL Tutors

Nate Robins has written a suite of tutorial programs that demonstrate basic OpenGL programming concepts by allowing the user to modify the parameters of a function and interactively see their effects. Topics covered include transformations, lighting, fog, and texturing. These highly recommended tutorials are portable and require the aforementioned GLUT. To get the source code for these tutorials, see this Web site:http://www.cs.utah.edu/~narobins/opengl.html.

Errata

Undoubtedly this book has errors. An error list is maintained at the following Web site: http://www.woo.com/errata.html. If you find any bugs, you can use the pointer at this Web site to report them.

Style Conventions

These style conventions are used in this guide:

  • Bold--Command and routine names and matrices
  • Italics--Variables, arguments, parameter names, spatial dimensions, matrix components, and first occurrences of key terms
  • Regular--Enumerated types and defined constants
  • Code examples are set off from the text in a monospace font, and command summaries are shaded with gray boxes.

In a command summary, braces are used to identify choices among data types. In the following example, glCommand has four possible suffixes: s, i, f, and d, which stand for the data types GLshort, GLint, GLfloat, and GLdouble. In the function prototype for glCommand, TYPE is a wildcard that represents the data type indicated by the suffix:

void glCommand{sifd}(TYPE x1, TYPE y1, TYPE x2, TYPE y2);



0201604582P04092002

Updates

Errata

OpenGL Programming Guide Errata

OpenGL Programming Guide (3rd Edition) Errata

This is a listing of the errors found in the Third Edition of the OpenGL Programming Guide (Woo, Neider, Davis, Shreiner: ISBN 0-201-60458-2, published in 1999) and its source code examples.

NOTE:  Silicon Graphics has moved the location of the source code examples.  They are no longer on sgigate.sgi.com.  Instead, the source code files have been moved to ftp://ftp.sgi.com/opengl

This is a link to the list of bugs in the Second Edition (Woo, Neider, Davis: ISBN 0-201-46138-2, published in 1997).

There is no comprehensive list of bugs in the First Edition, published in 1992.

If you have either the Second or First Edition and find problems, please check to see if the problems are repeated in the Third Edition before reporting them. If you find unreported bugs in the Third Edition, please submit them by e-mail.


Code Errors

stencil.c:  add glFlush() at the end of display() (Reported by Alan Hanson)

 

Text Errors

page 24, Figure 1-3 shows five pictures of squares, rotating clockwise.  To match code example 1-3, they should be rotating counter-clockwise. (Reported by Roman Baeriswyl)

page 25, double.c:  The downloaded version of double.c works fine, but the book doesn't match it. The switch statement in the mouse function should have three cases: GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON, and GLUT_RIGHT_BUTTON. The example on page 25 misses the  GLUT_RIGHT_BUTTON case.

page 36, Example 2-1 typo:  remove "Special characters" from first line of code.  (Reported by Jichun Zhu)

page 36, 2nd paragraph, 1st sentence: remove the word "to" from "The internals of GLUT will pass this to function two arguments..." (Reported by Scott Dahl)

page 54/55: at the beginning of the display() function, add glLineWidth(1.0f) so that redraw will restore the line width. To get code example 2-5 to match figure 2-9, add glLineWidth(1.0) to the very last code on page 55. (Reported by Kevin Foad)

page 63: in the sentence above Figure 2-12, it says: "In Figure 2-12, the dashed lines represent added edges." However, there are no dashed lines in Figure 2-12.  The new image we replaced in the 3rd edition lacks the dotted lines that should be in the interior of the polygon.  (Reported by several people)

page 89, Figure 2-17: The model on the left isn´t an icosahedron, because it has too much faces. Only ten faces should be seen, and only five triangles should be connected to each vertex. (Reported by Christian Vetter)

page 114, Figure 3-8: The triangle in the figure is not centered at the origin, but in the source code of the programming example, the triangle's center is almost at the origin.  This strongly affects the rotation example, causing a mismatch between the figure and the code.  Also, the amount of rotation in the code and diagram do not match.  The orientation of the original and the rotated triangle in the figure just look like the ones that are being shown by the compiled program. To get the results the figure shows, the triangle must be rotated about 30 degrees clockwise about a ray parallel to the z-axis and that goes through the lower right vertex of the triangle. But in the program and also in the code given in the book the triangle is rotated +90 degrees, if the same projection like in the figure is chosen, counterclockwise. (Reported by Manuel Hewitt and David Holland)

page 119, 3rd line from the bottom, typo: the line of code should be gluLookAt(...) instead of gluLookat(...). (Reported by Mike Soukup) page 183: In the 1st paragraph in the section entitled 'Select a Lighting Model,' the second sentence is: "In Example 5-1, the only element of the lighting model that's defined explicitly is the global ambient light." However, the global ambient light is not defined at all in Example 5-1.  (Reported by Jan Vlug) page 196: In Example 5-7, the first line in the display callback reads:

        glClear( GL_COLOR_BUFFER_MASK | GL_DEPTH_BUFFER_MASK );

"MASK" should be "BIT"; that is:

        glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

(Reported by Michael Anderson)

page 210, the last sentence reads, "Remove all the glMaterialfv() calls, and use the more efficient glColorMaterial() calls to achieve the same lightning."  It should read, "Remove most of the glMaterialfv() calls...", because it is not possible to change GL_SHININESS with glColorMaterial(). (Reported by Roman Baeriswyl)

page 220:  The sentence that starts "None of these techniques is hard to use-- in fact..." is wrong. It should say "are" instead of "is"  (Reported by John Alway) chapter 7; pages 257, 264, and 274: code examples 7-1, 7-2, and 7-5, should not include the header files <GL/gl.h> and <GL/glu.h>. At best, inclusion of these files is redundant, because <GL/glut.h> also includes them.  On MS Windows, <windows.h> must be included before either gl.h or glu.h, to ensure the proper definition of internal macros. See pages 15 and 16 for more detail about the proper inclusion of header files.

page 270: In Example 7-3, each call to glVertex3f should be changed to call glVertex3fv (Reported by Jose Antonio Robles)

page 309:  The second illustration from top, in the box, reads: "Short (byte 0) | Short (byte 1) ---> Short (byte 0) | Short (byte 0)"
It should read: "Short (byte 0) | Short (byte 1) ---> Short (byte 1) | Short (byte 0)"  (Reported by John Alway) page 332: In Figure 8-15: the formula for calulating P'(i,j) has a typo. In the formula, P(m+1, n+j) should have been P(m+i, n+j). (Reported by Sung Kang) page 338: The next to last paragraph reads:  "The convolutions of pixels at the left and top edges of an image..."  It should read, "The convolution of pixels at the edges of an image..." because the left and top edges are not handled differently to the right and bottom edges. (Reported by Dave Baldwin)

page 339: The 3rd paragraph reads: "GL_REPLICATE_BORDER computes the convolution in the same way as in GL_CONSTANT_BORDER mode, except that the last row of column of pixels is used for the pixels that lie outside..."
It should read, "GL_REPLICATE_BORDER computes the convolution in the same way as in GL_CONSTANT_BORDER mode, except for the treatment of pixel locations where the convolution filter extends beyond the edge of the source image. For these locations, it is as if the outermost one-pixel border of the source image was replicated." (Reported by Dave Baldwin)

page 421: section entitled "The q-Coordinate"
Should read "See Plate 28 for an example..." not "See Plate 27 for an example..."

page 452: In the 2nd full paragraph, it should read "using 1.0/16.0, 2.0/16.0,..." instead of "using 16.0/1.0, 16.0/2.0,..."  (Reported by David Bourguignon)

page 453: Example 10-2 is not directly in the file accpersp.c.  It belongs to the jitter.h file, which is included in accpersp.c (Reported by David Bourguignon)

page 461, in dof.c there is a missing declaration:

GLuint teapotList;
(Reported by David Bourguignon)

page 486: the general quadratic equation has the term a5yx.  It should be a5yz. (Reported by Tsai Pi Hsi and Gerry Murphy)

page 529: In Example 12.8 (trim.c):
GLfloat pwlPt [4] [2] = {{0.75, 0.5}, {0.5, 0.25}, {0.25, 0.5}};
should be
GLfloat pwlPt [3] [2] = {{0.75, 0.5}, {0.5, 0.25}, {0.25, 0.5}};
(Reported by David Brayford) page 658: the function
void glutKeyboardFunc( void (*func)( unsigned int key, int x, int y ));
should be
void glutKeyboardFunc( void (*func)( unsigned char key, int x, int y ));
(Reported by Goetz Martinek)
  page 665: the resulting cross product (near the bottom of the page)
   dV/dS x dV/dt = [-3t^3   2s^2   6st^2]
                   should be
   dV/dS x dV/dt = [3t^2   2s^2   6st^2]
(Reported by Paul Pedriana) page 674: the orthographic projection matrix R is wrong. Each element in the far right column (matrix elements with index number 12 through 15) of the matrix R should have a minus sign in front of them. (Reported by Sung Kang)

Color Plate 28:  Credits should say "Image courtesy of Stefan Brabec and Wolfgang Heidrich, Max-Planck-Institute for Computer Science, Saarbrücken, Germany."

Color Plate 30 typo:  "virtual" is misspelled.  (Reported by Stephane Raimbault)

To the www.opengl.org web page
This page is maintained by Dave Shreiner.

Last Modified:  September 1, 2002

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020