org.xith3d.terrain.legacy.heightmap
Class Faulting

java.lang.Object
  extended by org.xith3d.terrain.legacy.heightmap.HeightMap
      extended by org.xith3d.terrain.legacy.heightmap.Faulting
All Implemented Interfaces:
java.io.Serializable, Terrain

public class Faulting
extends HeightMap
implements Terrain

Generates a heightmap using fractal faulting. The Algorithm was adapted from Aurel Balmosan's 'faultmap' program posted to Usenet by Carl Burke. Carl has an example and explanation here: http://www.geocities.com/Area51/6902/t_fl_app.html. Converson to the HeightMap class by William Denniss.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.xith3d.terrain.legacy.heightmap.HeightMap
FLIP_STARTING, heightmap, ZIGZAG_COLS, ZIGZAG_ROWS
 
Constructor Summary
Faulting(int width, int height, double scalefactor, java.util.Random rgen)
          Initialises the miller fractal generator.
 
Method Summary
 Geometry generateGeometry(float startX, float startY, float stepX, float stepY)
          Build 3D geometry from terrain
 void generateTerrain()
          Peform CPU calculations to create the terrain
 
Methods inherited from class org.xith3d.terrain.legacy.heightmap.HeightMap
calculateCoords, calculateIndicies, flatten2DArray, generate2D, generate3D, generate3D, generateUTF, point2float, unIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Faulting

public Faulting(int width,
                int height,
                double scalefactor,
                java.util.Random rgen)
Initialises the miller fractal generator.

Parameters:
width -
height -
scalefactor -
rgen - Random number generator to use
Method Detail

generateTerrain

public void generateTerrain()
Description copied from interface: Terrain
Peform CPU calculations to create the terrain

Specified by:
generateTerrain in interface Terrain

generateGeometry

public Geometry generateGeometry(float startX,
                                 float startY,
                                 float stepX,
                                 float stepY)
Description copied from interface: Terrain
Build 3D geometry from terrain

Specified by:
generateGeometry in interface Terrain