GLB Export - displaced geometries and flipped orientations

Hi,
we experiencing a problem with our scene in left handed coordinate system and I think it is cause of the changes in GLTF Serializer rework. by SergioRZMasson · Pull Request #15869 · BabylonJS/Babylon.js · GitHub

GLB Export problem | Babylon.js Playground

Flipped orientation you see at the feets

Hello,

Since the overall mesh looks fine except 2 feets out of 3, are you sure the problem isn’t already here on the original file ?

actually it worked before updating babylonjs
in the original the normals and positions are all correct.

after converting the tubes are misplaced (but not all of them) We have a lot of negative scalings inside.

cc @srzerbetto

cc @alexchuber

To clarify, are you talking about the misplacement of the LinesMeshes here?

yes these are misplaced.

and

have flipped orientations

Gotcha, I see the issue now. The left-handed negative scales, used to mirror geometry, are leading to exports with:

  1. incorrect winding orders (and/or side orientations) in a few places, including the feet’s edges
  2. flipped transformations in the tubes

Will investigate this week, but it will take some thought. Mirrored geometry is a tricky case to get right when rendering and exporting.

Probably not feasible for you to do, but throwing it out there anyway: these problems can be avoided entirely by mirroring your nodes via rotations instead of negative scales.

Fortunately, the flipped signs weren’t because of the negative scales. This should fix your issue: glTF Exporter: Fix LH -> RH vertex data conversion bug by alexchuber · Pull Request #16456 · BabylonJS/Babylon.js · GitHub

good job!

Not sure if it is a similar problem after the glb export the bottom of the chair is a little bit flipped. it seems that the rotation of the bottom of the chair does not get exported at all. 2 Meshes are not rotated correctly

GLB Export problem | Babylon.js Playground

problem:

Thanks, that was an amazing catch!

Thanks for your work!

When we find more problems, we let you know.

Now something else, which worked before is wrong

I will create a babylon scene

the table was our fault. We still had some workarounds before exporting cause of the issues. I removed them completely but we have a problem with the chair castors.

GLB Export problem | Babylon.js Playground

Once this is merged, you should be good to go. I missed a sign when redo-ing our conversion function, which was important for managing zero-rotation cases :slight_smile: