Commit Graph
2 Commits
Author SHA1 Message Date
kamilkrzywda df4fb24822 fix: replace Box3 auto-scale with measured modelLength per species
- Remove unreliable Box3.setFromObject scaling (broke for skinned meshes,
  control rigs, and scene-containing GLBs)
- Use measured vertex extents (scripts/measure-models.mjs) as modelLength
- Clownfish: hide Surface/TopLight/Bubbles/Mirrored nodes (GLB is a full
  scene, not just a fish) — eliminates the white box + giant fish bug
- All 10 species now have accurate scale factors
2026-10-07 18:17:43 +00:00
kamilkrzywda 8c4a7d45a5 fix: normalize GLB model scales to prevent oversized fish
The three Poly Pizza models (betta, blue_tang, flower_horn) rendered
giant (filling the tank) because each GLB had two 100x-scaled nodes
(Fish_Armature bone-parent + the skinned mesh node). three.js binds
skinned meshes with an identity bindMatrix and uses the GLB's
inverseBindMatrices verbatim, so the 100x node scales inflated the
rendered skinned extent ~100x relative to what Box3.setFromObject
reports. GLTFish's 'scale = targetLength / longest' therefore scaled
~100x too big.

Fix: pure GLB JSON-chunk edit (BIN chunk + all 6 animations preserved)
setting the bone-parent node scale to S=1/base and the mesh node scale
to 1, so Box3 == rendered extent == 1.0 and targetLength directly
controls fish size, matching the working models.
2026-10-07 14:49:55 +00:00