# cubeCamera breaks down after I import a glb model

**URL:** https://discourse.threejs.org/t/cubecamera-breaks-down-after-i-import-a-glb-model/56192
**Category:** Questions
**Tags:** cube-camera
**Created:** [September 20, 2023, 9:28am UTC](https://discourse.threejs.org/t/cubecamera-breaks-down-after-i-import-a-glb-model/56192 "2023-09-20T09:28:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jernej\_Ivancic](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jernej_ivancic/32/40158_2.png) [@Jernej\_Ivancic](https://discourse.threejs.org/u/Jernej_Ivancic)
#### Post date: [September 20, 2023, 9:28am UTC](https://discourse.threejs.org/t/cubecamera-breaks-down-after-i-import-a-glb-model/56192/1 "2023-09-20T09:28:09Z")

</div>

Im currenty working on a interior scene where create an interior from a floor plan, after its done loading I make a cube camera render of my scene and convert it to a equirectangular image.

When I add certain glb models the camera breaks with some sides being black and other not in the right place.  
Link to full post with pictures and code: [Post](https://stackoverflow.com/questions/77140675/3js-cube-camera-breaks-after-loading-glb-model)

Any help would be appreciated

---

<div class="post-metadata">

### Author: ![firstlaser](https://avatars.discourse-cdn.com/v4/letter/f/ebca7d/32.png) [@firstlaser](https://discourse.threejs.org/u/firstlaser)
#### Post date: [October 9, 2023, 10:30am UTC](https://discourse.threejs.org/t/cubecamera-breaks-down-after-i-import-a-glb-model/56192/2 "2023-10-09T10:30:52Z")

</div>

Same problem here with 157:

- EDIT 1 \* Problem got fixed for me after disabling “Y-UP” in Blenders GLTF Export and rotating the model in THREE.js instead.

- EDIT 2 \* There are still Problems when updating the cubeCamera with the rotated model, sometimes it works, sometimes not. ( cubeCamera is not updated every frame, only directly after loading the model,  
Error-result is the same as shown in screenshots )

Render scene without .glb import : fine  
Import the model, but dont add it to scene : fine  
Add model to scene : cubeCamera breaks  
After removing the model from scene and update cubeCamera : fine again.

Any Ideas what could cause the problem ? .glb is an export from blender

 ![01](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/f/a/fa52d15f6e050b615ee664c3d9c5208b801b9381.jpeg)

 ![02](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/f/6/f6e482f59a36990bd40d5ba470d261232c6c6642.jpeg)

---

<div class="post-metadata">

### Author: ![Jernej\_Ivancic](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jernej_ivancic/32/40158_2.png) [@Jernej\_Ivancic](https://discourse.threejs.org/u/Jernej_Ivancic)
#### Post date: [October 12, 2023, 8:22pm UTC](https://discourse.threejs.org/t/cubecamera-breaks-down-after-i-import-a-glb-model/56192/3 "2023-10-12T20:22:36Z")

</div>

After tinkering with the scene a bit, when loading more complex models or a lot of them that’s when the camera broke. Maybe it could be due to WebGL limitations in the browser, but I can’t say for sure.

Disabling Y-up didn’t help in my case tho.

---

<div class="post-metadata">

### Author: ![firstlaser](https://avatars.discourse-cdn.com/v4/letter/f/ebca7d/32.png) [@firstlaser](https://discourse.threejs.org/u/firstlaser)
#### Post date: [October 16, 2023, 1:55pm UTC](https://discourse.threejs.org/t/cubecamera-breaks-down-after-i-import-a-glb-model/56192/4 "2023-10-16T13:55:54Z")

</div>

So in my case I ended up with removing the rotated model from scene and immediatly add it again before then updating the cubeCamera.  
That somehow created a reliable result for me, I dont update the cubeCamera every frame tho.

---

<div class="post-metadata">

### Author: ![firstlaser](https://avatars.discourse-cdn.com/v4/letter/f/ebca7d/32.png) [@firstlaser](https://discourse.threejs.org/u/firstlaser)
#### Post date: [December 13, 2023, 11:54am UTC](https://discourse.threejs.org/t/cubecamera-breaks-down-after-i-import-a-glb-model/56192/5 "2023-12-13T11:54:22Z")

</div>

After having that problem again with a different .glb file, I did some testing.  
In my case the problem disappeared when I removed all opacity and transmission settings traversing the imported materials. When setting any material.opacity or material.transmission to anything different than 0, the problem appeared again…  
Did test with an y-up exported model from blender only.
