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

Make UVSphere 3d shape use Y-up convention #8717

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

coreh
Copy link
Contributor

@coreh coreh commented May 30, 2023

Objective

Before

Screenshot 2023-05-29 at 21 33 45

After

Screenshot 2023-05-29 at 21 33 05
  • As noted by 0xC0DEDBAD on this Discord message our current UV Sphere is Z-up (with the poles on +Z, -Z). This PR makes it Y-up, to be more consistent with other 3d shapes.

Solution

  • Swapped y and z in the math and also swapped first and second triangle indexes to preserve right-handedness;
  • Flipped UV's V component.

Changelog

Changed

  • Made UVSphere Y-up (instead of Z-up) for consistency with other 3d shapes and Bevy's convention;

Migration Guide

  • UVSphere poles are now on +Y, -Y. If you're currently relying on UVSphere poles being +Z, -Z, (e.g. for texturing/uv mapping purposes) you must rotate your UVSphere by PI / 2.0 (90º) on the X axis;

@coreh
Copy link
Contributor Author

coreh commented May 30, 2023

Hmm looking at it again, I'm still not 100% confident the UV's are correct, let me double check it before we merge this.

@nicopap nicopap added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide labels May 30, 2023
@alice-i-cecile
Copy link
Member

On board with this: has my approval pending verification.

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-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Bug An unexpected or incorrect behavior C-Code-Quality A section of code that is hard to understand or change
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

None yet

4 participants