three.js gif image loader on before model load

别等时光非礼了梦想. 提交于 2020-01-17 02:48:19

问题


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:


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.



来源:https://stackoverflow.com/questions/25256319/three-js-gif-image-loader-on-before-model-load

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!