Crates.io | lazy_diamond_square |
lib.rs | lazy_diamond_square |
version | 1.1.0 |
source | src |
created_at | 2023-07-26 05:21:27.259101 |
updated_at | 2023-12-28 09:26:55.686176 |
description | Lazy implementation of the diamond-square without randomness |
homepage | https://github.com/Priz01/lazy_diamond_square/ |
repository | https://github.com/Priz01/lazy_diamond_square/ |
max_upload_size | |
id | 926216 |
size | 46,051 |
The lazy_diamond_square allow you to use the Diamond-Square algorithm to generate your own landscapes or anything else where it might come in handy.
use lazy_diamond_square as lds;
use lds::{Builder, InitBy as By};
fn main() {
let mut map = Builder::new(513, 0.15)
.seed("qwerty")
.init_lvl(2)
.init_by(By::Seed)
.build();
let max_coord = map.max_coord();
map.gen_area((0, 0), (max_coord, max_coord));
map.get_img((0, 0), (max_coord, max_coord), Some("view.png"));
}
roughness = 0.15, Seed("view1.png")
roughness = 0.2, Seed("view2.png")
roughness = 0.2, Seed("view3.png"), InitLevel(4)
Habr article (it's in Russian, so I suggest you use an extension in your browser, like ImTranslator for FireFox, for example).
Wikipedia page (versions in all languages except the one with ligatures)
And anything else you can google for "diamond square". It's very long to list everything, so I just pointed out the main things and this item.
I just wanted to let you know that I'm 13 and this is my first serious project, so I'll be only glad for criticism and advice on how to improve my project. All text in this file is translated with the help of a translator, because I don't know English so well yet.