Advanced Graphics
Programming
Using OpenGL
TOM McREYNOLDS
DAVID BLYTHE
AMSTERDAM • BOSTON • HEIDELBERG • LONDON
NEW YORK • OXFORD • PARIS • SAN DIEGO
SAN FRANCISCO • SINGAPORE • SYDNEY • TOKYO
MORGAN KAUFMANN PUBLISHERS IS AN IMPRINT OF ELSEVIER
TEAM LinG
Advanced Graphics Programming Using OpenGL
TEAM LinG
The Morgan Kaufmann Series in Computer Graphics and Geometric Modeling
Series Editor: Brian A. Barsky University of California, Berkeley
This series publishes the finest works for the accomplished and aspiring graphics professional. The series includes intermediate
and advanced textbooks, graphics programming books, surveys of important new areas and methods, and reference works.
Advanced Graphics Programming Using OpenGL
Tom McReynolds and David Blythe
Digital Geometry Geometric Methods for Digital
Picture Analysis
Rienhard Klette and Azriel Rosenfeld
Digital Video and HDTV Algorithms and Interfaces
Charles Poynton
Real-Time Shader Programming
Ron Fosner
Complete Maya Programming:
An Extensive Guide to MEL and the C++ API
David Gould
MEL Scripting for Maya Animators
Mark R. Wilkins and Chris Kazmier
Digital Video and HDTV Algorithms and Interfaces
Charles Poynton
Texturing & Modeling:
A Procedural Approach, Third Edition
David S. Ebert, F. Kenton Musgrave, Darwyn Peachey,
Ken Perlin, and Steven Worley
Geometric Tools for Computer Graphics
Philip Schneider and David Eberly
Understanding Virtual Reality:
Interface, Application, and Design
William Sherman and Alan Craig
Jim Blinn’s Corner: Notation, Notation, Notation
Jim Blinn
Level of Detail for 3D Graphics:
David Luebke, Martin Reddy, Jonathan D. Cohen,
Amitabh Varshney, Benjamin Watson, and
Robert Huebner
Pyramid Algorithms: A Dynamic Programming
Approach to Curves and Surfaces for Geometric
Modeling
Ron Goldman
Non-Photorealistic Computer Graphics:
Modeling, Rendering, and Animation
Thomas Strothotte and Stefan Schlechtweg
Curves and Surfaces for CAGD: A Practical Guide,
Fifth Edition
Gerald Farin
Subdivision Methods for Geometric Design:
A Constructive Approach
Joe Warren and Henrik Weimer
Computer Animation: Algorithms and Techniques
Rick Parent
The Computer Animator’s Technical Handbook
Lynn Pocock and Judson Rosebush
Advanced RenderMan:
Creating CGI for Motion Pictures
Anthony A. Apodaca and Larry Gritz
Curves and Surfaces in Geometric Modeling:
Theory and Algorithms
Jean Gallier
Andrew Glassner’s Notebook:
Recreational Computer Graphics
Andrew S. Glassner
Warping and Morphing of Graphical Objects
Jonas Gomes, Lucia Darsa, Bruno Costa, and Luiz Velho
Jim Blinn’s Corner: Dirty Pixels
Jim Blinn
Rendering with Radiance:
The Art and Science of Lighting Visualization
Greg Ward Larson and Rob Shakespeare
Introduction to Implicit Surfaces
Edited by Jules Bloomenthal
Jim Blinn’s Corner:
A Trip Down the Graphics Pipeline
Jim Blinn
Interactive Curves and Surfaces:
A Multimedia Tutorial on CAGD
Alyn Rockwood and Peter Chambers
Wavelets for Computer Graphics:
Theory and Applications
Eric J. Stollnitz, Tony D. DeRose, and David H. Salesin
Principles of Digital Image Synthesis
Andrew S. Glassner
Radiosity & Global Illumination
François X. Sillion and Claude Puech
Knotty: A B-Spline Visualization Program
Jonathan Yen
User Interface Management Systems:
Models and Algorithms
Dan R. Olsen, Jr.
Making Them Move: Mechanics, Control, and Animation
of Articulated Figures
Edited by Norman I. Badler, Brian A. Barsky, and
David Zeltzer
Geometric and Solid Modeling: An Introduction
Christoph M. Hoffmann
An Introduction to Splines for Use in Computer Graphics
and Geometric Modeling
Richard H. Bartels, John C. Beatty, and Brian A. Barsky
TEAM LinG
Publishing Director: Diane Cerra
Publishing Services Manager: Simon Crump
Project Manager: Brandy Lilly
Editorial Coordinator: Mona Buehler
Cover Design: Dutton & Sherman Design
Text Design: Julio Esperas
Composition: Cepha Imaging Pvt. Ltd.
Illustrations: Dartmouth Publishing, Inc.
Copyeditor: Daril Bentley; Graphic World
Proofreader: Graphic World
Indexer: Graphic World
Interior printer: China Translation & Printing Services, Ltd.
Cover printer: China Tranalation & Printing Services, Ltd.
Morgan Kaufmann Publishers is an imprint of Elsevier.
500 Sansome Street, Suite 400, San Francisco, CA 94111
This book is printed on acid-free paper.
© 2005 by Elsevier Inc. All rights reserved.
Designations used by companies to distinguish their products are often claimed as trademarks or
registered trademarks. In all instances in which Morgan Kaufmann Publishers is aware of a claim,
the product names appear in initial capital or all capital letters. Readers, however, should contact
the appropriate companies for more complete information regarding trademarks and registration.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form
or by any means—electronic, mechanical, photocopying, scanning, or otherwise—without prior written
permission of the publisher.
Permissions may be sought directly from Elsevier’s Science & Technology Rights Department in Oxford,
UK: phone: (+44) 1865 843830, fax: (+44) 1865 853333, e-mail: permissions@elsevier.com.uk. You
may also complete your request on-line via the Elsevier homepage (http://elsevier.com) by selecting
“Customer Support” and then “Obtaining Permissions.”
Library of Congress Cataloging-in-Publication Data
Application Submitted
ISBN: 1-55860-659-9
For information on all Morgan Kaufmann publications,
visit our Web site at www.mkp.com or www.books.elsevier.com
Printed in China
10987654321
TEAM LinG
To my friends and colleagues from Silicon Graphics; it was a fabulous time and place to
learn about 3D graphics. – DB
To Ede Forney and Harry McGinnis; you were there when it counted. – TM
TEAM LinG