Public Types | Public Member Functions

OpenTissue::noise::PerlinNoise< real_type_ > Class Template Reference

#include <noise_perlin.h>

List of all members.

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

Detailed Description

template<typename real_type_>
class OpenTissue::noise::PerlinNoise< real_type_ >

Perlin Noise Function. This class computes a real_type noise field in a 2-dimensional space.


Member Typedef Documentation

template<typename real_type_>
typedef real_type_ OpenTissue::noise::PerlinNoise< real_type_ >::real_type

Constructor & Destructor Documentation

template<typename real_type_>
OpenTissue::noise::PerlinNoise< real_type_ >::PerlinNoise (  )  [inline]
template<typename real_type_>
OpenTissue::noise::PerlinNoise< real_type_ >::~PerlinNoise ( void   )  [inline]

Member Function Documentation

template<typename real_type_>
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.

Parameters:
x The x coordinate.
y The y coordinate.
Returns:
The noise value at the specified location.
template<typename real_type_>
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.

Parameters:
x The x coordinate
y The y coordinate
z The z coordinate
Returns:
The noise value at the specified location.

The documentation for this class was generated from the following file: