简体   繁体   中英

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

I have been trying to load gltf in three.js scenes using the loader but it doesn't work on ie11 whereas it is said that it does on their web site . Also, the gltf loader examples don't work either (on internet explorer). Can anybody confirm that this is the case and, if so, please update the information about the browser compatibility of the loader?

EDIT: I have already tried using ES6 Promises polyfill as in my example in this question I posted a month ago.

GLTFLoader is compatible with IE11, but requires that you "polyfill" certain features that are missing in IE11. In practice, that means you must include a script that adds the Promise feature, which IE11 does not have by default.

If that isn't working, I would suggest filing an issue on the three.js github issues, it may be a bug.

According to 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 loader is incompatible with IE11, but it's possible to to make it work with IE11 with polyfills for ES6 promises.

if your page doesn't show the gltf models after import ES6 polyfill,you may need to do this:

change the parse function in GLTFLoader.js

var json = JSON.parse(content)

to

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

it works for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM