Despite following numerous tutorials, I am struggling to receive regular updates on the loading progress when loading a model in order to create a loading icon. No matter what method I try, the onProgress function only triggers once, and that's after the loading has already completed.
Here is my TypeScript loader code:
// Load manager
private manager = new THREE.LoadingManager();
// Set up loading manager (in constructor of class)
this.manager.onProgress = function ( item, loaded, total ) {
console.log( item, loaded, total );
};
// Load OBJ File from Server
private loadFile(path) {
let loader = new THREE.OBJLoader(this.manager)
loader.load(path, (obj)=>{
this.model = obj;
this.boundingBox = new THREE.BoxHelper(obj)
this.scene.add(this.model);
});
}
The log:
http://localhost:5000/api/file/largeModels/z3.obj 1 1
Currently, I only see one log message after the model finishes loading. How can I resolve this issue?