Principles of Computer Graphics: Teo/y
Principles of Computer Graphics: Teo/y
Principles of Computer Graphics: Teo/y
Shalini Govil-Pai
Sunnyvale, CA, U.S.A.
a- Springer
Shalini Govil-Pai
896 Savory Drive,
Sunnyvale, CA 94087
Govil-Pai, Shalini
Principles of Computer Graphics: Theory and Practice Using OpenGL and Maya@/ Shalini
Govil-Pai
p.cm.
Includes bibliographical references and index.
Alias and Maya are registered trademarks of Alias Systems Corp. in the United States
andlor other countries.
springeronline.com
Contents
Preface vii
Section 1 1
1 From Pixels to Shapes 3
1.1 Complex Display Systems 4
1.2 Game Buffers 6
1.3 Coordinate Systems: How to identify pixel points 9
1.4 Shapes and Scan Converting 11
Section 2 81
5 3D Modeling 83
5.1 The 3D System 84
5.2 3D Modeling 90
5.3 3D Modeling Primitive Shapes 95
5.4 3D Modeling Generic Shapes 100
5.5 3D Transformation 104
5.6 Viewing in 3D 107
5.7 Hierarchical Modeling Using Transformations 118
vi
XV~ CONTENTS
7 Advanced Techniques
7.1 Advanced Modeling
7.2 Advanced Rendering Techniques
Section 3
9 Animation
9.1 Traditional Animations
9.2 3D Computer Animation - Interpolations
9.3 The Principles of Animation
9.4 Advanced Animation Techniques
10 Viewpoint Animation
10.1 Animating the Camera inthe Snowy Animation
10.2 Building up a Real Time 3D Game
Appendix A
Appendix B
Appendix C
Bibliography
Index of Terms
Preface
Computer Graphics: the term has become so widespread now, that we rarely stop
to think about what it means. What is Computer Graphics? Simply defined,
Computer Graphics (or CG) is the images generated or modified on a computer.
These images may be visualizations of real data or imaginary depictions of a
fantasy world.
The use of Computer Graphics effects in movies such as The Incredibles and
games such as Myst have dazzled millions of viewers worldwide. The success of
such endeavors is prompting more and more people to use the medium of
Computer Graphics to entertain, to educate, and to explore.
For doctors, CG provides a noninvasive way to probe the human body and to
research and discover new medications. For teachers, CG is an excellent tool to
visually depict concepts to their students. For business people, CG has come to
signify images of charts and graphs used for analysis of data. But for most of us,
CG translates into exciting video games, special effects and entire films-what are
often referred to as CG productions. This entertainment aspect of CG is what has
made it such a glamorous and sought-after field.
Ten years ago, CG was limited to high-end workstations, available only to an
elite few. Now, with the advances in PC processing power and the availability of
3D graphics cards, even high school students can work on their home PC to
create professional quality productions
The goal of this book is to expose you to the fundamental principles behind
modern computer graphics. We present these principles in a fun and simple
manner. We firmly believe that you don't have to be a math whiz or a high tech
computer programmer to understand CG. A basic knowledge of trigonometry,
algebra, and computer programming is more than sufficient.
As you read this book, you will learn the bits and bytes of how to transform
your ideas into stunning visual imagery. We will walk you through the processes
that professionals employ to create their productions, Based on the principles
that we discuss, you will follow these processes step and step, to design and
create your own games and animated movies.
We will introduce you to the OpenGL API—a graphics library that has
become the de facto standard on all desktops. We will also introduce you to the
workings of Maya, a 3D software package. We will demonstrate the workings of
the Maya Personal Learning Edition—a (free) download is required.
viii PREFACE
Appendices
In Appendix A, you will find detailed instructions on how to install the OpenGL
and GLUT libraries. Appendix B describes how to download, install the sample
code that is detailed in this book. You will also find details on how to compile
PREFACE ix
and link your code using the OpenGL libraries. Appendix C describes the Maya
PLE and how to download it.
The system requirements for running the examples in this book, as well as for
running Maya PLE are as follows:
Software Requirements
• Windows 2000 or higher
•C/C++ compiler such as Microsoft Visual Studio on Windows or GCC
(Gnu Compiler Collection) on Unix
x PREFACE
Hardware Requirements
• Intel Pentium II or higher/AMD Athlon processor
• 512 MB RAM
• Hardware-accelerated graphics card (comes standard on most systems)
Intended Audience
This book is aimed at undergraduate students who wish to gain an overview of
Computer Graphics. The book can be used as a text or as a course supplement
for a basic Computer Graphics course.
The book can also serve as an introductory book for hobbyists who would
like to know more about the exciting field of Computer Graphics, and to help
them decide if they would like to pursue a career in it.
Acknowledgments
The support needed to write and produce a book like this is immense. I would
like to acknowledge several people who have helped turn this idea into a reality,
and supported me through the making of it:
First, my husband, Rajesh Pai, who supported me through thick and thin. You
have been simply awesome and I couldn't have done it without your constant
encouragement.
A big thanks to my parents, Anuradha and Girjesh Govil, who taught me to
believe in myself, and constantly egged me on to publish the book.
Thanks to Carmela Bourassa of Alias software, who helped provide
everything I needed to make Maya come alive.
A very special thanks to my editor, Wayne Wheeler, who bore with me
through the making of this book and to the entire Springer staff who helped to
produce this book in its final form.
I would like to dedicate this book to my kids, Sonal and Ronak Pai, who
constantly remind me that there is more to life than CG.
PREFACE xi
CG technology is emerging and changing every day. For example, these days,
sub-division surfaces, radiosity, and vertex shaders are in vogue. We cannot
hope to cover every technology in this book. The aim of the book is to empower
you with the basics of CG-providing the stepping-stone to pick up on any CG
concept that comes your way.
A key tenet of this book is that computer graphics is fun. Learning about it
should be fun too. In the past 30 years, CG has become pervasive in every aspect
of our lives. The time to get acquainted with it is now—so read on!