Meshes: take the axis order from the header, not from the normals #32

Manually merged
github merged 1 commit from gh-pr/32/head into gh-pr/32/base 2026-11-26 20:04:24 +00:00
Owner

@⁠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 UTC

The 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:

  • prop_am_handcuffs_bil_preci_01a: the 52,586-triangle chain stood
    upright, at right angles to its lower LODs;
  • head_fr1_lat_013_y_full: the only one of 55 sampled heads on another
    axis;
  • mint_helmet_scooter_wall_01c, prop_am_pill_tray_01a, two _mid vehicle
    parts: one mesh outside the box of the model's other LODs;
  • swift_hi: rotor-blade pieces not lining up with the inner pieces.

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.

**@⁠holdmysocks** on GitHub · 2026-11-23 03:51 UTC · [original](https://github.com/holdmysocks/SixNG/pull/32) `holdmysocks:claude/axis-hint` → `master` · +18 −7 · 1 files · 1 commits · merged 2026-11-23 03:55 UTC The 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: - prop_am_handcuffs_bil_preci_01a: the 52,586-triangle chain stood upright, at right angles to its lower LODs; - head_fr1_lat_013_y_full: the only one of 55 sampled heads on another axis; - mint_helmet_scooter_wall_01c, prop_am_pill_tray_01a, two _mid vehicle parts: one mesh outside the box of the model's other LODs; - swift_hi: rotor-blade pieces not lining up with the inner pieces. 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.
The 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:

- prop_am_handcuffs_bil_preci_01a: the 52,586-triangle chain stood
  upright, at right angles to its lower LODs;
- head_fr1_lat_013_y_full: the only one of 55 sampled heads on another
  axis;
- mint_helmet_scooter_wall_01c, prop_am_pill_tray_01a, two _mid vehicle
  parts: one mesh outside the box of the model's other LODs;
- swift_hi: rotor-blade pieces not lining up with the inner pieces.

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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:04:22 +00:00
github manually merged commit e7aae6b50e into gh-pr/32/base 2026-11-26 20:04:24 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.