Models are reversed when put in a parent

Hello, we notice that something was wrong when we import our model but we didn’t find out what until we used that earth:

When you set a parent to meshes imported from a model, the meshes become reversed. Hard to see with geometric models but very well visible with that earth. And without a parent the meshes stays correct.

Plus I notice that with the latest babylonjs version, the model can’t be loaded correctly, there is only one mesh in the callback instead of two.

Cheerz :wink:

This is because gltf models are stored in right handed mode and we reverse them using a parent with a scale set to (1, 1, -1) (line 13)
On the loading issues, your gltf file is invalid:

Ok so every time I set a parent to a model using gltf, I have to set the scale to (1, 1, -1) right? I actually changed the scaling to (-1, 1, 1) before you suggested it and it seems to work too.
And this is only with gltf files? no need to do that with other format like obj or babylon?

On the loading issues, why the same gltf file would be correct in 3.3.0 and invalid in the alpha 4.0.0? Should we use gltf2 file instead maybe?

Thanks for helping understand how to use these very specific stuff @Deltakosh! :wink:

yes only for gltf as babylon file format is already left handed.

The gltf loader of 3,3 was less aligned with the spec whereas the 4.0 is spot on. We want to make sure that people are not using bad files :wink:
and yeah gltf2 is the way to go

Cool I note that somewhere for the day we will switch to version 4. :+1:

1 Like