THREE.OBJMTLLoader进度监听器

时间:2014-08-15 19:53:08

标签: three.js

我可以将进度事件监听器添加到THREE.OBJMTLLoader吗?

我试过这个,但它没有用......

var callbackProgress = function( progress, result ) {}
var loader = new THREE.OBJMTLLoader();
loader.callbackProgress = callbackProgress;
loader.load(...);

1 个答案:

答案 0 :(得分:1)

除非签名已更改,否则应该有效:

loader = new THREE.OBJMTLLoader();
loader.load
(
    'thefile.obj',
    'thefile.mtl',
    function ( object )
    {
        // onload ...
        scene.add( object );
        animate();
    },
    function ( progress, result )
    {
        console.log (100 * progress.loaded / progress.total);
    }
);