I cannot confirm this without playground repro to test it out. But gltf/glb files come with the root node, which is a parent node of all meshes in the scene, and this node is classified as a “mesh”. So when you call newMeshes[i].scaling the newMeshes is most likely root node. Basically, when you export mesh from 3D software, its coordinate system usually does not match the webgl standards, so root node is added during export to “fix” that issue. My guess is that by default scaling of the root node contains negative values, so something like (-1,1,1), and when you iterate through meshes and scale them, you assign them new values (10, 10, 10), and that negative value basically flips.
So some thoughts that you can consider is:
- Ignore root during scaling, and scale everything else.
- Figure out the scaling of root and consider those values when you scaling.