Terragen is a scenery-generation package for Windows and the Mac, aimed at producing photorealistic landscape images and animations (http://www.planetside.co.uk/terragen/). It’s easy to use, and a beautiful scene can be generated in a few minutes.
Some examples are at http://www.planetside.co.uk/terragen/images.shtml and http://www.planetside.co.uk/terragen/gallery/gallerymain.php. Terragen is currently free for personal, noncommercial use, though there are some restrictions on the size and resolution of the scenes that can be built.
Numerous tools can accept, manipulate, and help create Terragen landscapes. A long list is available at http://www.planetside.co.uk/terragen/resources.shtml. For example, 3DEM can read a wide range of USGS and NASA map file formats and save them as Terragen terrains (http://www.visualizationsoftware.com/3dem.html). For instance, you could build a Martian terrain using real data from NASA’s Mars Surveys.
Terragen can import and export a wide range of file formats through the use of plug-ins. For example, the Firmament plug-in allows Terragen to read BMPs, STMs, POV-RAY height fields, and U.S. Geological Survey (USGS) DEM (digital elevation model) and spatial data transfer standard (SDTS) files. The For Export Only (FEO) plug-in permits exports to BMP, DXF, OBJ, and RIB files.
A user guide explains the various menu items, dialog boxes, and other GUI elements (http://www.planetside.co.uk/terragen/guide/). Carol Brooksbank’s tutorial takes a different approach, based around explanations of common tasks (http://www.caroluk.co.uk/terratut/). I highly recommended it.
My approach requires that Terragen exports its terrain to a Wavefront OBJ file, so the FEO plug-in must be installed (http://homepages.ihug.co.nz/~jomeder/feo/). Plug-ins are supported via the TGPGuiLib plug-in interface (http://homepages.ihug.co.nz/~jomeder/tgpguilib/).
Clicking on the Render Image button in the Rendering Control window displays the scene (see Figure 27-5). Varying levels of detail can be selected; more detail takes longer to display.
The landscape mesh can be saved by selecting the FEO Wavefront OBJ item from the Accessories button in the Landscape window. This will only be present if FEO has been installed. Click Ok to save after unchecking the “Swap Y and Z axes” radio box. This will make the floor of the mesh run along the XY plane with heights along the z-axis.
A good place to read about OBJ support in Java 3D is the documentation for the ObjectFile class, which is used to load an OBJ file. A file may include information about normals, textures, colors, and utilize a separate material file. A specification of the complete OBJ format can be found at http://www.dcs.ed.ac.uk/home/mxr/gfx/3d/OBJ.spec.
Landscape looks in the models/ subdirectory for a OBJ file containing the mesh (e.g., test1.obj) and for a JPG (e.g., test1.jpg) to act as the texture.