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
Post a Comment