# GltfExport - flipped camera

**URL:** <https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986>\
**Category:** Bugs\
**Tags:** exporter, camera, gltf2export\
**Created:** [November 28, 2023, 9:11am UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986 "2023-11-28T09:11:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![MeshSlayer](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@MeshSlayer](https://forum.babylonjs.com/u/MeshSlayer)\
**Post date:** [November 28, 2023, 9:11am UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/1 "2023-11-28T09:11:42Z")

</div>

Hello community,

exporting the scene as glb flips the camera on Y axis

this was not the case in previous versions (I’m not sure which release caused this issue)

* * *

# UPDATE

after some investigation, the issue was born with BJS 6.0.0

* * *

 ![Screenshot 2023-11-28 at 10.04.29](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/6/26466e61b12f692e2c6df8d11f684f46215e0383.jpeg)  
 ![Screenshot 2023-11-28 at 10.04.37](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/6/46a1e15d7d85ad72d317c49401973e8dc5d75547.jpeg)

check this playground for more details:

> **[Babylon.js Playground](https://www.babylonjs-playground.com/#3A00GJ)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

---

<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:** [November 28, 2023, 10:35am UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/2 "2023-11-28T10:35:47Z")

</div>

I think it was a bug fix to respect the gltf default convention. Cc @bghgary to confirm

---

<div class="post-metadata">

**Author:** ![feuerstein](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/feuerstein/32/26127_2.png) [@feuerstein](https://forum.babylonjs.com/u/feuerstein)\
**Post date:** [November 28, 2023, 1:11pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/3 "2023-11-28T13:11:08Z")

</div>

Hi @sebavan , can you please point us to the specification that says so?  
cuz it kinda made the behaviour unpredictable. When we export a camera pointing at a scene, we expect it to stay pointing at the scene.  
thanks again for the snappy response 🙏

---

<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:** [November 28, 2023, 1:12pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/4 "2023-11-28T13:12:07Z")

</div>

You are not exporting the camera in the playground, you have a condition to not export it I believe ?

---

<div class="post-metadata">

**Author:** ![MeshSlayer](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@MeshSlayer](https://forum.babylonjs.com/u/MeshSlayer)\
**Post date:** [November 28, 2023, 1:12pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/5 "2023-11-28T13:12:57Z")

</div>

I have 2 camera in my scene, I’m just exporting one

---

<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:** [November 28, 2023, 10:51pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/6 "2023-11-28T22:51:07Z")

</div>

Agree in this case it looks like a bug.

---

<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:** [November 28, 2023, 10:51pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/7 "2023-11-28T22:51:24Z")

</div>



---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [November 29, 2023, 12:44am UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/8 "2023-11-29T00:44:21Z")

</div>

I can repro and will investigate. It definitely seems like a bug.

---

<div class="post-metadata">

**Author:** ![MeshSlayer](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@MeshSlayer](https://forum.babylonjs.com/u/MeshSlayer)\
**Post date:** [November 29, 2023, 6:36am UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/9 "2023-11-29T06:36:19Z")

</div>

Awesome !  
Looking forward for the fix 😁

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [November 29, 2023, 10:31pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/10 "2023-11-29T22:31:52Z")

</div>

Thanks for the report! The fix is in this PR: [Fix camera rotation when exporting glTF by bghgary · Pull Request #14562 · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/pull/14562)

---

<div class="post-metadata">

**Author:** ![MeshSlayer](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@MeshSlayer](https://forum.babylonjs.com/u/MeshSlayer)\
**Post date:** [November 30, 2023, 7:21am UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/11 "2023-11-30T07:21:58Z")

</div>

Awesome ! thanks a lot @bghgary

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [December 1, 2023, 4:53pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/12 "2023-12-01T16:53:59Z")

</div>



---

<div class="post-metadata">

**Author:** ![MeshSlayer](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@MeshSlayer](https://forum.babylonjs.com/u/MeshSlayer)\
**Post date:** [December 12, 2023, 9:18am UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/13 "2023-12-12T09:18:43Z")

</div>

Hey @bghgary

I noticed that the bug persists when the camera is animated, the fix you did will be overridden by the values stored in the animation.

here’s a playground that describes the issue

> **[Babylon.js Playground](https://www.babylonjs-playground.com/#3A00GJ%235)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

![Screen Recording 2023-12-12 at 10.14.50](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/8/1/817427bff701ce92196d53ae5c99487680a49f04.gif)

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [December 12, 2023, 2:48pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/14 "2023-12-12T14:48:22Z")

</div>



---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 8, 2024, 8:15pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/15 "2024-01-08T20:15:07Z")

</div>

Sorry for the long delay, but this issue is a problem in the method we decided to do with [this PR](https://github.com/BabylonJS/Babylon.js/pull/13909).

This other forum issue is also related to this PR: [Inconsistent glTF Exports Between Babylon 5 and Babylon 6 - Bugs - Babylon.js (babylonjs.com)](https://forum.babylonjs.com/t/inconsistent-gltf-exports-between-babylon-5-and-babylon-6/45216)

I am planning on rewriting a lot of the glTF serializer to address a lot of short-comings and fix all of these issues, but it will take a while to complete. Sorry for the troubles.

---

<div class="post-metadata">

**Author:** ![MeshSlayer](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@MeshSlayer](https://forum.babylonjs.com/u/MeshSlayer)\
**Post date:** [January 9, 2024, 8:00am UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/16 "2024-01-09T08:00:54Z")

</div>

no worries, thanks for the reply.

I also noticed a similar behaviour with animated objects. I had to wrap them under a transform node to patch the bug.

the exporter requires a lot of testing so we can avoid these issues. I’ll be happy to help if needed.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [October 7, 2024, 4:46pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/17 "2024-10-07T16:46:29Z")

</div>



---

<div class="post-metadata">

**Author:** ![srzerbetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/srzerbetto/32/20941_2.png) [@srzerbetto](https://forum.babylonjs.com/u/srzerbetto)\
**Post date:** [January 27, 2025, 4:28pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/18 "2025-01-27T16:28:53Z")

</div>

This should be fixed with the latest changes we did to the exporter lately. @MeshSlayer it should be fixed in version 7.45.0.

---

<div class="post-metadata">

**Author:** ![srzerbetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/srzerbetto/32/20941_2.png) [@srzerbetto](https://forum.babylonjs.com/u/srzerbetto)\
**Post date:** [January 27, 2025, 4:30pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/19 "2025-01-27T16:30:42Z")

</div>



---

<div class="post-metadata">

**Author:** ![MeshSlayer](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@MeshSlayer](https://forum.babylonjs.com/u/MeshSlayer)\
**Post date:** [January 27, 2025, 4:40pm UTC](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/20 "2025-01-27T16:40:51Z")

</div>

Awesome ! Thanks a lot @srzerbetto !

[Next page](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986.md?page=2)
