Inverted objects when exporting with Sandbox, glTF to babylon?

Blender performs transformations at loading time when you import a .glb file.

For eg, take this PG:

I baked the transformation matrix of the cube so that the vertices of the cube are transformed and are in the 3.5-4.5 range for X/Z and 0.5/1.5 for Y.

If you look at the data inside the .glb file when exported by Babylon.js, you can see:

    {
      "name": "position - box",
      "bufferView": 0,
      "componentType": 5126,
      "count": 24,
      "type": "VEC3",
      "min": [
        3.5,
        0.5,
        3.5
      ],
      "max": [
        4.5,
        1.5,
        4.5
      ],
      "byteOffset": 0
    },

You can see that the min/max values for X/Z are 3.5/4.5 and 0.5/1.5 for Y, which is what you’d expect from the code and what you see in Babylon :

Now, when loaded into Blender :

Since the Z axis goes upwards and the X axis to the left, Blender modified the vertex coordinates at the time of loading, otherwise you wouldn’t see the scene this way.

3 Likes