Hello,
I’ve got problems with gltf loader. I have a problems with loading local glb file. I’m using angular.
I am using this sample code:
import * as THREE from 'three';
import GLTFLoader from 'three-gltf-loader';
const loader = new GLTFLoader();
loader.load(
'path/to/your/file.gltf',
( gltf ) => {
// called when the resource is loaded
scene.add( gltf.scene );
},
( xhr ) => {
// called while loading is progressing
console.log( `${( xhr.loaded / xhr.total * 100 )}% loaded` );
},
( error ) => {
// called when loading has errors
console.error( 'An error happened', error );
},
);
when I use path like https://rawcdn.githack.com/mrdoob/three.js/7249d12dac2907dac95d36227d62c5415af51845/examples/models/gltf/Flamingo.glb
It is working without any problems.
But when I download this file and put it into /src/Flamingo.glb then I use url like: ‘http://localhost:4200/flamingo.glb’ or './Flamingo.glb it doesn’t work.
In console there is an error: GET http://localhost:4200/flamingo.glb 404 (Not Found)
I have no idea what could be wrong
Thanks in advance