artofillusion.math
Class PerlinNoise

java.lang.Object
  extended by artofillusion.math.PerlinNoise

public class PerlinNoise
extends java.lang.Object

This class provides an implementation of Ken Perlin's noise function, based on the description (but not on the sample code) in "Texturing & Modeling: A Procedural Approach" (second edition), by Ebert, Musgrave, Peachey, Perlin, and Worley (Academic Press, 1998). It also includes the improvements described in "Improving Noise", by Ken Perlin, published in the 2002 SIGGRAPH Proceedings, pp. 681-2.

This is a function which varies smoothly between -1.0 and 1.0, with all of the variation happening on a length scale of about 1. Typically, you will want to add several octaves of this function together to create a fractal noise function. Methods are also provided for calculating the gradient of the noise function, and a closely related noise function which is vector valued.

Note: it is generally recommended to use SimplexNoise instead of this class, since it is faster and produces more isotropic noise. Alternatively, use the Noise class, which allows the preferred noise generator to be changed.


Constructor Summary
PerlinNoise()
           
 
Method Summary
static void calcGradient(Vec3 gradient, double x, double y, double z)
          Given a point in 3D space, calculate the gradient of the scalar noise function at that point.
static void calcVector(Vec3 v, double x, double y, double z)
          Given a point (x,y,z) in 3D space, set v to the value of the vector noise function at that point.
static double value(double x, double y, double z)
          Given a point in 3D space, return the value of the scalar noise function at that point.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerlinNoise

public PerlinNoise()
Method Detail

value

public static double value(double x,
                           double y,
                           double z)
Given a point in 3D space, return the value of the scalar noise function at that point.


calcGradient

public static void calcGradient(Vec3 gradient,
                                double x,
                                double y,
                                double z)
Given a point in 3D space, calculate the gradient of the scalar noise function at that point. This is necessary when using noise for bump mapping.


calcVector

public static void calcVector(Vec3 v,
                              double x,
                              double y,
                              double z)
Given a point (x,y,z) in 3D space, set v to the value of the vector noise function at that point.



Copyright © 1999-2011 by Peter Eastman.