Creating the Scene


Class Diagrams for Lathe3D

Figure 17-2 shows the class diagrams for the Lathe3D application. The class names, as well as the public and protected methods, are shown.

Figure 17-2. Class diagrams for Lathe3D


Much of this Lathe3D application is scenery to show off various lathe shapes.


Lathe3D is the top-level JFrame and similar to earlier examples: It's the application window holding a 3D canvas made by WrapLathe3D. WrapLathe3D sets up the 3D world like previous wrap classes: it creates the checkerboard, the lights, background, and mouse controls. The only change is a large method called addLatheShapes( ) that makes multiple calls to LatheShape3D (and its subclasses) to create the shapes shown in Figure 17-1. CheckerFloor and ColouredTiles are unchanged from previous chapters. LatheShape3D creates a shape using a LatheCurve object to create the lathe curve. The subclasses of LatheShape3D (EllipseShape3D and RhodoneaShape3D) are examples showing how the rotation path employed by LatheShape3D can be modified.

The code for these classes can be found in Lathe3D/.




Killer Game Programming in Java
Killer Game Programming in Java
ISBN: 0596007302
EAN: 2147483647
Year: 2006
Pages: 340

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net