org.xith3d.utility.noise
Class Perlin2

java.lang.Object
  extended by org.xith3d.utility.noise.Perlin2

public class Perlin2
extends java.lang.Object

Encapsulates Perlin's method for solid noise generation. Adapted from copyrighted source code by Ken Perlin and F. Kenton Musgrave to accompany: Texturing and Modeling: A Procedural Approach Ebert, D., Musgrave, K., Peachey, P., Perlin, K., and Worley, S. AP Professional, September, 1994. ISBN 0-12-228760-6 Web site: http://www.cs.umbc.edu/~ebert/book/book.html


Field Summary
static int BLACK
           
static int BLUE0
           
static int BLUE1
           
static int[] btable
           
static int[] gtable
           
 double land
           
static int LAND0
           
static int LAND1
           
 boolean latic
           
static int METHOD_BASIC
           
static int METHOD_HETERO_TERRAIN
           
static int METHOD_HYBRID_MULTIFRACTAL
           
static int METHOD_MULTIFRACTAL
           
static int METHOD_RIDGED_MULTIFRACTAL
           
static int[] rtable
           
 double water
           
static int WHITE
           
 
Constructor Summary
Perlin2()
           
Perlin2(double hIn, double lacIn, double octIn)
           
Perlin2(int methIn, double hIn, double lacIn, double octIn, double offIn, double gainIn, Noise n)
           
 
Method Summary
 double fBm(double[] point, double H, double lacunarity, double octaves)
           
 double gain(double a, double b)
           
 double Hetero_Terrain(double[] point, double H, double lacunarity, double octaves, double offset)
           
 double HybridMultifractal(double[] point, double H, double lacunarity, double octaves, double offset)
           
 double multifractal(double[] point, double H, double lacunarity, double octaves, double offset)
           
 double RidgedMultifractal(double[] point, double H, double lacunarity, double octaves, double offset, double gain)
           
 void setScaling(double M, double W, double H)
           
 double turbulence(double[] v, double freq)
           
 double value(double x, double z)
          Calculates an intensity value in [0.0,1.0] at the specified point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD_BASIC

public static final int METHOD_BASIC
See Also:
Constant Field Values

METHOD_MULTIFRACTAL

public static final int METHOD_MULTIFRACTAL
See Also:
Constant Field Values

METHOD_HETERO_TERRAIN

public static final int METHOD_HETERO_TERRAIN
See Also:
Constant Field Values

METHOD_HYBRID_MULTIFRACTAL

public static final int METHOD_HYBRID_MULTIFRACTAL
See Also:
Constant Field Values

METHOD_RIDGED_MULTIFRACTAL

public static final int METHOD_RIDGED_MULTIFRACTAL
See Also:
Constant Field Values

BLACK

public static final int BLACK
See Also:
Constant Field Values

BLUE0

public static final int BLUE0
See Also:
Constant Field Values

BLUE1

public static final int BLUE1
See Also:
Constant Field Values

LAND0

public static final int LAND0
See Also:
Constant Field Values

LAND1

public static final int LAND1
See Also:
Constant Field Values

WHITE

public static final int WHITE
See Also:
Constant Field Values

rtable

public static int[] rtable

gtable

public static int[] gtable

btable

public static int[] btable

latic

public boolean latic

land

public double land

water

public double water
Constructor Detail

Perlin2

public Perlin2()

Perlin2

public Perlin2(double hIn,
               double lacIn,
               double octIn)

Perlin2

public Perlin2(int methIn,
               double hIn,
               double lacIn,
               double octIn,
               double offIn,
               double gainIn,
               Noise n)
Method Detail

gain

public double gain(double a,
                   double b)

turbulence

public double turbulence(double[] v,
                         double freq)

fBm

public double fBm(double[] point,
                  double H,
                  double lacunarity,
                  double octaves)

multifractal

public double multifractal(double[] point,
                           double H,
                           double lacunarity,
                           double octaves,
                           double offset)

Hetero_Terrain

public double Hetero_Terrain(double[] point,
                             double H,
                             double lacunarity,
                             double octaves,
                             double offset)

HybridMultifractal

public double HybridMultifractal(double[] point,
                                 double H,
                                 double lacunarity,
                                 double octaves,
                                 double offset)

RidgedMultifractal

public double RidgedMultifractal(double[] point,
                                 double H,
                                 double lacunarity,
                                 double octaves,
                                 double offset,
                                 double gain)

setScaling

public void setScaling(double M,
                       double W,
                       double H)
Parameters:
M -
W -
H -

value

public double value(double x,
                    double z)
Calculates an intensity value in [0.0,1.0] at the specified point.