-
Method Summary
Modifier and TypeMethodDescriptionstatic double
gradientCoherentNoise3D
(double x, double y, double z, int seed, NoiseQuality quality) Generates a gradient-coherent-noise value from the coordinates of a three-dimensional input value.static double
gradientNoise3D
(double fx, double fy, double fz, int ix, int iy, int iz, int seed) Generates a gradient-noise value from the coordinates of a three-dimensional input value and the integer coordinates of a nearby three-dimensional value.static int
intValueNoise3D
(int x, int y, int z, int seed) Generates an integer-noise value from the coordinates of a three-dimensional input value.static double
simplexStyleGradientCoherentNoise3D
(double x, double y, double z, int seed, LatticeOrientation orientation, NoiseQualitySimplex quality) Generates a simplex-style gradient coherent noise value from the coordinates of a three-dimensional input value.static double
valueCoherentNoise3D
(double x, double y, double z, int seed, NoiseQuality quality) Generates a value-coherent-noise value from the coordinates of a three-dimensional input value.static double
valueNoise3D
(int x, int y, int z, int seed) Generates a value-noise value from the coordinates of a three-dimensional input value.
-
Method Details
-
simplexStyleGradientCoherentNoise3D
public static double simplexStyleGradientCoherentNoise3D(double x, double y, double z, int seed, LatticeOrientation orientation, NoiseQualitySimplex quality) Generates a simplex-style gradient coherent noise value from the coordinates of a three-dimensional input value.Does not use the classic Simplex noise algorithm, but an alternative. Adapted from the following URLs: https://github.com/KdotJPG/New-Simplex-Style-Gradient-Noise/blob/master/java/FastSimplexStyleNoise.java https://github.com/KdotJPG/New-Simplex-Style-Gradient-Noise/blob/master/java/SuperSimplexNoise.java
The return value ranges from 0 to 1.
- Parameters:
x
- Thex
coordinate of the input value.y
- They
coordinate of the input value.z
- Thez
coordinate of the input value.seed
- The random number seed.orientation
- The lattice orientation of the simplex-style coherent noise. See documentation forLatticeOrientation
.quality
- The quality of the simplex-style coherent noise.- Returns:
- The generated gradient-coherent-noise value.
-
gradientCoherentNoise3D
public static double gradientCoherentNoise3D(double x, double y, double z, int seed, NoiseQuality quality) Generates a gradient-coherent-noise value from the coordinates of a three-dimensional input value.The return value ranges from 0 to 1.
For an explanation of the difference between gradient noise and value noise, see the comments for the
gradientNoise3D(double, double, double, int, int, int, int)
function.- Parameters:
x
- Thex
coordinate of the input value.y
- They
coordinate of the input value.z
- Thez
coordinate of the input value.seed
- The random number seed.quality
- The quality of the coherent-noise.- Returns:
- The generated gradient-coherent-noise value.
-
gradientNoise3D
public static double gradientNoise3D(double fx, double fy, double fz, int ix, int iy, int iz, int seed) Generates a gradient-noise value from the coordinates of a three-dimensional input value and the integer coordinates of a nearby three-dimensional value.The difference between fx and ix must be less than or equal to one. The difference between
fy
andiy
must be less than or equal to one. The difference betweenfz
andiz
must be less than or equal to one.A gradient-noise function generates better-quality noise than a value-noise function. Most noise modules use gradient noise for this reason, although it takes much longer to calculate.
The return value ranges from 0 to 1.
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.
- Parameters:
fx
- The floating-pointx
coordinate of the input value.fy
- The floating-pointy
coordinate of the input value.fz
- The floating-pointz
coordinate of the input value.ix
- The integerx
coordinate of a nearby value.iy
- The integery
coordinate of a nearby value.iz
- The integerz
coordinate of a nearby value.seed
- The random number seed.- Returns:
- The generated gradient-noise value.
-
intValueNoise3D
public static int intValueNoise3D(int x, int y, int z, int seed) Generates an integer-noise value from the coordinates of a three-dimensional input value.The return value ranges from
0
to2147483647
.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.
- Parameters:
x
- The integerx
coordinate of the input value.y
- The integery
coordinate of the input value.z
- The integerz
coordinate of the input value.seed
- A random number seed.- Returns:
- The generated integer-noise value.
-
valueCoherentNoise3D
public static double valueCoherentNoise3D(double x, double y, double z, int seed, NoiseQuality quality) Generates a value-coherent-noise value from the coordinates of a three-dimensional input value.- Parameters:
x
- Thex
coordinate of the input value.y
- They
coordinate of the input value.z
- Thez
coordinate of the input value.seed
- The random number seed.quality
- The quality of the coherent-noise.- Returns:
- The generated value-coherent-noise value.
The return value ranges from 0 to 1.
For an explanation of the difference between gradient noise and value noise, see the comments for
gradientNoise3D(double, double, double, int, int, int, int)
.
-
valueNoise3D
public static double valueNoise3D(int x, int y, int z, int seed) Generates a value-noise value from the coordinates of a three-dimensional input value.The return value ranges from 0 to 1.
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.
- Parameters:
x
- Thex
coordinate of the input value.y
- They
coordinate of the input value.z
- Thez
coordinate of the input value.seed
- A random number seed.- Returns:
- The generated value-noise value.
-