# HG changeset patch # User nireco # Date 1228659202 0 # Node ID 80a818ac288ba2ec96162f308cf8a81b04acd122 # Parent 25d9a0090397308533c79eb6688ca56a5ecb9be4 fixed H value of generate_texture diff -r 25d9a0090397 -r 80a818ac288b src/Terrain.cc --- a/src/Terrain.cc Sun Dec 07 13:07:58 2008 +0000 +++ b/src/Terrain.cc Sun Dec 07 14:13:22 2008 +0000 @@ -51,13 +51,15 @@ } } - +/** + * Algorithm read from http://www.gameprogrammer.com/fractal.html + */ void Terrain::generate_texture() { int texturesize = 128; texture = std::vector >(texturesize, std::vector(texturesize)); std::vector land(texture.size()*texture.size()); double str = 0.8; - double H = 0.5; + double H = 0.8; for(int i = 512; i >= 1; i /= 2) { fractal_diamond(land, texturesize, str, i); fractal_step(land, texturesize, str, i);