如何将 gltf 模型加载到 Three.js? [英] How to load a gltf model to Three.js?

查看:77
本文介绍了如何将 gltf 模型加载到 Three.js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我决定在 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆