org.xith3d.utility.noise
Class Perlin3

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

public class Perlin3
extends java.lang.Object

PerlinSolidNoiseGenerator.java 1.0 98/06/16 Carl Burke Encapsulates Perlin's method for solid noise generation. Copyright (c) 1998 Carl Burke. 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
           
 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
           
 double water
           
static int WHITE
           
 
Constructor Summary
Perlin3()
           
Perlin3(double hIn, double lacIn, double octIn)
           
Perlin3(int methIn, double hIn, double lacIn, double octIn, double offIn, double gainIn, Noise n)
           
 
Method Summary
 int background()
           
 int color(double x, double y, double z)
           
 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)
          Heterogeneous procedural terrain function: stats by altitude method.
 double HybridMultifractal(double[] point, double H, double lacunarity, double octaves, double offset)
          Hybrid additive/multiplicative multifractal terrain model.
 double multifractal(double[] point, double H, double lacunarity, double octaves, double offset)
          Procedural multifractal evaluated at "point";
 double RidgedMultifractal(double[] point, double H, double lacunarity, double octaves, double offset, double gain)
          Ridged multifractal terrain model.
 void setScaling(double M, double W, double H)
           
 double turbulence(double[] v, double freq)
           
 double value(double x, double y, 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

latic

public boolean latic

land

public double land

water

public double water
Constructor Detail

Perlin3

public Perlin3()

Perlin3

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

Perlin3

public Perlin3(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)
Procedural multifractal evaluated at "point";

Returns:
value stored in "value". Copyright 1994 F. Kenton Musgrave Parameters: ``H'' determines the highest fractal dimension ``lacunarity'' is gap between successive frequencies ``octaves'' is the number of frequencies in the fBm ``offset'' is the zero offset, which determines multifractality Note: this tends to yield very small values, so the results need to be scaled appropriately.

Hetero_Terrain

public double Hetero_Terrain(double[] point,
                             double H,
                             double lacunarity,
                             double octaves,
                             double offset)
Heterogeneous procedural terrain function: stats by altitude method. Evaluated at "point"; returns value stored in "value". Copyright 1994 F. Kenton Musgrave Parameters: ``H'' determines the fractal dimension of the roughest areas ``lacunarity'' is the gap between successive frequencies ``octaves'' is the number of frequencies in the fBm ``offset'' raises the terrain from `sea level'


HybridMultifractal

public double HybridMultifractal(double[] point,
                                 double H,
                                 double lacunarity,
                                 double octaves,
                                 double offset)
Hybrid additive/multiplicative multifractal terrain model. Copyright 1994 F. Kenton Musgrave Some good parameter values to start with: H: 0.25 offset: 0.7


RidgedMultifractal

public double RidgedMultifractal(double[] point,
                                 double H,
                                 double lacunarity,
                                 double octaves,
                                 double offset,
                                 double gain)
Ridged multifractal terrain model. Copyright 1994 F. Kenton Musgrave Some good parameter values to start with: H: 1.0 offset: 1.0 gain: 2.0


setScaling

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

value

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


color

public int color(double x,
                 double y,
                 double z)
Returns:
an (alpha, red, green, blue) color value associated with the value() at the specified point.

background

public int background()
Returns:
an (alpha, red, green, blue) color value associated with the background value in lieu of valid noise.