0
votes

How to show a gif image loader to indicate the status of the model on before load the 3d models using OBJMTLLoader orAssimpJSONLoader ? am using three.js version 67 and am using below code load the gif loader, but the function doesn't have any effect while load the model

var loadManager = new THREE.LoadingManager();
    loadManager.onProgress = function ( item, loaded, total ) {
        alert('hi');
        console.log( item, loaded, total );
    };

 var objloader = new THREE.OBJMTLLoader(loadManager);

what am doing wrong here, am missing anything?

1

1 Answers

1
votes

Having a quick read of the LoadingManager docs it seems that the class does not show progress of a single loader, but it shows the progress of many.
So if you send the loading manager 4 loaders, the onProgress event would fire 4 times with the 'loaded' variable being 1, 2, 3 and 4.