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

FBXLoader: Fix polygon triangulation #27094

Merged
merged 3 commits into from
Oct 31, 2023

Conversation

StrandedKitty
Copy link
Contributor

@StrandedKitty StrandedKitty commented Oct 31, 2023

Fixed #15211

Description

I've implemented correct triangulation using Earcut for concave polygons with >3 vertices when parsing FBX models. Previously this kind of polygons was naively triangulated by looping through each vertex and sequentially creating N-2 triangles for a polygon with N vertices. This worked for convex polygons but not for concave ones. See attached screenshots for comparison (before - after).

Screenshot 2023-10-31 at 13 00 51 Screenshot 2023-10-31 at 13 00 27 Screenshot 2023-10-31 at 13 00 51 Screenshot 2023-10-31 at 13 00 27

@Mugen87 Mugen87 added this to the r159 milestone Oct 31, 2023
@Mugen87 Mugen87 merged commit 5a25a00 into mrdoob:dev Oct 31, 2023
18 checks passed
@Mugen87
Copy link
Collaborator

Mugen87 commented Oct 31, 2023

Let's give this a try!

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

Successfully merging this pull request may close these issues.

FBXLoader: Incorrect mesh parsing
2 participants