Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

225
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda