-
Notifications
You must be signed in to change notification settings - Fork 125
/
Copy pathfbm.rs
42 lines (33 loc) · 970 Bytes
/
fbm.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! An example of using the fBm noise function
extern crate noise;
use noise::{utils::*, Fbm, Perlin, Worley};
mod utils;
fn main() {
let fbm = Fbm::<Perlin>::default();
utils::write_example_to_file(
&PlaneMapBuilder::new(fbm)
.set_size(1000, 1000)
.set_x_bounds(-5.0, 5.0)
.set_y_bounds(-5.0, 5.0)
.build(),
"fbm_perlin.png",
);
let fbm = Fbm::<Worley>::default();
utils::write_example_to_file(
&PlaneMapBuilder::new(fbm)
.set_size(1000, 1000)
.set_x_bounds(-5.0, 5.0)
.set_y_bounds(-5.0, 5.0)
.build(),
"fbm_worley.png",
);
let fbm = Fbm::<Fbm<Perlin>>::default();
utils::write_example_to_file(
&PlaneMapBuilder::new(fbm)
.set_size(1000, 1000)
.set_x_bounds(-5.0, 5.0)
.set_y_bounds(-5.0, 5.0)
.build(),
"fbm_fbm_perlin.png",
);
}