< index
< 10. Noise generator
< 10.3 Getting simplex noise

=====================================
10.4 Getting wavelet noise
=====================================

> 10.5 Destroying a generator
This function returns the wavelet noise function value between -1.0 and 1.0 at given coordinates.
The wavelet noise is much slower than Perlin, and can only be computed in 1,2 or 3 dimensions. But it doesn't blur at high scales.

C++ : float TCODNoise::getWavelet(float *f) const
C   : float TCOD_noise_wavelet(TCOD_noise_t noise, float *f)
Py  : noise_wavelet(noise, f)

ParameterDescription
noiseIn the C version, the generator handler, returned by the initialization function.
fAn array of coordinates, depending on the generator dimensions (between 1 and 4). The same array of coordinates will always return the same value.

Example :

C++ : // 1d noise
      TCODNoise * noise1d = new TCODNoise(1);
      float p=0.5f;
      float value = noise1d->getWavelet(&p);
      // 2d noise
      TCODNoise * noise2d = new TCODNoise(2);
      float p[2]={0.5f,0.7f};
      float value = noise2d->getWavelet(p);
C   : /* 1d noise */
      TCOD_noise_t noise1d = TCOD_noise_new(1,TCOD_NOISE_DEFAULT_HURST, TCOD_NOISE_DEFAULT_LACUNARITY,NULL);
      float p=0.5f;
      float value = TCOD_noise_wavelet(noise1d,&p);
      /* 2d noise */
      TCOD_noise_t noise2d = TCOD_noise_new(2,TCOD_NOISE_DEFAULT_HURST, TCOD_NOISE_DEFAULT_LACUNARITY,NULL);
      float p[2]={0.5f,0.7f};
      float value = TCOD_noise_wavelet(noise2d,p);
Py  : # 1d noise 
      noise1d = libtcod.noise_new(1)
      value = libtcod.noise_wavelet(noise1d,[0.5])
      # 2d noise
      noise2d = libtcod.noise_new(2)
      value = libtcod.noise_wavelet(noise2d,[0.5,0.7])


This function returns the fbm function value between -1.0 and 1.0 at given coordinates, using fractal hurst and lacunarity defined when the generator has been created.

C++ : float TCODNoise::getFbmWavelet(float *f, float octaves) const
C   : float TCOD_noise_fbm_wavelet(TCOD_noise_t noise, float *f, float octaves)
Py  : noise_fbm_wavelet(noise, f, octaves)

ParameterDescription
noiseIn the C version, the generator handler, returned by the initialization function.
fAn array of coordinates, depending on the generator dimensions (between 1 and 4). The same array of coordinates will always return the same value.
octavesNumber of iterations. Must be < TCOD_NOISE_MAX_OCTAVES = 128

Example :

C++ : // 1d fbm
      TCODNoise * noise1d = new TCODNoise(1);
      float p=0.5f;
      float value = noise1d->getFbmWavelet(&p,32.0f);
      // 2d fbm
      TCODNoise * noise2d = new TCODNoise(2);
      float p[2]={0.5f,0.7f};
      float value = noise2d->getFbmWavelet(p,32.0f);
C   : /* 1d fbm */
      TCOD_noise_t noise1d = TCOD_noise_new(1,TCOD_NOISE_DEFAULT_HURST, TCOD_NOISE_DEFAULT_LACUNARITY,NULL);
      float p=0.5f;
      float value = TCOD_noise_fbm_wavelet(noise1d,&p,32.0f);
      /* 2d fbm */
      TCOD_noise_t noise2d = TCOD_noise_new(2,TCOD_NOISE_DEFAULT_HURST, TCOD_NOISE_DEFAULT_LACUNARITY,NULL);
      float p[2]={0.5f,0.7f};
      float value = TCOD_noise_fbm_wavelet(noise2d,p,32.0f);
Py  : # 1d noise 
      noise1d = libtcod.noise_new(1)
      value = libtcod.noise_fbm_wavelet(noise1d,[0.5],32.0)
      # 2d noise
      noise2d = libtcod.noise_new(2)
      value = libtcod.noise_fbm_wavelet(noise2d,[0.5,0.7],32.0)


This function returns the turbulence function value between -1.0 and 1.0 at given coordinates, using fractal hurst and lacunarity defined when the generator has been created.

C++ : float TCODNoise::getTurbulenceWavelet(float *f, float octaves) const
C   : float TCOD_noise_turbulence_wavelet(TCOD_noise_t noise, float *f, float octaves)
Py  : noise_turbulence_wavelet(noise, f, octaves)

ParameterDescription
noiseIn the C version, the generator handler, returned by the initialization function.
fAn array of coordinates, depending on the generator dimensions (between 1 and 4). The same array of coordinates will always return the same value.
octavesNumber of iterations. Must be < TCOD_NOISE_MAX_OCTAVES = 128

Example :

C++ : // 1d fbm
      TCODNoise * noise1d = new TCODNoise(1);
      float p=0.5f;
      float value = noise1d->getTurbulenceWavelet(&p,32.0f);
      // 2d fbm
      TCODNoise * noise2d = new TCODNoise(2);
      float p[2]={0.5f,0.7f};
      float value = noise2d->getTurbulenceWavelet(p,32.0f);
C   : /* 1d fbm */
      TCOD_noise_t noise1d = TCOD_noise_new(1,TCOD_NOISE_DEFAULT_HURST, TCOD_NOISE_DEFAULT_LACUNARITY,NULL);
      float p=0.5f;
      float value = TCOD_noise_turbulence_wavelet(noise1d,&p,32.0f);
      /* 2d fbm */
      TCOD_noise_t noise2d = TCOD_noise_new(2,TCOD_NOISE_DEFAULT_HURST, TCOD_NOISE_DEFAULT_LACUNARITY,NULL);
      float p[2]={0.5f,0.7f};
      float value = TCOD_noise_turbulence_wavelet(noise2d,p,32.0f);
Py  : # 1d noise 
      noise1d = libtcod.noise_new(1)
      value = libtcod.noise_turbulence_wavelet(noise1d,[0.5],32.0)
      # 2d noise
      noise2d = libtcod.noise_new(2)
      value = libtcod.noise_turbulence_wavelet(noise2d,[0.5,0.7],32.0)

insert a comment