mirror of
https://github.com/bevyengine/bevy
synced 2024-11-23 05:03:47 +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" /> |
||
---|---|---|
.. | ||
bevy_a11y | ||
bevy_animation | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_color | ||
bevy_core | ||
bevy_core_pipeline | ||
bevy_derive | ||
bevy_dev_tools | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_dynamic_plugin | ||
bevy_ecs | ||
bevy_encase_derive | ||
bevy_gilrs | ||
bevy_gizmos | ||
bevy_gltf | ||
bevy_hierarchy | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_math | ||
bevy_mikktspace | ||
bevy_pbr | ||
bevy_ptr | ||
bevy_reflect | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_state | ||
bevy_tasks | ||
bevy_text | ||
bevy_time | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_window | ||
bevy_winit |