Creating the Scene


Class Diagrams for Tour3D

Figure 18-2 shows class diagrams for Tour3D. Only class names are shown here, to reduce the complexity of the diagram.

Figure 18-2. Class diagrams for Tour3D


Tour3D is the top-level JFrame for the application. WrapTour3D creates the 3D scene and is similar to earlier Wrap classes in that it creates the checkered floor and sets up the lighting. This version loads the scenery and obstacles and creates the sprites.

PropManager is unchanged from the class in the Loader3D application in Chapter 16. CheckerFloor and ColouredTiles are the same classes as in previous examples. The Obstacles class is new: it stores information about the scene's obstacles.

The sprites are subclasses of Sprite3D. The robot is an instance of TourSprite, and the hand is an AlienSprite object. TourSprite is controlled by TouristControls, and TimeBehavior updates AlienSprite. TouristControls and TimeBehavior are subclasses of Java 3D's Behavior class.

The code for the Tour3D example can be found in the Tour3D/ directory.




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