-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Merged by Bors] - Fix torus normals #4520
Conversation
I just pushed a new commit that simplifies the math. This seems equivalent as far as I can tell and the results are the same. But I'd appreciate more eyes on the math. edit: Video above now reflects this commit. |
CI failure is the markdown link checker and unrelated / bogus. |
@rparrett, if you're in the mood, it would be nice to have a This would both be informative for users, and help us quickly check for further issues of this sort. |
bors r+ |
(Merging it in now; the shapes example should be in a separate PR anyways) |
# Objective Fix wonky torus normals. ## Solution I attempted this previously in #3549, but it looks like I botched it. It seems like I mixed up the y/z axes. Somehow, the result looked okay from that particular camera angle. This video shows toruses generated with - [left, orange] original torus mesh code - [middle, pink] PR 3549 - [right, purple] This PR https://user-images.githubusercontent.com/200550/164093183-58a7647c-b436-4512-99cd-cf3b705cefb0.mov
# Objective - As requested here: #4520 (comment) - Make it easier to spot issues with built-in shapes ## Solution https://user-images.githubusercontent.com/200550/165624709-c40dfe7e-0e1e-4bd3-ae52-8ae66888c171.mp4 - Add an example showcasing the built-in 3d shapes with lighting/shadows - Rotate objects in such a way that all faces are seen by the camera - Add a UV debug texture ## Discussion I'm not sure if this is what @alice-i-cecile had in mind, but I adapted the little "torus playground" from the issue linked above to include all built-in shapes. This exact arrangement might not be particularly scalable if many more shapes are added. Maybe a slow camera pan, or cycling with the keyboard or on a timer, or a sidebar with buttons would work better. If one of the latter options is used, options for showing wireframes or computed flat normals might add some additional utility. Ideally, I think we'd have a better way of visualizing normals. Happy to rework this or close it if there's not a consensus around it being useful.
# Objective - As requested here: #4520 (comment) - Make it easier to spot issues with built-in shapes ## Solution https://user-images.githubusercontent.com/200550/165624709-c40dfe7e-0e1e-4bd3-ae52-8ae66888c171.mp4 - Add an example showcasing the built-in 3d shapes with lighting/shadows - Rotate objects in such a way that all faces are seen by the camera - Add a UV debug texture ## Discussion I'm not sure if this is what @alice-i-cecile had in mind, but I adapted the little "torus playground" from the issue linked above to include all built-in shapes. This exact arrangement might not be particularly scalable if many more shapes are added. Maybe a slow camera pan, or cycling with the keyboard or on a timer, or a sidebar with buttons would work better. If one of the latter options is used, options for showing wireframes or computed flat normals might add some additional utility. Ideally, I think we'd have a better way of visualizing normals. Happy to rework this or close it if there's not a consensus around it being useful.
# Objective - As requested here: #4520 (comment) - Make it easier to spot issues with built-in shapes ## Solution https://user-images.githubusercontent.com/200550/165624709-c40dfe7e-0e1e-4bd3-ae52-8ae66888c171.mp4 - Add an example showcasing the built-in 3d shapes with lighting/shadows - Rotate objects in such a way that all faces are seen by the camera - Add a UV debug texture ## Discussion I'm not sure if this is what @alice-i-cecile had in mind, but I adapted the little "torus playground" from the issue linked above to include all built-in shapes. This exact arrangement might not be particularly scalable if many more shapes are added. Maybe a slow camera pan, or cycling with the keyboard or on a timer, or a sidebar with buttons would work better. If one of the latter options is used, options for showing wireframes or computed flat normals might add some additional utility. Ideally, I think we'd have a better way of visualizing normals. Happy to rework this or close it if there's not a consensus around it being useful.
# Objective Fix wonky torus normals. ## Solution I attempted this previously in bevyengine#3549, but it looks like I botched it. It seems like I mixed up the y/z axes. Somehow, the result looked okay from that particular camera angle. This video shows toruses generated with - [left, orange] original torus mesh code - [middle, pink] PR 3549 - [right, purple] This PR https://user-images.githubusercontent.com/200550/164093183-58a7647c-b436-4512-99cd-cf3b705cefb0.mov
# Objective - As requested here: bevyengine#4520 (comment) - Make it easier to spot issues with built-in shapes ## Solution https://user-images.githubusercontent.com/200550/165624709-c40dfe7e-0e1e-4bd3-ae52-8ae66888c171.mp4 - Add an example showcasing the built-in 3d shapes with lighting/shadows - Rotate objects in such a way that all faces are seen by the camera - Add a UV debug texture ## Discussion I'm not sure if this is what @alice-i-cecile had in mind, but I adapted the little "torus playground" from the issue linked above to include all built-in shapes. This exact arrangement might not be particularly scalable if many more shapes are added. Maybe a slow camera pan, or cycling with the keyboard or on a timer, or a sidebar with buttons would work better. If one of the latter options is used, options for showing wireframes or computed flat normals might add some additional utility. Ideally, I think we'd have a better way of visualizing normals. Happy to rework this or close it if there's not a consensus around it being useful.
# Objective Fix wonky torus normals. ## Solution I attempted this previously in bevyengine#3549, but it looks like I botched it. It seems like I mixed up the y/z axes. Somehow, the result looked okay from that particular camera angle. This video shows toruses generated with - [left, orange] original torus mesh code - [middle, pink] PR 3549 - [right, purple] This PR https://user-images.githubusercontent.com/200550/164093183-58a7647c-b436-4512-99cd-cf3b705cefb0.mov
# Objective - As requested here: bevyengine#4520 (comment) - Make it easier to spot issues with built-in shapes ## Solution https://user-images.githubusercontent.com/200550/165624709-c40dfe7e-0e1e-4bd3-ae52-8ae66888c171.mp4 - Add an example showcasing the built-in 3d shapes with lighting/shadows - Rotate objects in such a way that all faces are seen by the camera - Add a UV debug texture ## Discussion I'm not sure if this is what @alice-i-cecile had in mind, but I adapted the little "torus playground" from the issue linked above to include all built-in shapes. This exact arrangement might not be particularly scalable if many more shapes are added. Maybe a slow camera pan, or cycling with the keyboard or on a timer, or a sidebar with buttons would work better. If one of the latter options is used, options for showing wireframes or computed flat normals might add some additional utility. Ideally, I think we'd have a better way of visualizing normals. Happy to rework this or close it if there's not a consensus around it being useful.
Objective
Fix wonky torus normals.
Solution
I attempted this previously in #3549, but it looks like I botched it. It seems like I mixed up the y/z axes. Somehow, the result looked okay from that particular camera angle.
This video shows toruses generated with
torus-normals.mov