I have TV object in .gltf format that is correct when is in Blender, when I export and use it in Babylon it flipped horizontally. Take a look at the TV’s buttons, they are on the right in Blender and left in Babylon.
Blander screenshot:
The issue must be something else specific to your scene - in the sandbox https://sandbox.babylonjs.com/ the model looks the same it does in your blend file screenshot.
This is how I parenting all parts to access them later:
var parent = new BABYLON.Mesh(obj.name, scene);
for (mesh in objArray) {
var tempMesh = objArray[mesh];
tempMesh.parent = parent;
tempMesh.parentMoveToo = true;
}
Is there some thing wrong in it?
objArray is response of :
BABYLON.SceneLoader.ImportMesh("", obj.root, obj.image, scene, function (objArray) {
The first node in objArray is a special mesh with transformations to deal with right to left handedness correction. All children of this node should stay children for correct display.
Anyway, I think the first answer from @sebavan is the right one, GLTF is right handed and Babylon is left handed, if you want the same display you need to add scene.useRightHandedSystem = true.
I really don’t know what are you talking about? I sent my code in top answers The Answer
But now I wondering.
Every mesh I export have a few parts, that In code I unify them with a custom empty parent mesh: var parent = new BABYLON.Mesh(obj.name, scene);
Then when I want to access their parts I use _children.
I am speaking about your code, you are changing the parent of the meshes to another one which does not follow the same properties.
by default in gltf the root node has a special setup to work in left handed scenes. by breaking this parenting the meshes will have problems to render as you d like.
Thanks, I get it, no need for .gltf parenting but .obj still need.
How to access it as one object in scene?
I move position of root part of .gltf but it will not move anything.
When I parenting them, I access them via their parent and then move parent move all parts too. It can be done by putting them in an array but whenever I want to scale, position or rotate them, I have to loop through it and it’s a little bit awkward.
Why don’t you create a parent node with the same rotation and scaling as the gltf root node and move all the meshes in the OBJ under that node? Like this: