Class PerlinNoiseGenerator

java.lang.Object
org.pushingpixels.radiance.theming.internal.utils.PerlinNoiseGenerator

public class PerlinNoiseGenerator extends 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 final int[]
    Permutations.
    (package private) static final int[]
    Permutations.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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 Details

    • p

      static final int[] p
      Permutations.
    • permutation

      static final int[] permutation
      Permutations.
  • Constructor Details

    • PerlinNoiseGenerator

      public PerlinNoiseGenerator()
  • Method Details

    • 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: