Combines the principles and major techniques in computer graphics with state-of-the-art examples that relate to things students and professionals see every day on the Internet and in computer-generated movies. DLC: Computer graphics. Preface This book provides an introduction to computer graphics for students who wish to learn the basic principles and techniques of the field and who, in addition, want to write substantial graphics applications themselves. The field of computer graphics continues to enjoy tremendous vitality and growth. The ever-increasing number of feature-length animated movies has generated heady excitement about what graphics can do, and the ready access to graphics everyone now has through computer games and the Internet is stimulating people to learn how to do it themselves. Graphics systems are getting better, faster, and cheaper at a bewildering rate, and many new techniques are emerging each year from researchers and practitioners around the world, but the underlying principles and approaches constitute a stable and coherent body of knowledge. Much of this knowledge can be acquired through a single course in graphics, and this book attempts to organize the ideas and methods to bring the reader from the beginning, with modest programming skills, to being able to design and produce significant graphics programs. INTENDED AUDIENCE The book is designed as a text for either a one- or two-semester course at the senior undergraduate or first-year graduate level. It can also be used for self-study. It is aimed principally at students majoring in computer science or engineering, but will also suit students in other fields, such as physics and mathematics. Mathematical Background Required The reader should have the equivalent of one year of college mathematics; knowledge of elementary algebra, geometry, trigonometry, and elementary calculus also is assumed. Some exposure to vectors and matrices is useful, but not essential, as vector and matrix techniques are introduced in the context of graphics as they are needed, and an appendix also summarizes the key ideas. Computer graphics tends to use a lot of mathematics to express the geometric relationships between lines, surfaces, and the viewing eye. Although no single mathematical notion is difficult in itself, the sheer number of tools required can be daunting. The book places particular emphasis on revealing the reasons for using this or that technique and on showing how the objects of interest in a graphics program are properly described by the mathematical objects we use. Computer Programming Background Required In general, the reader should have at least one semester of experience writing computer programs in C, C++, or Java. A lot of the programming in graphics involves the direct translation of geometric relationships into code and so uses straightforward variables, functions, arrays, looping, and testing, which is similar from language to language. C++ is used throughout the book, but much of the material will be familiar to someone whose computer language background is only C. It is helpful for the reader to have experience as well in manipulating struct's in C or classes in C++. These are used to capture the rather complicated structure of some graphical objects that reside in a scene, where the object (say, a castle or an airplane) consists of many parts and these parts themselves consist of complex subparts. Some experience with elementary linked data structures such as linked lists or trees is also desirable, but not essential. A reader with knowledge of C but not C++ will need to pick up the basics of object-oriented programming. We define a number of useful classes (such as the Window, Mesh, Scene, Camera, and Texture classes) and show why they are so convenient and usable. Some of the hallmarks of object-oriented programming, such as inheritance and polymorphism, are used in a few contexts to make the programmer's job easier, but we do not place inordinate emphasis on a pure object-oriented approach. PHILOSOPHY The book has been completely reorganized and rewritten from the first edition, but the basic philosophy remains: Computer graphics is learned by doing it: One must write and test real programs to comprehend fully what is going on. A principal goal of the book is to show readers how to translate a particular design "task" first into its underlying geometric components, to find a suitable mathematical representation for the objects involved, and finally to translate this representation into suitable algorithms and program code. Readers start by learning how to develop simple routines to produce pictures. Then methods for rendering drawings of ever more complex objects are presented in a step-by-step fashion. Exercises and Problems More than 440 drill exercises appear throughout the book. Most of these are of the "stop-and-think" variety that require no programming and that allow readers to test their gr