![]() |
Perlin Noise Terrain Generator
A Program to Generate Terrain from Perlin Noise with Exponentially Distributed Gradient Magnitude
|
Main. More...
Functions | |
| void | GenerateAndSave (const unsigned int x, const unsigned int y, const char *filename) |
| Generate and save a cell of terrain elevations. | |
| int | main (int argc, char *argv[]) |
| Main. | |
Variables | |
| const int | CELLSIZE = 4096 |
| Number of vertices on side of square cell. | |
| int | g_nNumOctaves = 8 |
| Number of octaves. | |
| float | g_fAltitude = 5000.0f |
| Altitude cap. | |
| float | g_fMu = 1.02f |
| Mu, the gradient magnitude exponent. | |
| void GenerateAndSave | ( | const unsigned int | x, |
| const unsigned int | y, | ||
| const char * | filename | ||
| ) |
Generate and save a cell of noise as a DEM file. The output file will have a ".asc" file expension, which is standard for DEM files.
| x | X coordinate of corner of cell. |
| y | Y coordinate of corner of cell. |
| filename | Name of DEM file for output, without extension. |
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Prompts the user for a random number seed, number of octaves, mu, and an elevation cap, saves a DEM file output.asc of terrain elevations generated using Perlin noise with an exponentially distributed gradient magnitude.
| argc | Argument count |
| argv | Arguments. |
1.8.2