GradientNoise3D

Generates a gradient-noise value from the coordinates of a three-dimensional input value and the integer coordinates of a nearby three-dimensional value.

@param fx The floating-point @a x coordinate of the input value. @param fy The floating-point @a y coordinate of the input value. @param fz The floating-point @a z coordinate of the input value. @param ix The integer @a x coordinate of a nearby value. @param iy The integer @a y coordinate of a nearby value. @param iz The integer @a z coordinate of a nearby value. @param seed The random number seed.

@returns The generated gradient-noise value.

@pre The difference between @a fx and @a ix must be less than or equal to one.

@pre The difference between @a fy and @a iy must be less than or equal to one.

@pre The difference between @a fz and @a iz must be less than or equal to one.

A <i>gradient</i>-noise function generates better-quality noise than a <i>value</i>-noise function. Most noise modules use gradient noise for this reason, although it takes much longer to calculate.

The return value ranges from -1.0 to +1.0.

This function generates a gradient-noise value by performing the following steps: - It first calculates a random normalized vector based on the nearby integer value passed to this function. - It then calculates a new value by adding this vector to the nearby integer value passed to this function. - It then calculates the dot product of the above-generated value and the floating-point input value passed to this function.

A noise function differs from a random-number generator because it always returns the same output value if the same input value is passed to it.

double
GradientNoise3D
(
double fx
,
double fy
,
double fz
,
int ix
,
int iy
,
int iz
,
int seed = 0
)

Meta