OpenGL Programming Guide

Plate 1. The scene from the cover of this book, with the objects rendered as wireframe models. Plate 2. The same scene using fog for depth-cueing (lines further from the eye are dimmer). Plate 3. The same scene with antialiased lines that smooth the jagged edges. Plate 4. The scene drawn with flat-shaded polygons (a […]

Plates (OpenGL Programming) Part 2

Plate 14. Gray teapots drawn with different lighting conditions, (a) Each of the three teapots is drawn with increasing ambient light, (b) The teapots are clipped to expose their interiors. The top teapot uses one-sided lighting, the middle one uses two-sided lighting with the same material for both front and back faces, and the bottom […]

Plates (OpenGL Programming) Part 3

Plate 25. An image representing a manufacturing prototype. Environment mapping is used to enhance the illumination in the scene. Plate 26. Scientific visualization of the interplanetary probe, Cassini, after its initial rendezvous with Venus. Plate 27. Medical visualization based on slices from a magnetic resonance imaging scan. The image is composed of surfaces generated from […]

What Is OpenGL?

OpenGL is a software interface to graphics hardware. This interface consists of about 250 distinct commands (about 200 in the core OpenGL and another 50 in the OpenGL Utility Library) that you use to specify the objects and operations needed to produce interactive three-dimensional applications. OpenGL is designed as a streamlined, hardware-independent interface to be […]

A Smidgen of OpenGL Code

Because you can do so many things with the OpenGL graphics system, an OpenGL program can be complicated. However, the basic structure of a useful program can be simple: its tasks are to initialize certain states that control how OpenGL renders and to specify objects to be rendered. Before you look at some OpenGL code, […]

OpenGL Command Syntax

As you might have observed from the simple program in the preceding section, OpenGL commands use the prefix gl and initial capital letters for each word making up the command name (recall glClearColor(), for example). Similarly, OpenGL defined constants begin with GL_, use all capital letters, and use underscores to separate words (for example, GL_COLOR_BUFFER_BIT). […]

OpenGL as a State Machine

OpenGL is a state machine. You put it into various states (or modes) that then remain in effect until you change them. As you’ve already seen, the current color is a state variable. You can set the current color to white, red, or any other color, and thereafter every object is drawn with that color […]

OpenGL Rendering Pipeline

Most implementations of OpenGL have a similar order of operations, a series of processing stages called the OpenGL rendering pipeline. This ordering, as shown in Figure 1-2, is not a strict rule about how OpenGL is implemented, but it provides a reliable guide for predicting what OpenGL will do. If you are new to three-dimensional […]

OpenGL-Related Libraries

OpenGL provides a powerful but primitive set of rendering commands, and all higher-level drawing must be done in terms of these commands. Also, OpenGL programs have to use the underlying mechanisms of the windowing system. Several libraries enable you to simplify your programming tasks, including the following: •  The OpenGL Utility Library (GLU) contains several […]

Animation (Introduction to OpenGL)

One of the most exciting things you can do on a graphics computer is draw pictures that move. Whether you’re an engineer trying to see all sides of a mechanical part you’re designing, a pilot learning to fly an airplane using a simulation, or merely a computer-game aficionado, it’s clear that animation is an important […]