mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
ac1f135e20
# Objective The `Cone` primitive should support meshing. ## Solution Implement meshing for the `Cone` primitive. The default cone has a height of 1 and a base radius of 0.5, and is centered at the origin. An issue with cone meshes is that the tip does not really have a normal that works, even with duplicated vertices. This PR uses only a single vertex for the tip, with a normal of zero; this results in an "invalid" normal that gets ignored by the fragment shader. This seems to be the only approach we have for perfectly smooth cones. For discussion on the topic, see #10298 and #5891. Another thing to note is that the cone uses polar coordinates for the UVs: <img src="https://github.com/bevyengine/bevy/assets/57632562/e101ded9-110a-4ac4-a98d-f1e4d740a24a" alt="cone" width="400" /> This way, textures are applied as if looking at the cone from above: <img src="https://github.com/bevyengine/bevy/assets/57632562/8dea00f1-a283-4bc4-9676-91e8d4adb07a" alt="texture" width="200" /> <img src="https://github.com/bevyengine/bevy/assets/57632562/d9d1b5e6-a8ba-4690-b599-904dd85777a1" alt="cone" width="200" /> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |