If you use ALandscape
in your scene, you may want to program the heights on it using code instead of manually brushing it in. To access the ALandscape
object and its functions inside of your code, you must compile and link in the Landscape
and LandscapeEditor
APIs.
Generating a landscape is not terribly challenging. You need to link in both the Landscape
and LandscapeEditor
APIs, and also have a programmatic way to set the height values across the map. In this recipe, we'll show how to use the Perlin noise for this.
Previously, you may have seen Perlin noise used for coloration, but that is not all it is good for. It is excellent for terrain heights as well. You can sum multiple Perlin noise values to get beautiful fractal noise. It is worth a brief study of Perlin noise to understand how to get good outputs.
Retrieve the Perlin noise module from http://webstaff.itn.liu.se/~stegu/aqsis/aqsis-newnoise/. The two...