ds-heightmap

Crates.iods-heightmap
lib.rsds-heightmap
version0.2.1
sourcesrc
created_at2022-05-10 07:11:01.489476
updated_at2023-06-04 02:28:25.581165
descriptionUsing diamond-square algorithm to generate heightmaps which stored in a 2D-array.
homepagehttps://github.com/fralonra/ds-heightmap
repositoryhttps://github.com/fralonra/ds-heightmap
max_upload_size
id583851
size12,972
fralonra (fralonra)

documentation

README

ds-heightmap

Latest version Documentation MIT

Build

Build for Web

Install wasm-pack and build:

wasm-pack build --release

Usage

use ds_heightmap::Runner;

fn main() {
    let mut runner = Runner::new();
    let output = runner.ds();

    println!("data: {:?}", output.data);
    println!("max: {}", output.max);
    println!("min: {}", output.min);
}

If you would like to supply a random number generator:

use ds_heightmap::Runner;
use rand_chacha::{rand_core::SeedableRng, ChaCha8Rng};

fn main() {
    let mut rng = ChaCha8Rng::from_entropy();

    let mut runner = Runner::new();
    let output = runner.ds_with_rng(&mut rng);

    println!("data: {:?}", output.data);
    println!("max: {}", output.max);
    println!("min: {}", output.min);
}
Commit count: 60

cargo fmt