Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While trying to fix MakieOrg/Makie.jl#3993 I noticed that you get an uninitialized normal (and probably position) when loading the cat mesh (test.obj here). This is due to the index remapping not working correctly. (As a reminder - object files can specify independent indices for positions, normals and texture coordinates within a vertex of a face. OpenGL only allows one index buffer, i.e. one index per vertex, so we need to combine vertex indices into a single unique index and reorder the position, normal and texture coordinate arrays accordingly.)
To fix this I just rewrote the remapping code with a
Dict
instead of whatever it was doing. That should make it faster and easier to understand/reason with. In the end this removes one position and normal from the cat mesh which should be that undefined first normal/position. I also added a short test for the remapping function.