2

I have doing some research on three.js to display 3D model on webpage and I succeeded. However, the load time (preprocessing time) is pretty slow as you can see from here the load time is 11+ seconds and my file size is 69.5MB; during that moment I also cannot do other action on webpage like click the button, write something on textbox or etc. I tried to search for the solutions to reduce the load time but most solutions are reduce my file size but the resolution will be reduced too.

So my questions are:

  1. How to reduce the load time (preprocessing time) without reducing file size?
  2. How to load models asynchronously so that i can do other action on the webpage?

Thank you.

  • Are you using the `THREE.STLLoader` loader? – TheJim01 May 18 '17 at 14:47
  • @justin-ling Perfect timing: see https://github.com/mrdoob/three.js/pull/11355. Requires the dev version of `STLLoader` – WestLangley May 18 '17 at 15:47
  • Sorry for the late reply. @TheJim01 yes, I am using STLLoader. – Justin Ling May 23 '17 at 03:26
  • @WestLangley I tried, but didn't show much faster. T^T It did faster by 1sec – Justin Ling May 23 '17 at 03:48
  • 2
    @JustinLing Check the three.js examples that use workers, such as [this example](https://threejs.org/examples/webgl_loader_ctm.html) and [this example](https://threejs.org/examples/webgl_loader_obj2_ww_parallels.html). – WestLangley May 23 '17 at 05:55
  • Seconding WestLangley's suggestion. I've used [Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) to process files, and while you may not see much of a time difference, it will free the main thread, which will make your UI responsive while the file is processed. Also look into using [Transferrable](https://developer.mozilla.org/en-US/docs/Web/API/Transferable) objects to help keep memory consumption down. – TheJim01 May 23 '17 at 13:34

0 Answers0