Skip to content

Commit

Permalink
Create a primitive sampling showcase example (#13519)
Browse files Browse the repository at this point in the history
# 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]>
  • Loading branch information
3 people authored May 27, 2024
1 parent 8e7b584 commit f67ae29
Show file tree
Hide file tree
Showing 3 changed files with 712 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2970,6 +2970,18 @@ description = "Shows off rendering for all math primitives as both Meshes and Gi
category = "Math"
wasm = true

# Math
[[example]]
name = "sampling_primitives"
path = "examples/math/sampling_primitives.rs"
doc-scrape-examples = true

[package.metadata.example.sampling_primitives]
name = "Sampling Primitives"
description = "Demonstrates all the primitives which can be sampled."
category = "Math"
wasm = true

[[example]]
name = "random_sampling"
path = "examples/math/random_sampling.rs"
Expand Down
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ Example | Description
--- | ---
[Random Sampling](../examples/math/random_sampling.rs) | Demonstrates how to sample random points from mathematical primitives
[Rendering Primitives](../examples/math/render_primitives.rs) | Shows off rendering for all math primitives as both Meshes and Gizmos
[Sampling Primitives](../examples/math/sampling_primitives.rs) | Demonstrates all the primitives which can be sampled.

## Reflection

Expand Down
Loading

0 comments on commit f67ae29

Please sign in to comment.