Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load a gltf model to Three.js?

Tags:

three.js

gltf

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

like image 817
Hamabama Avatar asked Aug 19 '14 19:08

Hamabama


1 Answers

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

like image 72
WestLangley Avatar answered Sep 25 '22 18:09

WestLangley