Sandbox Camera Orientation

I like using the Sandbox (https://sandbox.babylonjs.com/) to check on 3d models I plan to use in my projects but noticed that the orientation of the camera tends to be different than what I have in my code. It looks like in the Sandbox the orientation along the Y-axis is reversed. When I bring it into the Sandbox, for example, it would be facing the camera, but when I bring it into my code, the same model(s) are facing in the opposite direction.

I’m not rotating my camera or using the “setTarget” or anything on the camera that would affect it’s orientation so I’m left thinking that the camera in the Sandbox is rotated in some way. Is this the case? If so is there a way to disable the rotation? It’s really helpful to see how the 3d models would look like using the Sandbox.

Could you share a specific model where you see this behavior? If we can repro it then we can look into fixing it.

If I compare our boombox model in a simple playground and in the sandbox, the orientation appears to be the same:
glTF Loader Demo | Babylon.js Playground (babylonjs.com)
Babylon.js - BoomBox.gltf (babylonjs.com)

Here is the playground: Babylon.js Playground

I believe the “default camera” feature might be doing the same thing as the Sandbox camera. So I tried to replicate what I had in my own code and I’m getting the same thing in the playground as my code.

Here is what I see in the Sandbox:

It looks the same in Blender:

I don’t believe this is a bug, I just want to know why there’s a difference. I’m fairly certain the camera being used in the Sandbox automatically snaps to look at the imported mesh and/or it’s being rotated to look in the opposite direction.

Hi!
The Sandbox uses the camera’s framing behavior to lock on the mesh.

2 Likes

Thank you, I figured it was something like that I just didn’t know what it was. Good to know about that feature too, I always wondered how to get the camera to focus in on a mesh object without being too close or far from it. Marked as solved!

1 Like