Positioning a glb model in the 3D space

Hello

I’m having an issue getting my imported models to change their position.
I’ve gone through some of the tutorials here and they’re not working for me
I’m not sure why
Is there a fundamental way to just position a model in the 3D space?

It would be nice to know how they changing position of this example

here is the original tutorial
I don’t see how they are changing the position.

1 Like

You can select the root of the imported object once loaded and then change the position from there, for example:

BABYLON.SceneLoader.Append("scenes/BoomBox/", "BoomBox.gltf", scene, function (scene) {
        scene.createDefaultCameraOrLight(true, true, true);
        scene.activeCamera.alpha += Math.PI;

        scene.getMeshByID("__root__").position = new BABYLON.Vector3(1, 1, 1);
    });
1 Like

sweet yeah that works! thanks

Well now it’s broken again lol
I’m adding multiple models into the same scene
Is there something besides “root” that we need to use for multiple models?

I found this example as a possible clue however it doesn’t make sense as it’s using names that I can’t see where they defined the names?

TechDreamer2
I found a solution, thank you for your help

BABYLON.SceneLoader.ImportMeshAsync(null, 'http://localhost/assets/', 'congratulations.glb', scene).then(results => {
    var root = results.meshes[0];
    root.name = '__xyz3__';
    root.id = '__xyz3__';
    root.rotation.y = Math.PI; // we're backwards in import

    root.position = new BABYLON.Vector3(0, 250, 0);
});