Class NormalMapUtil

java.lang.Object
com.ardor3d.extension.terrain.util.NormalMapUtil

public class NormalMapUtil extends Object
  • Constructor Details

    • NormalMapUtil

      public NormalMapUtil()
  • Method Details

    • constructNormalMap

      public static Image constructNormalMap(float[] heightmap, int side, double heightScale, double xGridSpacing, double zGridSpacing)
      Generate an image from the given terrain height data to be used as a source for terrain normal maps.
      Parameters:
      heightmap - the base height data. Generally this is the most detailed height data available. It must be a square heightmap, with a side of "side" as passed below.
      side - the number of samples on a side of the heightmap. This could be calculated by taking the squareroot of heightmap.length, but generally this number is well known by the caller.
      heightScale - the scaling factor applied to the heightMap values to get real world height.
      xGridSpacing - real world spacing between grid in the x direction
      zGridSpacing - real world spacing between grid in the z direction
      Returns:
      the normal image.