#view #lds #structure #deprecated #png #lazy-diamond-square #gen-img

deprecated lds_simple_view

This crate is DEPRECATED. USE gen_img method INSTEAD! A simple way to view the contents of a HeightMap structure from a lazy_diamond_square

2 releases

0.1.1 Aug 2, 2023
0.1.0 Aug 1, 2023

#163 in #png

Download history 22/week @ 2024-02-26 51/week @ 2024-04-01

51 downloads per month

MIT/Apache

41KB
775 lines

Lazy Diamond-Square

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.

Example

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"));
}

Examples of work

roughness = 0.15, Seed("view1.png") Example 1: roughness = 0.15, Seed("view1.png")

roughness = 0.2, Seed("view2.png") Example 2: roughness = 0.2, Seed("view2.png")

roughness = 0.2, Seed("view3.png"), InitLevel(4) Example 3: roughness = 0.2, Seed("view3.png"), InitLevel(4)

Sources

Conclusion

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.

Dependencies

~13MB
~61K SLoC