Skip to content

Commit f67ae29

Browse files
IQuick143alice-i-cecileJondolf
authored
Create a primitive sampling showcase example (#13519)
# Objective - Show + Visually Test that 3D primitive sampling works - Make an example that looks nice. ## Solution - Added a `sampling_primitives` examples which shows all the 3D primitives being sampled, with a firefly aesthetic. ![image](https://github.com/bevyengine/bevy/assets/27301845/f882438b-2c72-48b1-a6e9-162a80c4273e) ## Testing - `cargo run --example sampling_primitives` - Haven't tested WASM. ## Changelog ### Added - Added a new example, `sampling_primitives`, to showcase all the 3D sampleable primitives. ## Additional notes: This example borrowed a bunch of code from the other sampling example, by @mweatherley. In future updates this example should be updated with new 3D primitives as they become sampleable. --------- Co-authored-by: Alice Cecile <[email protected]> Co-authored-by: Joona Aalto <[email protected]>
1 parent 8e7b584 commit f67ae29

File tree

3 files changed

+712
-0
lines changed

3 files changed

+712
-0
lines changed

Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,6 +2970,18 @@ description = "Shows off rendering for all math primitives as both Meshes and Gi
29702970
category = "Math"
29712971
wasm = true
29722972

2973+
# Math
2974+
[[example]]
2975+
name = "sampling_primitives"
2976+
path = "examples/math/sampling_primitives.rs"
2977+
doc-scrape-examples = true
2978+
2979+
[package.metadata.example.sampling_primitives]
2980+
name = "Sampling Primitives"
2981+
description = "Demonstrates all the primitives which can be sampled."
2982+
category = "Math"
2983+
wasm = true
2984+
29732985
[[example]]
29742986
name = "random_sampling"
29752987
path = "examples/math/random_sampling.rs"

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ Example | Description
322322
--- | ---
323323
[Random Sampling](../examples/math/random_sampling.rs) | Demonstrates how to sample random points from mathematical primitives
324324
[Rendering Primitives](../examples/math/render_primitives.rs) | Shows off rendering for all math primitives as both Meshes and Gizmos
325+
[Sampling Primitives](../examples/math/sampling_primitives.rs) | Demonstrates all the primitives which can be sampled.
325326

326327
## Reflection
327328

0 commit comments

Comments
 (0)