|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.math.PerlinNoise
public class PerlinNoise
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 |
---|
public PerlinNoise()
Method Detail |
---|
public static double value(double x, double y, double z)
public static void calcGradient(Vec3 gradient, double x, double y, double z)
public static void calcVector(Vec3 v, double x, double y, double z)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |