Summary:
- I have a gltf.
- I load the gltf.
Object BoundingBox is
e {x: -0.11130329966545105, y: -0.3582372907549144, z: -0.29034799337387096}
e {x: 0.2866967022418976, y: 0.39776269160211086, z: 0.26465200021630164}
- I save the gltf
- I load the gltf again.
Object BB is
e {x: -0.11130329966545105, y: -0.3582372907549144, z: -0.26465200021630164}
e {x: 0.2866967022418976, y: 0.39776269160211086, z: 0.29034799337387096}
Result - objects have different location for the Z. And they are flipped. I can not
Details.
- I can not share the gltf currently since it is not my property, but i am trying to reduce it.
- I load the gltf with
loader.Load(baseUrl, file, engine, scene => {
After loading this is the scene
I am debugging the scene with
scene.getNodes().forEach((node) => {
console.log(node.name)
console.log(node.getHierarchyBoundingVectors().min)
console.log(node.getHierarchyBoundingVectors().max)
})
And first object on the scene is
12412602846168467473
e {x: -0.11130329966545105, y: -0.3582372907549144, z: -0.29034799337387096}
e {x: 0.2866967022418976, y: 0.39776269160211086, z: 0.26465200021630164}
- I save the gltf with
let options = {
shouldExportNode: function(/** @type {BABYLON.Node} */ transformNode) {
if (/light1/.test(transformNode.name) || /light2/.test(transformNode.name)) {
return false;
}
return true;
}
};
BABYLON.GLTF2Export.GLBAsync(this._babylonScene, "scene.glb", options).then(response => {
response.downloadFiles();
});
- I load the gltf again. This time the scene is:
First node has
12412602846168467473
e {x: -0.11130329966545105, y: -0.3582372907549144, z: -0.26465200021630164}
e {x: 0.2866967022418976, y: 0.39776269160211086, z: 0.29034799337387096}
I decided to load and save with sandbox.babylonjs.com
I am loading my file, then saving the and coordinates flip
Here is initially loaded
Here is loaded after the event.
What could I do