Textbook
Computer Graphics for Java Programmers, 2nd EditionFebruary 2007, ©2007

In a logical progression of ideas, the reader is introduced to some of the classic graphics algorithms and finally to chapters which cover particular effects such as perspective drawings and hiddenface and hiddenline elimination.
The book also provides a host of readytorun programs and worked examples to illuminate general principles and geometric techniques for the creation of both 2D and 3D graphical objects.
Preface ix
C H A P T E R 1 – Elementary Concepts 1
1.1 Lines, Coordinates and Pixels 2
1.2 The Boundaries of Filled Regions 7
1.3 Logical Coordinates 8
1.4 Anisotropic and Isotropic Mapping Modes 14
1.5 Defining a Polygon by Using the Mouse 21
Exercises 26
C H A P T E R 2 – Applied Geometry 31
2.1 Vectors 32
2.2 Inner Product 34
2.3 Determinants 34
2.4 Vector Product 37
2.5 The Orientation of Three Points 38
2.6 Polygons 41
2.7 The Area of a Polygon 42
2.8 PointinTriangle Test 44
2.9 PointinPolygon Test 45
2.10 PointonLine Test 47
2.11 Distance Between a Point and a Line 50
2.12 Projection of a Point on a Line 51
2.13 Triangulation of Polygons 53
Exercises 58
C H A P T E R 3 – Geometrical Transformations 63
3.1 Matrix Multiplication 64
3.2 Linear Transformations 65
3.3 Translations 71
3.4 Homogeneous Coordinates 71
3.5 Inverse Transformations and Matrix Inversion 72
3.6 Rotation About an Arbitrary Point 74
3.7 Changing the Coordinate System 78
3.8 Rotations About 3D Coordinate Axes 79
3.9 Rotation About an Arbitrary Axis 80
Exercises 88
C H A P T E R 4 – Some Classic Algorithms 91
4.1 Bresenham’s Algorithm for Line Drawing 92
4.2 Doubling the LineDrawing Speed 97
4.3 Circles 102
4.4 Cohen–Sutherland Line Clipping 107
4.5 Sutherland–Hodgman Polygon Clipping 113
4.6 B´ezier Curves 120
4.7 BSpline Curve Fitting 130
Exercises 135
C H A P T E R 5 – Perspective 139
5.1 Introduction 140
5.2 The Viewing Transformation 141
5.3 The Perspective Transformation 146
5.4 A Cube in Perspective 148
5.5 Some Useful Classes 152
5.6 A General Program for WireFrame Models 168
Exercises 174
C H A P T E R 6 – HiddenLine Elimination 177
6.1 Line Segments and Triangles 178
6.2 Tests for Visibility 179
6.3 Specification and Representation of 3D Objects 190
6.4 Holes and Invisible Line Segments 192
6.5 Individual Faces and Line Segments 194
6.6 Automatic Generation of Object Specification 198
6.7 HiddenLine Elimination with HPGL Output 207
6.8 Implementation 209
Exercises 213
C H A P T E R 7 – HiddenFace Elimination 219
7.1 BackFace Culling 220
7.2 Coloring Individual Faces 225
7.3 Painter’s Algorithm 226
7.4 ZBuffer Algorithm 234
Exercises 246
C H A P T E R 8 – Fractals 249
8.1 Introduction 249
8.2 Koch Curves 250
8.3 String Grammars 253
8.4 Mandelbrot and Julia Sets 264
Exercises 276
A P P E N D I X A – Linear Interpolation of 1/z 277
AP P ENDIX B – A Note on Event Handling 281
A P P E N D I X C – File Obj3D.java 287
A P P E N D I X D – Class CvHLines.java 293
A P P E N D I X E – Some Applications 301
E.1 Platonic Solids 301
E.2 Sphere Representations 312
E.3 A Torus 319
E.4 Beams in a Spiral 323
E.5 Functions of Two Variables 326
A P P E N D I X F – Hints and Solutions to Exercises 339
Bibliography 371
Index 373
Kang Zhang is a Professor in Computer Science and Director of Visual Computing Lab at the University of Texas at Dallas. He received his B.Eng. in Computer Engineering from the University of Electronic Science and Technology, China, in 1982; and Ph.D. from the University of Brighton, UK, in 1990. He held academic positions in the UK and Australia, prior to joining UTD. Zhang's current research interests are in the areas of visual languages, graphical visualization, and Web engineering; and has published over 130 papers in these areas. He has taught computer graphics and related subjects at both graduate and undergraduate levels for many years. Zhang was also an editor of two books on software visualization.
 More illustrative examples have been added throughout the book.
 Chapter contents have been updated to reflect the authors' own teaching experience  so the book is optimised for use in the classroom.
 An accompanying instructor’s manual is now available.
 A new chapter on “Fractals and SelfSimilarity” has been added.
 A companion software package demonstrating the working of different algorithms and concepts has been added.
 Fundamental and mathematical concepts clearly explained and then implemented, to give students a full understanding of what they are learning.
 A nutsandbolts guide to computer graphics with utility and algorithmic code provided.
 Incremental approach to handson practice on graphics programming, building students' confidence.
 Animated demonstration of many challenging concepts and graphics algorithms, keeping the more difficult material fresh and interesting.
 Wiley ETexts are powered by VitalSource technologies ebook software.
 With Wiley ETexts you can access your ebook how and where you want to study: Online, Download and Mobile.
 Wiley etexts are nonreturnable and nonrefundable.
 WileyPLUS registration codes are NOT included with the Wiley EText. For informationon WileyPLUS, click here .
 To learn more about Wiley etexts, please refer to our FAQ.
 Ebooks are offered as ePubs or PDFs. To download and read them, users must install Adobe Digital Editions (ADE) on their PC.
 Ebooks have DRM protection on them, which means only the person who purchases and downloads the ebook can access it.
 Ebooks are nonreturnable and nonrefundable.
 To learn more about our ebooks, please refer to our FAQ.