Skip to content
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

Add ASCII art to custom mesh example (#15261) #15266

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

Wcubed
Copy link
Contributor

@Wcubed Wcubed commented Sep 17, 2024

Added ASCII art to the custom mesh example, to clarify the ordering of the triangle indices.
Fixes #15261.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation A-Rendering Drawing game state to the screen D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward C-Examples An addition or correction to our examples labels Sep 17, 2024
@HackerFoo
Copy link
Contributor

Adding the +X (pointing right) and +Z (pointing down) axes would help.

@HackerFoo
Copy link
Contributor

To check this programmatically, the determinant/triple product of the vectors from a point x above a triangle [p1, p2, p3] should be negative:

(p1 - x).dot((p2 - x).cross(p3 - x)) < 0

Or, if the mesh is convex, and x is a point inside the shape, the triple product should be positive for all triangles in the mesh.

@Wcubed
Copy link
Contributor Author

Wcubed commented Sep 19, 2024

Adding the +X (pointing right) and +Z (pointing down) axes would help.

Good idea. I've added +X and +Z, and marked the other two axis in the diagram (because I was already getting confused while drawing the things, let alone someone reading it).

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 19, 2024
@alice-i-cecile 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 Sep 19, 2024
Merged via the queue into bevyengine:main with commit 13ca08f Sep 19, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Docs An addition or correction to our documentation C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potentially confusing mistake in comment at 3d/generate_custom_mesh example
4 participants