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
Asked
Active
Viewed 1.8k times
2 Answers
2
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

WestLangley
- 102,557
- 10
- 276
- 276
-
Sorry. The question is what file to pass to the loader? In the example they pass *.json, but none of the collada-to-gltf converters produce a json file. I'm getting files like *.gltf, *.bin and so on, but no json... – Hamabama Aug 19 '14 at 20:56
-
3Good question. There appear to be other issues: https://github.com/mrdoob/three.js/issues/5161 – WestLangley Aug 19 '14 at 21:35
-
At least as of r83-r84, the `.json` versions are outdated and not needed. You can use a `.gltf` file directly with THREE.GLTFLoader. – Don McCurdy Jun 12 '17 at 23:53
1
The gltf file is a valid json file as far as I understand it. I opened a file converted from collada to gltf and it is just plain json. I put it also through the validator at JSONLint. I would suggest to change the file ending from .gltf to .json .

jteichert
- 527
- 1
- 4
- 20
-
As of 2016, a `.gltf` file is still valid JSON, but it's not necessary to rename it. Simply use the `.gltf` file's URL as the input to THREE.GLTFLoader. – Don McCurdy Jun 12 '17 at 23:51
-