Grjava

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

The file grjava.zip 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 grjava.zip, 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 RedRect.java Triangles.java Anisotr.java Isotrop.java DefPoly.java ManySq.java 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 PolyTria.java Drawing a polygon interactively and triangulation Chapter 3 Rotations Arrow.java ArrowPt.java Rota3DTest.java 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 Bezier.java Bezier curve segments Bspline.java B-spline curve fitting ClipLine.java Cohen-Sutherland line clipping ClipPoly.java Drawing and clipping a polygon Bresenham.java Bresenham algorithms for lines and circles (Exercise 4.3) Chapter 5 Perspective CubePers.java A cube in perspective CubePersDash.java A cube with invisible edges dashed (Exercise 5.1) Anim.java Animation with double buffering (Exercise 5.4) CubRot2.java Two rotating cubes with double buffering (Exercise 5.5) Chapter 6 Hidden-face Elimination (see also Chapter 8) Backface.java A cube in perspective with back-face culling Painter.java Painter's algorithm ZBuf.java Z-buffer algorithm Chapter 7 Hidden-line Elimination (see also Chapter 8) HLines.java Hidden-line algorithm Chapter 8 Some Applications (generating input files for Painter.java, ZBuf.java and HLines.java of Chapters 6 and 7) Cylinder.java A (possibly hollow) cylinder IcoDode.java An icosahedron and a dodecahedron SphTria.java A sphere approximated by triangles Torus.java A torus

Beams.java Func.java BookView.java

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 Rota3DTest.java, the z-coordinates of the points A and B should be 2, not 1. This has been corrected in the version of Rota3DTest.java 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 http://home.wxs.nl/~ammeraal/ 22 April 1998

You might also like