How to load a gltf model to Three.js?

Hamabama picture Hamabama · Aug 19, 2014 · Viewed 16.1k times · Source

I decided to try out gltf format for rendering models in Three.js and I'm using this converter (http://cesiumjs.org/convertmodel.html) to convert the model from Collada to GlTF. It spits out a *.gltf file, however in the examples in Three.js they pass a *.json file. How can I load the *.gltf file or how can I get the proper set of files to load? Thanks

Answer

WestLangley picture WestLangley · Aug 19, 2014

You can use THREE.glTFLoader which can be found in the examples/js/loaders directory.

For a demo, see http://threejs.org/examples/webgl_loader_gltf.html.

three.js r.95