# Models are loaded differently when fresh browser

**URL:** https://forum.babylonjs.com/t/models-are-loaded-differently-when-fresh-browser/22389
**Category:** Bugs
**Tags:** gltf
**Created:** [July 15, 2021, 6:43am UTC](https://forum.babylonjs.com/t/models-are-loaded-differently-when-fresh-browser/22389 "2021-07-15T06:43:41Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Lennox](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lennox/32/17358_2.png) [@Lennox](https://forum.babylonjs.com/u/Lennox)
#### Post date: [July 15, 2021, 6:43am UTC](https://forum.babylonjs.com/t/models-are-loaded-differently-when-fresh-browser/22389/1 "2021-07-15T06:43:41Z")

</div>

Hello  
I developed a website with babylon.js.  
But I encountered a very wired error.

I load model via gltf loader and set position and rotation for them.  
but when I get into my website, I get different result of these models’ transformation  
This is what I need:  
[Imgur](https://i.imgur.com/spRalkR.jpg)  
But if I fresh the page f5 or hard fresh it with ctrl + f5  
I get this:  
[Imgur](https://i.imgur.com/loKbnE3.png)  
or some other situations.(sry, as new user in this forum I can only put one pic or two links)

I use some code like this to load models

```auto
const boxMix = require('../ult/ult.js').boxMix
module.exports = function(scene) {
    window.BABYLON.SceneLoader.ImportMeshAsync(null, "assets/model/", "arcade.glb", scene)
    .then((result) => {
        //add loading progress
        window.loadingFresh(10)

        let parent = new window.BABYLON.Mesh("arcade", scene);
        result.meshes.forEach((element) => {
            if(element.id === ' __root__') {
                element.dispose(true, true)
            }
           element.setParent(parent)
        });
        boxMix(parent);
        parent.scaling.x = 130;
        parent.scaling.y = 130;
        parent.scaling.z = 130;
        parent.position.x = 700;
        parent.position.z = 100;
        parent.position.y = 120;
        parent.rotation.y = (-1 * Math.PI / 4)
    })
}

```

and the boxMix code:

```auto
let boxMix = function (parent) {
    let childMeshes = parent.getChildMeshes();
    let min, max
    if (childMeshes.length > 0) {
        min = childMeshes[0].getBoundingInfo().boundingBox.minimumWorld;
        max = childMeshes[0].getBoundingInfo().boundingBox.maximumWorld;
    }

    childMeshes.forEach((it, idx) => {
        let meshMin = it.getBoundingInfo().boundingBox.minimumWorld;
        let meshMax = it.getBoundingInfo().boundingBox.maximumWorld;
        min = window.BABYLON.Vector3.Minimize(min, meshMin);
        max = window.BABYLON.Vector3.Maximize(max, meshMax);
    })
    parent.setBoundingInfo(new window.BABYLON.BoundingInfo(min, max));
    //set pivot to center of the boundingBox
    parent.setPivotPoint(window.BABYLON.Vector3.Center(min, max))
}

```

use parent mesh and boxMix func to fix some pivot problem in models

I’m pretty new with 3d and babylon  
Did I do sometime wrong ?  
How should I do to fix this issue?

---

<div class="post-metadata">

### Author: ![Vinc3r](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/vinc3r/32/25340_2.png) [@Vinc3r](https://forum.babylonjs.com/u/Vinc3r)
#### Post date: [July 15, 2021, 7:21am UTC](https://forum.babylonjs.com/t/models-are-loaded-differently-when-fresh-browser/22389/2 "2021-07-15T07:21:45Z")

</div>

I’m pretty sure it has to do with the ` __root__ ` dispose. As axys convention aren’t the same between BJS & glTF, the gltf importer use this root object as an “axys fixer”

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/f/b/fb0107bd6cdbce97826ee6e0b8cdea392a901ada.png)

Don’t know why result is different on refresh though, maybe due to the async loading?

---

<div class="post-metadata">

### Author: ![Lennox](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lennox/32/17358_2.png) [@Lennox](https://forum.babylonjs.com/u/Lennox)
#### Post date: [July 15, 2021, 7:33am UTC](https://forum.babylonjs.com/t/models-are-loaded-differently-when-fresh-browser/22389/3 "2021-07-15T07:33:07Z")

</div>

Thank you so much, Vinc3r.  
I’ll dig into the **root** stuff, trying to find some clues.

---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [July 15, 2021, 2:16pm UTC](https://forum.babylonjs.com/t/models-are-loaded-differently-when-fresh-browser/22389/4 "2021-07-15T14:16:20Z")

</div>

A repro in the playground would help as this code should be at least fully deterministic 🙂

---

<div class="post-metadata">

### Author: ![wudao](https://avatars.discourse-cdn.com/v4/letter/w/c77e96/32.png) [@wudao](https://forum.babylonjs.com/u/wudao)
#### Post date: [January 7, 2022, 6:52am UTC](https://forum.babylonjs.com/t/models-are-loaded-differently-when-fresh-browser/22389/5 "2022-01-07T06:52:49Z")

</div>

How to recode on the playground?

---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [January 7, 2022, 1:31pm UTC](https://forum.babylonjs.com/t/models-are-loaded-differently-when-fresh-browser/22389/6 "2022-01-07T13:31:36Z")

</div>

@wudao not sure your question is related to this thread ???
