Class PerlinNoiseGenerator


  • public class PerlinNoiseGenerator
    extends java.lang.Object
    A class for producing Perlin-inspired noise. The code written by Ken Perlin.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static int[] p
      Permutations.
      (package private) static int[] permutation
      Permutations.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static double fade​(double t)
      Fades the specified value.
      (package private) static double grad​(int hash, double x, double y, double z)  
      (package private) static double lerp​(double t, double a, double b)
      Interpolates the specified value.
      static double noise​(double x, double y, double z)
      Returns noise for the specified coordinates.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • p

        static final int[] p
        Permutations.
      • permutation

        static final int[] permutation
        Permutations.
    • Constructor Detail

      • PerlinNoiseGenerator

        public PerlinNoiseGenerator()
    • Method Detail

      • noise

        public static double noise​(double x,
                                   double y,
                                   double z)
        Returns noise for the specified coordinates.
        Parameters:
        x - X coordinate.
        y - Y coordinate.
        z - Z coordinate.
        Returns:
        Noise for the specified coordinates.
      • fade

        static double fade​(double t)
        Fades the specified value.
        Parameters:
        t - Value to fade.
        Returns:
        faded value.
      • lerp

        static double lerp​(double t,
                           double a,
                           double b)
        Interpolates the specified value.
        Parameters:
        t - Value.
        a - Starting interpolation value.
        b - Ending interpolation value.
        Returns:
        Interpolated value.
      • grad

        static double grad​(int hash,
                           double x,
                           double y,
                           double z)
        Parameters:
        hash -
        x -
        y -
        z -
        Returns: