artofillusion.math
Class Noise

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

public class Noise
extends java.lang.Object

This class provides an interface for accessing a three dimensional noise function. By default it uses the SimplexNoise class to calculate the function, but it is possible to specify an alternate noise generator. This allows plugins to replace the noise function used throughout the application, for example to provide a faster implementation using native code.

Regardless of the implementation, this should be 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 vector valued noise function.


Nested Class Summary
static interface Noise.NoiseGenerator
          This interface defines an object which can be used to calculate the noise function.
 
Constructor Summary
Noise()
           
 
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.
 Noise.NoiseGenerator getGenerator()
          Get the generator used to calculate the noise function.
 void setGenerator(Noise.NoiseGenerator gen)
          Set the generator used to calculate the noise function.
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

Noise

public Noise()
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.


getGenerator

public Noise.NoiseGenerator getGenerator()
Get the generator used to calculate the noise function.


setGenerator

public void setGenerator(Noise.NoiseGenerator gen)
Set the generator used to calculate the noise function.



Copyright © 1999-2011 by Peter Eastman.