I have the following code that allows users to upload a CAD model:
window.readFile = function readFile(input) {
let file = input.files[0];
const reader = new FileReader();
reader.addEventListener( 'load', async function ( event ) {
const manager = new THREE.LoadingManager();
const loader = new ThreeMFLoader( manager );
object= loader.parse( event.target.result );
scene.add(object);
manager.onLoad = function () {
render();
};
renderer.render(scene, currentCamera)
}, false );
reader.readAsArrayBuffer( file );
}
}
However, the larger the files, the longer it takes for the model to be displayed in the scene. I don’t have any problem with longer load times, but sometimes it brings up the following pop up message:
The user then has to click “Wait” and the model will finally load after some time. In addition, during the waiting period for the model to load into the scene, the browser appears to be frozen, i.e. user can’t rotate camera around in scene or click any buttons.
How do I remove the “wait” pop up message and is there a way to prevent the browser from appearing to be frozen and provide a progress bar for uploading?