Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
Showing progress bar for loading CAD model in Three JS

I am currently using the following code to allow the user to upload their CAD model into the threejs canvas.

<input type="file" id="file-to-upload" onchange="readFile(this);">
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:

enter image description here

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.

I have been trying to remove the “wait” pop up message and prevent the browser from appearing to be frozen by including a progress bar using the code that I found here. However, the progress bar just goes from 0% directly to 100% once the model is in the scene so I think the progress bar is also frozen during the time it takes for the model to be uploaded. How can I remove the "wait" pop up message and show the user that the model is being uploaded in the progress bar?

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!