#include <noise_perlin.h>
Public Types | |
typedef real_type_ | real_type |
Public Member Functions | |
PerlinNoise () | |
~PerlinNoise (void) | |
real_type | operator() (real_type const &x, real_type const &y) const |
real_type | operator() (real_type const &x, real_type const &y, real_type const &z) const |
Perlin Noise Function. This class computes a real_type noise field in a 2-dimensional space.
typedef real_type_ OpenTissue::noise::PerlinNoise< real_type_ >::real_type |
OpenTissue::noise::PerlinNoise< real_type_ >::PerlinNoise | ( | ) | [inline] |
OpenTissue::noise::PerlinNoise< real_type_ >::~PerlinNoise | ( | void | ) | [inline] |
real_type OpenTissue::noise::PerlinNoise< real_type_ >::operator() | ( | real_type const & | x, | |
real_type const & | y | |||
) | const [inline] |
Compute Noise value at specified location. For details on the noise computation see comments on the 3D version.
x | The x coordinate. | |
y | The y coordinate. |
real_type OpenTissue::noise::PerlinNoise< real_type_ >::operator() | ( | real_type const & | x, | |
real_type const & | y, | |||
real_type const & | z | |||
) | const [inline] |
Compute 3D Noise at the specified location. The noise computation is done as follows:
1) A cube lattice is setup.
2) At each of the eight corners a random normalized gradient vector exist.
3) A direction vector from each corner the to the specified location is computed (and stored in the temporaries).
4) Now a ``noise'' value is computed at each of the eight corners, by taking the dot product between computed direction vector at that corner and the gradient at that corner.
5) Finally the noise value at the specified location is computed by trilinear hermite interpolation.
This will create a smooth looking noise function.
x | The x coordinate | |
y | The y coordinate | |
z | The z coordinate |