-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6efc9e7
commit 2ace1be
Showing
8 changed files
with
639 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use noise_gui::Expr; | ||
|
||
fn main() { | ||
let mut test_expr: Expr = ron::from_str(include_str!("test.ron")).unwrap(); | ||
|
||
// This gets a noise value which is identical to what was designed in the GUI | ||
println!("Sampled value: {}", test_expr.noise().get([0.0, 0.0, 0.0])); | ||
|
||
// This replaces the value of a variable and samples a new noise function: | ||
println!( | ||
"Updated value: {}", | ||
test_expr | ||
.set_f64("my-var", 42.0) | ||
.noise() | ||
.get([0.0, 0.0, 0.0]) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Displace(( | ||
source: Cylinders(Value(0.78)), | ||
axes: (Add((Perlin(Value(0)), Constant(Variable("my-var", 0.18)))), Add((Perlin(Value(0)), Constant(Variable("my-var", 0.18)))), Constant(Value(0.0)), Constant(Value(0.0))), | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.