below is the code (scene.gltf is in my public folder):
//importing stone with GLTFLoader
// Instantiate a loader
var loader = new GLTFLoader();
// Load a glTF resource
// resource URL
// called when the resource is loaded
// called while loading is progressing
console.log((xhr.loaded / xhr.total) * 100 + "% loaded");
// called when loading has errors
console.log("An error happened");
hey! i just uploaded the sandbox! i still can’t figure out what the problem is…
(i just added the gltf file in the stone folder in sandbox because sandbox won’t allow me to upload the texture and bin file!)
that will create one single glb with all textures inclued. upload this into the public folder.
also: new GLTFLoader().load("/scene.glb", gltf =>
you then don’t need to set a path.
some other things that you need to know when you work with codesandbox: switch off loop protection (create a sandbox config file for that), otherwise you won’t be able to load bigger models. you will also not be able to use draco, because threejs/examples/jsm is not compatible with commonjs environments (which csb is). that the gltfloader works is a happy accident.