Back to Joe's Java IndexBack to 3D Graphics Index.


Simple ROAM Example

 

I have written a small Java program that implements a simple "split-only" version of the ROAM (Real-time Optimally Adapting Meshes) level-of-detail landscape rendering algorithm. This implementation is based heavily on a C++ implementation by Bryan Turner (Jan, 2000) named ROAMSimple.cpp which is described in this Gamasutra article. Bryan has some more information on this and other projects on his fractalscape web page.

I started by porting Bryan's C++ implementation to Java. Then I cleaned up the object structure a bit and made a few minor optimizations (such as replacing the sqrt() based distance calculation with a much faster approximate distance). I also added a nice user interface to access the many options that are available. Otherwise this program functions almost exactly like Bryan's original C++ version. The only real difference is that my version will work with height maps that are not square and have spacing between grid points other than 1.0. This version also fixes a bug with the depth of tessellation discussed on Bryan's web page. Here are some screen shots:

Textured

Flat Shaded

Wire Frame

Observing Algorithm at Work

Note: I have found that the Geometrical MipMapping algorithm easily out-performs this ROAM implementation on systems that have hardware accelerated 3D graphics. You may want to check that out. It's also a LOT easier to understand the simpler GeoMipMap algorithm.

This program uses GL4Java in order to directly access OpenGL. This gives the Java program relatively good rendering performance. You will need to download and install the GL4Java libraries in order to use this program.

This program is available as an executable for the MacOS X. You can also download the full source code to the program and compile it for your platform.

MacOS Application (352k)

May 7, 2002

Java application, as a compressed disk image file, that will run under MacOS X. Includes a sample 1024x1024 height map.

Source Code (292k)

May 7, 2002

The full source code for this program. Includes a sample 1024x1024 height map. Also includes a JAR file with the compiled class files.

Need help?


Created: February 1, 2001
Modified: June 10, 2002