three.js OBJLoader and precompressed gzip obj not loading -


this may unsupported library. wondering if has come across this. have tried loading obj , there no problem. if pre-compress gzip format not load , callback never called. nice gzip obj files since compression.

there's nothing special in code.

var loader = new three.objloader(manager); loader.load(meshurl, function (sceneobject) {     sceneobject.traverse(function (child) {         if (child instanceof three.mesh) {             child.material = material;         }     }); }, onprogress, onerror); 

update

meshurl if pointing external url uncompressed obj file, loads normal. onprogressed called , behaves you'd expect. if pointing pre-compressed gzip version of same obj, onprogress method called progress.total 0 caused code funk out.

fixed, handle progress better

hate answer own question turns out onprogress still being called total value being 0 if content gzipped. solution store total elsewhere, in case db loads referenced url , calc percentage loaded way. plus progress parameter has lengthcomputable boolean.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -