An Overview of LoaderInfo3DThe class diagrams for LoaderInfo in Figure 16-3 show only the classes' public methods. Figure 16-3. Class diagrams for LoaderInfo3DCheckerFloor and ColouredTile are unchanged from Chapter 15: CheckerFloor creates the floor using ColouredTile objects. LoaderInfo3D is the top-level JFrame for the application and is similar to Checkers3D, except that it takes two arguments from the command line (the name of the file to load and an adaptation number) and passes them to WrapLoaderInfo3D: java -cp "%CLASSPATH%;ncsa\portfolio.jar" LoaderInfo3D Coolrobo.3ds 0 This renders the robot model stored in Coolrobo.3ds in blue, as in Figure 16-1. The classpath argument is used to include the loaders package stored in portfolio.jar.
You may be wondering about the mysterious adaptation number; it's an integer representing the appearance modification that should be applied to the model. The meaning of the integer values are: 0 Makes the shape blue 1 Draws the shape in outline 2 Renders the shape almost transparent 3 Lays a texture over the shape 4 Makes the shape blue and adds a texture
WrapLoaderInfo3D creates the scene in a similar way to the WrapCheckers3D class in Chapter 15. I always use a Wrap class to build the scene in the chapters on Java 3D. WrapLoaderInfo3D performs two other tasks: examining the model and modifying the shape according to the user's supplied adaptation number. The methods for WrapLoaderInfo3D are shown in Figure 16-4, grouped into three categories:
Figure 16-4. WrapLoaderInfo3D methods |