来自 three.js 的 gltf loader 是否与 ie11 不兼容?

Is the gltf loader from three.js incompatible with ie11?

我一直在尝试使用加载程序在 three.js 场景中加载 gltf,但它在 ie11 上不起作用,而 it is said that it does on their web site. Also, the gltf loader examples don't work either(在 Internet Explorer 上)。谁能确认是这种情况,如果是,请更新有关加载程序的浏览器兼容性的信息?

编辑: 我已经尝试使用 ES6 Promises polyfill,就像我一个月前发布的 this question 中的示例一样。

GLTFLoader 与 IE11 兼容,但需要您 "polyfill" IE11 中缺少的某些功能。实际上,这意味着您必须包含一个添加 Promise 功能的脚本,而 IE11 默认情况下没有。

如果这不起作用,我建议在 three.js github 问题上提交问题,这可能是一个错误。

根据three.js docs, GLTFLoader: Browser compatibility

GLTFLoader relies on ES6 Promises, which are not supported in IE11.
To use the loader in IE11, you must include a polyfill providing a Promise replacement.

gltf 加载器与 IE11 不兼容,但可以通过 ES6 承诺的 polyfill 使其与 IE11 一起工作。

如果您的页面在导入 ES6 polyfill 后不显示 gltf 模型,您可能需要这样做:

GLTFLoader.js

中更改parse函数
var json = JSON.parse(content)

var json = eval('('+content+')')

对我有用。