Frank Galligan a282c3ed5b Optimize three.js rendering and other small fixes.
1. Optimize loading of mesh data into three.js in Chrome.
2. Small refactoring of our traversal encoding code.
2017-02-16 17:27:56 -08:00
..
2016-12-12 16:39:06 -08:00
2016-12-12 16:39:06 -08:00

The code shows a simple example of integration of threejs and draco javascript
decoder. From the example, you should be able to loading an encoded draco mesh
file and visualize it through threejs's fancy 3D tools.

How to run the example code:

(1) Create your working directory, e.g. draco_example/.

(2) Download the latest three.js file from:
https://github.com/mrdoob/three.js/blob/dev/build/three.js
You could clone the repository and copy three.js from build/ to your
working directory.

(3) Copy DRACOLoader.js and webgl_loader_draco.html from
draco/javascript/example to your working directory. Copy draco_decoder.js
from draco/javascript to your working directory.

(4) From your working directory, start a local http server.
E.g, with Python, you could run "python -m SimpleHTTPServer".

(5) Load webgl_loader_draco.html. You should be able to see an empty scene
rendered by threejs.

(6) Click "Choose File" to select a draco encoded file (.drc) and you should be
able to see the model. e.g. bunny.drc. This is model encoded using Draco
default compression. The original ply is located here "testdata/bun_zipper.ply".