Meshes: take the axis order from the header, not from the normals #32
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!32
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/32/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@holdmysocks on GitHub · 2026-11-23 03:51 UTC · original
holdmysocks:claude/axis-hint→master· +18 −7 · 1 files · 1 commits · merged 2026-11-23 03:55 UTCThe mesh blob header at +0x6C says which axis order the position
quantiser used (2 = identity, 1 and 0 = rotated). The decoder also scored
all six orders against the stored normals and switched when another
scored more than 0.05 higher. In a survey of 36,305 meshes that switched
114, in 51 models, and every one of the 7 that could be checked another
way was right before the switch:
upright, at right angles to its lower LODs;
axis;
parts: one mesh outside the box of the model's other LODs;
The switches came from meshes with few usable normals (37 of 114 scored
under 20 triangles) or normals that fit no order (best score 0.5-0.7).
The hinted order scores 0.95 or more on 90 % of meshes.
The header is now taken at its word for the values 0, 1 and 2; the
score still decides for any other value. Six of the seven re-exported:
every LOD of each model now has the same extents.
Not checked: the other 107 switched meshes one by one (helicopter rotor
pieces, bird feathers, 1-triangle animal eyes), and whether a mesh
exists where the header is wrong.