Advertisement

Terrain Generation Functions

Started by June 02, 2000 12:51 AM
3 comments, last by pr0teus 24 years, 7 months ago
I am in need for functions that will produce some sort of reasonably good looking terrain. I am interested in such functions as z = sin(x) + cos(y) but more complex to give better terrain. Thank you, Ben
I''ve never done this but here''s a idea. I know that overhead the terrain looks just like a grid, the height of the vertices are all that needs adjusting. You want it to be random except for the fact that a point is not out of wack with the points around it. You could go from point to point and if a point(with height already set) is around the point in question, then the point in question is put to a random height that is still fairly close to the others. Make it a variable that holds the max angle or height the terrain can change from point to point. That way it can be easialy changed from smooth terrain to rocky terrain.

Another cool thing to try would be displacement map. Make a grid again and use the colors of the pixels to determine the height of each vertice. Say black for the heighest point possible and white for ground. Then you have more control over the terrain. You can go into a paint program and paint some black(or other color) lines(with the airbrush so it fades to white) and then the lines will turn into mountain ranges.
Advertisement
Maybe this is an interresting link: Generating textures for 64k intros

You can use these methods for creating your own map...

The best site I have seen on Generating Random Fractal Terrain is...

Fractal Terrain

Very easy to follow, the site has diagrams and documentation on the algorithm with source that uses OpenGL. However if you are not using OpenGL the code can be applied to other 3D API's.

Hope this helps


Edited by - POW on June 4, 2000 6:01:17 PM
look into diamond square (also known as fractal clouds) for a simple quick fix type solution, or perlin and worley noise functions for more realistic terrain. all of the above can be combined using band pass filters or gaussian distribution or whatever you feel like.


--
Float like a butterfly, bite like a crocodile.

--Float like a butterfly, bite like a crocodile.

This topic is closed to new replies.

Advertisement