GLTF model works in sandbox but does not work in my scene

Hello to everyone.

I have a gltf model. This gltf looks flawless in Babylonjs’s Sandbox.

But when I create a scene as mentioned in babylonjs documents, this gltf does not appear on my scene. Loading gltf successfully but the scene seems completely empty. I walked around with the camera, but I couldn’t see anything. There is no error. Is there a setting or something I missed?

I have developed many babylonjs projects before. It was the first time that I encountered such a thing.

You can find images on the subject below.

This is in sandbox:

And this one in my scene:

Not: Here my basic code.

A few things to check:

  1. Are you loading the loaders package? did you import the gltf loader?
  2. Does your local (i assume) server supports CORS? is there any bad request in the network tab? Or is the model being downloaded correctly?

I checked. Here basic one html. loaders.min.js enough or we have new one? :flushed:

I ran it on my own scene with other gltf files. There was no problem.

not sure what you mean by that, but there must be something that is not working.

want to share the scene? the model? Is the model being downloaded correctly? loaded correctly? can you debug this?

It might be that the model is not centered at 0 0 0 or the boundaries are to thin/big ???

exactly that. The model is not centered and is huge. The sandbox is framing it, so you can see it. My suggestion was to center the model and make sure its size fits the scene

1 Like

What happens when you try createDefaultCameraOrLight and createDefaultEnvironment as in https://www.babylonjs-playground.com/#K7TJIG#1. If this works for you, you can read camera, etc. values from the inspector.

API Scene - Babylon.js Documentation, for parameters