Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

221
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda