The file [Link] contains the source code listed in: Ammeraal, L.
(1998) Computer Graphics for Java Programmers. Chichester: John Wiley. In view of long filenames, use winzip (not pkunzip) to unzip this file. After expanding the file [Link], you will obtain a large number of .java files, which are not all complete programs. You can compile and run the following programs; they are all applications, not applets, and they may require other files, which are in the same directory: Chapter 1 Elementary [Link] [Link] [Link] [Link] [Link] [Link] Concepts: The largest possible rectangle in red 50 triangles inside each other The anisotropic mapping mode The isotropic mapping mode Drawing a polygon interactively A chessboard of square patterns (Exercise 1.2)
Chapter 2 Applied Geometry [Link] Drawing a polygon interactively and triangulation Chapter 3 Rotations [Link] [Link] [Link] and Other Transformations Arrow rotated through 120 degrees about origin Arrow rotated through 30 degrees about arbitrary point Rotating a cube (demo of the useful class Rota3D)
Chapter 4 Some Classic Algorithms [Link] Bezier curve segments [Link] B-spline curve fitting [Link] Cohen-Sutherland line clipping [Link] Drawing and clipping a polygon [Link] Bresenham algorithms for lines and circles (Exercise 4.3) Chapter 5 Perspective [Link] A cube in perspective [Link] A cube with invisible edges dashed (Exercise 5.1) [Link] Animation with double buffering (Exercise 5.4) [Link] Two rotating cubes with double buffering (Exercise 5.5) Chapter 6 Hidden-face Elimination (see also Chapter 8) [Link] A cube in perspective with back-face culling [Link] Painter's algorithm [Link] Z-buffer algorithm Chapter 7 Hidden-line Elimination (see also Chapter 8) [Link] Hidden-line algorithm Chapter 8 Some Applications (generating input files for [Link], [Link] and [Link] of Chapters 6 and 7) [Link] A (possibly hollow) cylinder [Link] An icosahedron and a dodecahedron [Link] A sphere approximated by triangles [Link] A torus
[Link] [Link] [Link]
A spiral of beams A function z = f(x, y) An open book (Exercise 8.1)
Errata (to first print of the book): On p. 33, in the caption of Figure 2.6, replace PQ and PR with CA and CB. On p. 45, first line, replace OP' and OP with AP' and AP. On p. 74 and 75, program [Link], the z-coordinates of the points A and B should be 2, not 1. This has been corrected in the version of [Link] that you have downloaded. On p. 121, remove the last sentence, starting 'A more sophisticated ...'. On p. 223, remove /2 in third equation. Leen Ammeraal [Link] 22 April 1998