This page contains links to all the code used in the book.
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 basis by going to the relevant chapter page via the top-level page of this site.
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):
I sometimes get queries about the code "not compiling" or "not working". It does compile and work, but you need to install Java and Java 3D first.
Java 3D is not part of the standard Java distribution; it's a separate download. Install Java first, then Java 3D.
Each of the code directories contains its own readme.txt file which explains how to compile and execute that chapter's examples.
Jason Morin, a Linux games programmer, has had case-insensitivity problems when loading some files. For example, chapter 24 uses a 3D model which the code refers to as "Coolrobo.3ds". Unfortunately, the file is actually called "COOLROBO.3DS".
The case difference doesn't matter on Windows, which is why it slipped past me. On Linux, it triggers an error message about the file not being found.
The fix is to change the name of the file so its case matches that used in the code (e.g. rename "COOLROBO.3DS" to "Coolrobo.3ds"). There's no need to modify the Java code.
Dr. Andrew Davison
Back to my home page