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 grasp of the material themselves. Some urge the student to implement some of the new ideas in program code. In addition, "case studies" appear at the end of each chapter, amounting to 100 in all. These exercises are normally programming projects suitable for homework assignments and range from the simple to the challenging. They expand on the material within their chapter and often extend ideas in new directions. Whether or not the case studies are actually carried out by students, they should be studied as an integral part of the chapter. A suggested "level of effort" is associated with each case study, to indicate the approximate investment in time a student may need to accomplish the task. Programming is an unpredictable business and students' abilities vary, but the rough guide is as follows: Level of Effort A simple project that can be implemented in an evening, suitable to be made due at the next class meeting. A more extensive project that might be assigned to be due in a week, so that a student has time to think about designing the program and has adequate time for the iterative (and sometimes frustrating) testing and debugging cycle that projects always seem to require. A major project that might require three weeks to design and implement. Such a project requires substantial design effort and careful program layout, but would (correctly) be viewed as a major accomplishment by the student. Use of OpenGL A frequent stumbling block that appears as one first brushes up against computer graphics is getting started making pictures. It is easy enough to write a program, but there must be an underlying tool that ultimately draws the lines and curves on the screen. Fortunately, such a tool exists and is readily available. OpenGL emerged from Silicon Graphics, Inc., in 1992 and has become a widely adopted graphics application programming interface (API). It provides the actual drawing tools through a collection of functions that are called within an application. As described in Appendix 1, it is available (usually through free downloads over the Internet) for all types of computer systems encountered in colleges, universities, and industry. OpenGL is easy to install and learn, and its longevity as a standard API is being nurtured by the OpenGL Architecture Review Board (ARB), an industry consortium responsible for guiding the evolution of the software. One aspect of OpenGL that makes it so well suited for use in a computer graphics course is its "device independence," or portability. Many university computer laboratories contain a variety of different computers. A student can develop and run a program on any available computer. The program can then be run on a different computer, for testing or grading purposes perhaps, and the graphics will be the same on the two machines. OpenGL offers a rich and highly usable API for 2D graphics and image manipulation, but its real power emerges with 3D graphics. Using OpenGL, students can progress rapidly and produce stunning animations in only a single-semester course. Use of C++ as the Programming Language C++ is now familiar enough to most students in engineering and computer science through a first programming course, that it is the natural choice of language to use. It offers several advantages over C, such as passing parameters to functions by reference, which reduces the need for explicit pointers and simplifies reading the code. File 1/O also is greatly simplified through streams, and in general, the syntax for all kinds of I/O is clearer in C++ than in C. To keep things simple, in C++ no emphasis is placed on implementing operators. Furthermore, it is easy to develop handy utility classes in C++, such as those for a 2D or 3D point, a line, a window, or a color, which make code simpler and more robust. Students see the benefit of hiding the details of a geometric object within the object itself and of imbuing the object with the ability to do things like draw itself or test whether it intersects another object. The Canvas class developed in Chapter 3 offers a good example, as it maintains its own notion of a window, a viewport, and a current position, and it can draw basic figures with very little programming effort. Emphasis on 3D Computer Graphics Because playing games on personal computers has become so popular, and so many dazzling animations are appearing in movies, students are particularly interested in developing 3D graphics applications. Accordingly, several chapters from the first edition have been rewritten and rearranged in order to get to topics in 3D graphics as quickly as possible. In a number of situations, concepts are presented for the 2D case and the 3D case together, which helps to clarify the distinctions between the two. Describing 3D Scenes with the use of Scene Design Language It can be very awkward and time consuming to design a scene of many 3D objects using "raw" OpenGL commands. So a simple Scene Design language (SDL) is introduced in Chapter 5 (and fully defined in an appendix). Using this language, students can describe scenes with familiar terms like "cube," "sphere," and "rotate" and can build files of such instructions that can be read into their program at run time. An appendix (and the book's Web Site) provides code for an interpreter that can read an SDL file and build a list of objects described in ...
發表於2024-12-26
Computer Graphics Using Open GL (2nd Edition) 2024 pdf epub mobi 電子書 下載
圖書標籤:
Computer Graphics Using Open GL (2nd Edition) 2024 pdf epub mobi 電子書 下載