GltfExport - flipped camera

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



check this playground for more details:

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

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 :pray:

1 Like

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

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

Agree in this case it looks like a bug.

2 Likes

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

2 Likes

Awesome !
Looking forward for the fix :grin:

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)

3 Likes

Awesome ! thanks a lot @bghgary

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

Screen Recording 2023-12-12 at 10.14.50

Sorry for the long delay, but this issue is a problem in the method we decided to do with this PR.

This other forum issue is also related to this PR: Inconsistent glTF Exports Between Babylon 5 and Babylon 6 - Bugs - Babylon.js (babylonjs.com)

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.

1 Like

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.