Class VoroniFunction3D

java.lang.Object
com.ardor3d.math.functions.VoroniFunction3D
All Implemented Interfaces:
Function3D

public class VoroniFunction3D extends Object implements Function3D
Function that produces a Voronoi graph by placing a random point in every 1x1x1 unit cube in space and then finding the closest of these points at each eval location.
  • Constructor Details

    • VoroniFunction3D

      public VoroniFunction3D()
      Construct with default values.
    • VoroniFunction3D

      public VoroniFunction3D(double frequency, double displacement, boolean useDistance, int seed)
      Construct a new Voronoi graph function.
      Parameters:
      frequency - used to modulate input coordinates
      displacement - use to modulate the contribution of the random points in each unit cube.
      useDistance - if true, we will add the distance from the closest point to our output, giving us variation across the cell.
      seed - the random seed value to give to our integer random function.
  • Method Details

    • eval

      public double eval(double x, double y, double z)
      Specified by:
      eval in interface Function3D
      Parameters:
      x - the 1st value in our tuple
      y - the 2nd value in our tuple
      z - the 3rd value in our tuple
      Returns:
      some value, generally (but not necessarily) in [-1, 1]
    • getFrequency

      public double getFrequency()
    • setFrequency

      public void setFrequency(double frequency)
    • isUseDistance

      public boolean isUseDistance()
    • setUseDistance

      public void setUseDistance(boolean useDistance)
    • getDisplacement

      public double getDisplacement()
    • setDisplacement

      public void setDisplacement(double displacement)
    • getSeed

      public int getSeed()
    • setSeed

      public void setSeed(int seed)