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

Wrong mesh winding for negative scaled nodes #26

Closed
abbaswasim opened this issue Dec 20, 2022 · 3 comments
Closed

Wrong mesh winding for negative scaled nodes #26

abbaswasim opened this issue Dec 20, 2022 · 3 comments

Comments

@abbaswasim
Copy link

abbaswasim commented Dec 20, 2022

This is GLTFKit issue and haven't tried GLTFKit2 yet but I have a feeling (quick search didn't find the fix) this project will be suffering from the same issue too and since this one is the newer I am creating issue here.

The issue is that according to glTF spec:

When a mesh primitive uses any triangle-based topology (i.e., triangles, triangle strip, or triangle fan), the determinant of the node’s global transform defines the winding order of that primitive. If the determinant is a positive value, the winding order triangle faces is counterclockwise; in the opposite case, the winding order is clockwise.

I have tried GLTFKit with unit_cube.zip model to show the issue. You will see an inside out cube.

@warrenm
Copy link
Owner

warrenm commented Dec 20, 2022

This is a renderer-level concern, and GLTFKit2 doesn't provide any renderers. It seems that SceneKit, which is used in the sample viewer included with this project, handles this situation correctly.
Screenshot 2022-12-20 at 9 26 16 AM

@abbaswasim
Copy link
Author

humn, interesting. I saw the issue in GLTFKit which does provide a viewer so assumed it might exist here too.
Screenshot 2022-12-20 at 20 04 30

@warrenm
Copy link
Owner

warrenm commented Dec 20, 2022

Feel free to file an issue against the appropriate project. Closing.

@warrenm warrenm closed this as completed Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants