0

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?

Jothi Kannan
  • 3,320
  • 6
  • 40
  • 77

1 Answers1

1

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.

2pha
  • 9,798
  • 2
  • 29
  • 43
  • ? Is it working? The LoadingManager class works as it should. It is not designed to show progress of individual files. – 2pha Aug 12 '14 at 05:37
  • Not working, it doesn't call while we attach it with the loader – Jothi Kannan Aug 12 '14 at 06:04
  • That is what I am saying. It does not work the way you seem to be expecting. It does not show progress of individual files, it shows the progress of a group of multiple files. I am not sure how I can explain this any clearer. – 2pha Aug 12 '14 at 12:54
  • ok, i got it, `LoadingManager` is not works with the `OBJMTLLoader`, it is working with `AssimpJSONLoader` – Jothi Kannan Aug 12 '14 at 13:08