问题描述
我决定在 Three.js 中尝试使用 gltf 格式来渲染模型,我正在使用这个转换器 (http://cesiumjs.org/convertmodel.html) 将模型从 Collada 转换为 GlTF.它吐出一个 *.gltf 文件,但是在 Three.js 的示例中,它们传递了一个 *.json 文件.如何加载 *.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
推荐答案
您可以使用 THREE.glTFLoader
,它可以在 examples/js/loaders 目录.
You can use THREE.glTFLoader
which can be found in the examples/js/loaders directory.
有关演示,请参阅 http://threejs.org/examples/webgl_loader_gltf.html.
three.js r.95
three.js r.95
这篇关于如何将 gltf 模型加载到 Three.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!