Skip to Main Content
Killer Game Programming in Java
book

Killer Game Programming in Java

by Andrew Davison
May 2005
Intermediate to advanced content levelIntermediate to advanced
998 pages
26h
English
O'Reilly Media, Inc.
Content preview from Killer Game Programming in Java

Using Loader3D

Loader3D can be called in two ways:

    java -cp "%CLASSPATH%;ncsa\portfolio.jar Loader3D" <filename>

or:

    java -cp "%CLASSPATH%;ncsa\portfolio.jar Loader3D" -c <filename>

The application searches the models/ subdirectory for the filename and loads the file. If the -c option is included, Loader3D will attempt to load the text file replaceable Coords.txt, which contains translation, rotation, and scaling values (called coords data) that should be applied to the model.

Figure 16-17 shows the Coolrobo.3ds model initially loaded into the application.

Coolrobo.3ds first loaded

Figure 16-17. Coolrobo.3ds first loaded

Figure 16-18 shows the model after it has been moved, rotated, and scaled in various ways.

The user's viewpoint has been moved in Figures 16-17 and 16-18 to make the images bigger on-screen. The changes to the robot can be observed by comparing the model to the red square in both figures, which is centered at (0, 0) on the XZ plane.

The bottom half of the GUI pane in Figure 16-18 shows the current configuration: the (x, y, z) position is (-1.9, 3.9, 0), which is the distance of the model's center from its starting point. The rotation values are (0, 70, 0), which means a 70-degree positive rotation around the y-axis. The model has been scaled by a factor of 2.594.

Coolrobo.3ds after manipulation

Figure 16-18. Coolrobo.3ds after ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Game Development with LibGDX: From Beginner to Professional

Java Game Development with LibGDX: From Beginner to Professional

Lee Stemkoski

Publisher Resources

ISBN: 0596007302Supplemental ContentErrata Page