/** * Smooth the terrain. For each node, its 8 neighbors heights * are averaged and will participate in the node new height * by a factor <code>np</code> between 0 and 1 * * You must first load() the heightmap data before this will have any effect. * * @param np * The factor to what extend the neighbors average has an influence. * Value of 0 will ignore neighbors (no smoothing) * Value of 1 will ignore the node old height. */ public void smooth(float np) { smooth(np, 1); }
heightmap = new ImageBasedHeightMap(heightMapImage.getImage(), 0.5f); heightmap.load(); heightmap.smooth(0.9f, 1);
heightmap = new ImageBasedHeightMap(heightMapImage.getImage(), 0.3f); heightmap.load(); heightmap.smooth(0.9f, 1);
/** * Smooth the terrain. For each node, its 8 neighbors heights * are averaged and will participate in the node new height * by a factor <code>np</code> between 0 and 1 * * You must first load() the heightmap data before this will have any effect. * * @param np * The factor to what extend the neighbors average has an influence. * Value of 0 will ignore neighbors (no smoothing) * Value of 1 will ignore the node old height. */ public void smooth(float np) { smooth(np, 1); }