TerrainToolkit.VoronoiGenerator

Method


function VoronoiGenerator(featureType : FeatureType, cells : int, features : float, scale : float, blend : float) : void

Description

Generates a series of mountain-like features on the terrain object using a Voronoi diagram. There are 3 types of interpolation used to generate features, defined by featureType. The terrain object is subdivided into a number of regions equal to cells. The percentage of cells that will become features is defined by features. The remaining cells are left flat. Features are scaled proportional to their proximity to the next nearest feature by scale. The resulting heightmap is then blended with the original heightmap by blend.

Returns

Nothing.

Example

var go : GameObject = GameObject.Find("Terrain");
go.GetComponent("TerrainToolkit").VoronoiGenerator(FeatureType.Mountains, 32, 0.9, 0.5, 1.0);

Texturing

Terrain Toolkit