Import GTLF object

hello ,

I’m working with babylon and i use :

BABYLON.SceneLoader.ImportMesh("", “./assets/images/obj/”, “Chair.obj”, scene, function (newMeshes) {
newMeshes.forEach(function (mesh) {
mesh.position = position;
})
});
it’s very lourd and i want to change for loading GTLF object .

Thanks For Help :slight_smile:

https://doc.babylonjs.com/how_to/load_from_any_file_type#sceneloaderimportmesh

Just replace your file by a gltf one :slight_smile:

1 Like

thanks for reply but it’s not work :confused:

BABYLON.SceneLoader.ImportMesh("", “./assets/images/gltf/”, “Low-Poly-Plastic-Cup.glb”, scene, function (newMeshes) {

                        newMeshes.forEach(function (mesh) {
                      
                    })
                });

You need to create a repro in the playground or to provide more info as this is the way we load those files everywhere :frowning:

2 Likes

thanks for help
it’s resolved with .Babylon Object :slight_smile:

1 Like

I load mesh using BABYLON.SceneLoader.ImportMesh :

if (!pickInfo.hit) {
var position = getGroundPosition();
BABYLON.SceneLoader.ImportMesh("", “./assets/images/obj/”, “sonic-the-hedgehog.babylon”, scene, function (newMeshes) {
newMeshes.forEach(function (mesh)
mesh.position = position;
})
});
}

My object contain many meshes.
I want to combined all meshes for my object to have one object.

Thanks for help