-
Notifications
You must be signed in to change notification settings - Fork 125
/
Copy pathspheres.rs
34 lines (29 loc) · 898 Bytes
/
spheres.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
extern crate noise;
use noise::{core::spheres::*, utils::*};
mod utils;
fn main() {
utils::write_example_to_file(
&PlaneMapBuilder::new_fn(|point| spheres_2d(point.into(), 1.0))
.set_size(1024, 1024)
.set_x_bounds(-5.0, 5.0)
.set_y_bounds(-5.0, 5.0)
.build(),
"spheres 2d.png",
);
utils::write_example_to_file(
&PlaneMapBuilder::new_fn(|point| spheres_3d(point.into(), 2.0))
.set_size(1024, 1024)
.set_x_bounds(-5.0, 5.0)
.set_y_bounds(-5.0, 5.0)
.build(),
"spheres 3d.png",
);
utils::write_example_to_file(
&PlaneMapBuilder::new_fn(|point| spheres_4d(point.into(), 3.0))
.set_size(1024, 1024)
.set_x_bounds(-5.0, 5.0)
.set_y_bounds(-5.0, 5.0)
.build(),
"spheres 4d.png",
);
}