- Home /
Design/discussion question
Runtime Terrain Generation Using Arrays of Elevations, Trees and Terrain Materials
I was wondering that, in Unity can I create a terrain in runtime using a predefined text array consists of easting, northing and elevation values. I would like to create first an empty terrain within the given domain, then I would like to modify the elevations automatically with that array of elevations. I don't want to use blocks like Minecraft, I want to see an interpolated realistic surface with a real data.
If a Delaunay's Triangulation is necessary in this process, converting a mesh to terrain can be another option I believe.
After this generation process, I would like to generate trees and materials of the surface also, using two other layers (predefined texts) as an array again. For example, that location has a tree; then just put there a random tree there or this portion of the terrain is clay, then use clay texture to represent that portion. And all of these items will be completed in runtime; not in the editor window.
In detail, I want to generate terrain from a Digital Elevation Model (DEM) consists of square cells, add trees on this generated realistic terrain and add different materials on the surface.
How can I script for this aim?
Design/discussion questions should be asked on Unity Forums. Unity Answers addresses a single, specific technical question. There are really a number of different issues here. Start by playing with any of the script posted here or on the Unity Wiki that modify the heights array of the TerrainData.