-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom primitives example #13795
Merged
alice-i-cecile
merged 5 commits into
bevyengine:main
from
lynn-lumen:custom-primitives-example
Jun 10, 2024
Merged
Custom primitives example #13795
alice-i-cecile
merged 5 commits into
bevyengine:main
from
lynn-lumen:custom-primitives-example
Jun 10, 2024
Conversation
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
alice-i-cecile
added
C-Examples
An addition or correction to our examples
A-Math
Fundamental domain-agnostic mathematical operations
S-Needs-Review
Needs reviewer attention (from anyone!) to move forward
labels
Jun 10, 2024
HackerFoo
approved these changes
Jun 10, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than tweaking the shape a bit, it looks good.
Chubercik
suggested changes
Jun 10, 2024
Co-authored-by: Jakub Marcowski <37378746+Chubercik@users.noreply.github.com>
alice-i-cecile
approved these changes
Jun 10, 2024
alice-i-cecile
added
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
and removed
S-Needs-Review
Needs reviewer attention (from anyone!) to move forward
labels
Jun 10, 2024
mockersf
pushed a commit
that referenced
this pull request
Jun 11, 2024
# Objective - Add a new example showcasing how to add custom primitives and what you can do with them. ## Solution - Added a new example `custom_primitives` with a 2D heart shape primitive highlighting - `Bounded2d` by implementing and visualising bounding shapes, - `Measured2d` by implementing it, - `Meshable` to show the shape on the screen - The example also includes an `Extrusion<Heart>` implementing - `Measured3d`, - `Bounded3d` using the `BoundedExtrusion` trait and - meshing using the `Extrudable` trait. ## Additional information Here are two images of the heart and its extrusion: ![image_2024-06-10_194631194](https://github.com/bevyengine/bevy/assets/62256001/53f1836c-df74-4ba6-85e9-fabdafa94c66) ![Screenshot 2024-06-10 194609](https://github.com/bevyengine/bevy/assets/62256001/b1630e71-6e94-4293-b7b5-da8d9cc98faf) --------- Co-authored-by: Jakub Marcowski <37378746+Chubercik@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Math
Fundamental domain-agnostic mathematical operations
C-Examples
An addition or correction to our examples
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Solution
custom_primitives
with a 2D heart shape primitive highlightingBounded2d
by implementing and visualising bounding shapes,Measured2d
by implementing it,Meshable
to show the shape on the screenExtrusion<Heart>
implementingMeasured3d
,Bounded3d
using theBoundedExtrusion
trait andExtrudable
trait.Additional information
Here are two images of the heart and its extrusion: