Package tdl :: Module noise :: Class Noise |
[frames] | no frames]

# Class Noise

source code

    object --+
             |
            Noise

An advanced noise generator.

Instance Methods
__init__(self, algorithm=`'``PERLIN``'`, mode=`'``FLAT``'`, hurst=0.5, lacunarity=2.0, octaves=4.0, seed=None, dimensions=4) Create a new noise generator specifying a noise algorithm and how it's used. | source code
__copy__(self) | source code
__getstate__(self) | source code
__setstate__(self, state) | source code
float |
get_point(self, *position) Return the noise value of a specific position. | source code
__del__(self) | source code
getPoint(*args, **kargs) Deprecated version of the function get_point, you should prefer calling that function instead of this one. | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self, algorithm=`'``PERLIN``'`, mode=`'``FLAT``'`, hurst=0.5, lacunarity=2.0, octaves=4.0, seed=None, dimensions=4) (Constructor) | source code
Create a new noise generator specifying a noise algorithm and how it's used. Parameters: `algorithm` (string) - The primary noise algorithm to be used. Can be one of 'PERLIN', 'SIMPLEX', 'WAVELET' 'PERLIN' - A popular noise generator. 'SIMPLEX' - In theory this is a slightly faster generator with less noticeable directional artifacts. 'WAVELET' A noise generator designed to reduce aliasing and not lose detail when summed into a fractal (as with the 'FBM' and 'TURBULENCE' modes.) This works faster at higher dimensions. `mode` (string) - A secondary parameter to determine how noise is generated. Can be one of 'FLAT', 'FBM', 'TURBULENCE' 'FLAT' - Generates the simplest form of noise. This mode does not use the hurst, lacunarity, and octaves parameters. 'FBM' - Generates fractal brownian motion. 'TURBULENCE' - Generates detailed noise with smoother and more natural transitions. `hurst` (float) - The hurst exponent describes the raggedness of the resultant noise, with a higher value leading to a smoother noise. It should be in the 0.0-1.0 range. This is only used in 'FBM' and 'TURBULENCE' modes. `lacunarity` (float) - A multiplier that determines how quickly the frequency increases for each successive octave. The frequency of each successive octave is equal to the product of the previous octave's frequency and the lacunarity value. This is only used in 'FBM' and 'TURBULENCE' modes. `octaves` (float) - Controls the amount of detail in the noise. This is only used in 'FBM' and 'TURBULENCE' modes. `seed` (object) - You can use any hashable object to be a seed for the noise generator. If None is used then a random seed will be generated. Overrides: object.__init__

### get_point(self, *position) | source code
Return the noise value of a specific position. Example usage: value = noise.getPoint(x, y, z) Parameters: `position` (floats) Returns: float Returns the noise value at position. This will be a floating point in the 0.0-1.0 range.