This page contains links to all the code used in the book.
Java Gaming & Graphics Programming Andrew Davison. The eBook Learning Java Bindings for OpenGL (JOGL) (Kagi) by Gene Davis is available from.
You can download almost all the code as a single zip file, kgpjCode.zip (3.06 MB). kgpjCode.zip contains multiple zip files, one for each chapter of the book.
Alternatively, you can download the code on a chapter-by-chapter basisby going to the relevant chapter page via the top-level page of this site.
Files not in kgpjCode.zip
kgpjCode.zip doesn't actually contain all the code; it's missing four files which can be downloaded from here (or from the relevant chapter Web page):
- NCSA Portfolio (zipped) (402 KB)
Portfolio is a very useful collection of model loaders. Used in chapters 16, 18, 19, 24, 27, and 32.
It was developed by the now-defunct NCSA Java 3D Group, in a project led by Steve Pietrowicz and Chris Heistad. - Daniel Selman's Java3dTree package (JAR file) (73 KB).
This package is part of the source code downloadable from http://www.manning.com/selman/ for Selman's excellent Java 3D Programming textbook. Used in chapter 15. - Two zipped OBJ files used for the landscapes in chapter 27:
test1.obj (1.05MB), test2.obj (1.05MB).
Getting my Code to Work (Part 1)
I sometimes get queries about the code 'not compiling' or 'not working'.It does compile and work, but you need to install Java andJava 3D first.
Java 3D is not part of the standard Java distribution; it's a separate download. Install Java first, then Java 3D.
- Java. Install the latest version of Java.
The examples are known to work with all versions since J2SE 1.4.2. - Java 3D is used extensively in this book -- it's the basis of all the 3D examples (15 chapters worth), two of the networking chapters, and its accurate timer class is used in six of the 2D chapters (chapters 2, 3, 4, 11, 12, and 13). There are alternatives to using the Java 3D timer, which I discuss in chapter 2.
Install the latest version of Java 3D.
The examples are known to work with all versions since Java 3D 1.3.1. - Please test Java 3D before you try out my code.
Download, compile, and execute HelloUniverse (2 KB). If Java 3D is properly installed, then it will show a spinning colored cube.
HelloUniverse is a simplified version of a standard Java 3D example.
Getting my Code to Work (Part 2)
Each of the code directories contains its own readme.txt file which explains how to compile and execute that chapter's examples.
Getting my Code to Work with Linux
Jason Morin, a Linux games programmer, has had case-insensitivityproblems when loading some files. For example, chapter 24 uses a 3D modelwhich the code refers to as 'Coolrobo.3ds'. Unfortunately, the fileis actually called 'COOLROBO.3DS'.
The case difference doesn't matter on Windows, which is why itslipped past me. On Linux, it triggers an error message about thefile not being found.
The fix is to change the name of the file so its case matchesthat used in the code (e.g. rename 'COOLROBO.3DS' to 'Coolrobo.3ds').There's no need to modify the Java code.
Navigation:
- Up to the Killer Game Programming in Java Index Page
Book Description
New chapters added recently, inclding:
- Chapter 34. GPS Mapping and Geotagged Images (November 8, 2010)
- Chapter 33. Using Web Service APIs (2009)
Although the number of commercial Java games is still small compared to those written in C or C++, the market is expanding rapidly. Recent updates to Java make it faster and easier to create powerful gaming applications-particularly Java 3D-is fueling an explosive growth in Java games. Java games like Puzzle Pirates, Chrome, Star Wars Galaxies, Runescape, Alien Flux, Kingdom of Wars, Law and Order II, Roboforge, Tom Clancy's Politika, and scores of others have earned awards and become bestsellers.
Java developers new to graphics and game programming, as well as game developers new to Java 3D, will find Killer Game Programming in Java invaluable. This new book is a practical introduction to the latest Java graphics and game programming technologies and techniques. It is the first book to thoroughly cover Java's 3D capabilities for all types of graphics and game development projects.
Killer Game Programming in Java is a comprehensive guide to everything you need to know to program cool, testosterone-drenched Java games. It will give you reusable techniques to create everything from fast, full-screen action games to multiplayer 3D games. In addition to the most thorough coverage of Java 3D available, Killer Game Programming in Java also clearly details the older, better-known 2D APIs, 3D sprites, animated 3D sprites, first-person shooter programming, sound, fractals, and networked games. Killer Game Programming in Java is a must-have for anyone who wants to create adrenaline-fueled games in Java.
About the Authors- Andrew Davison received his Ph.D. from Imperial College in London in 1989. He was a lecturer at the University of Melbourne for six years before moving to Prince of Songkla University in Thailand in 1996. He has also taught in Bangkok, Khon Kaen, and Hanoi. His research interests include scripting languages, logic programming, visualization, and teaching methodologies. This latter topic led to an interest in teaching games programming in 1999.
Read and Download Links:Similar Books: