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

USDZLoader: Support quads as triangles. #28648

Merged
merged 1 commit into from
Jun 13, 2024
Merged

USDZLoader: Support quads as triangles. #28648

merged 1 commit into from
Jun 13, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jun 13, 2024

Related issue: #28639 (comment)

Description

The PR ensures USDZLoader can load assets with quads definitions.

@Mugen87 Mugen87 added this to the r166 milestone Jun 13, 2024
@Mugen87 Mugen87 merged commit 3ea9856 into mrdoob:dev Jun 13, 2024
11 checks passed
const d = rawIndices[ stride + 3 ];

indices.push( a, b, c );
indices.push( a, c, d );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mugen87 I vaguely recall this being better, but I have been unable to locate a reference...

indices.push( a, b, c );
indices.push( c, d, a );

Maybe someone else knows if it is true.

Copy link
Collaborator Author

@Mugen87 Mugen87 Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the reference, LWOLoader splits up its quads with the same strategy like USDZLoader:

} else if ( dim === 4 ) {
remappedIndices.push(
indices[ i ],
indices[ i + 1 ],
indices[ i + 2 ],
indices[ i ],
indices[ i + 2 ],
indices[ i + 3 ]
);

If it turns out (c,d,a) is better, I'm happy to update the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants