threejs-miniprogram
threejs-miniprogram copied to clipboard
Error: THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported. Use LegacyGLTFLoader instead.
克隆示例代码后运行报错,看似是glTF版本问题,有人碰到过吗?
Error: THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported. Use LegacyGLTFLoader instead.
at GLTFLoader.parse (VM34 gltf-loader.js:163)
at Object.onLoad (VM34 gltf-loader.js:86)
at a.<anonymous> (VM40 index.js:2)
at a.e.<computed> [as onload] (VM40 index.js:1)
at a._ (VM40 index.js:1)
at l (VM40 index.js:1)
at Function.o.<computed> (VM27 WAService.js:1)
at VM27 WAService.js:1
at E (VM27 WAService.js:1)
at i.<anonymous> (VM27 WAService.js:1)
我今天也碰到了,17号代码还能运行,今天21号突然报这个错,模型重新导出为gltf 2.0也不行,应该是FileLoader出错了
发现是因为升级了微信开发者工具后出现了这个报错,原来的版本1.03.2006090可以运行,升级到1.03.2009140后就出现这个报错了,但真机测试没问题
@ele828 麻烦看看这个问题,这边也遇到了这个问题
emm, è¯äºä¸ä¸æå¨wx.request
请æ±æ°æ®æ¯å¯ä»¥æ£å¸¸æ¿å°æ°æ®å¹¶ä¸parseï¼ä½æ¯éè¿loader.load
å
é¨è°ç¨çwx.request
æ¯è¿å空æ°æ®ï¼å¯è½æ¯exampleçwx.requestçæµç¨æé®é¢ï¼è¿é¨å就没ç»çäºï¼å è½½æ¯å è½½åºæ¥äºï¼è´´å¾å丢äº= =ã
wx.request({
url,
method: 'get',
header: {
// 'content-type': 'text/plain; charset=x-user-defined',
// 'accept-charset': 'x-user-defined'
},
responseType: 'arraybuffer',
success (res) {
console.log(resourcePath)
try {
scope.parse(res.data, resourcePath, function (gltf) {
onLoad(gltf);
}, _onError);
} catch (e) {
_onError(e);
}
},
fail (e) {
}
})
emm, è¯äºä¸ä¸æå¨
wx.request
请æ±æ°æ®æ¯å¯ä»¥æ£å¸¸æ¿å°æ°æ®å¹¶ä¸parseï¼ä½æ¯éè¿loader.load
å é¨è°ç¨çwx.request
æ¯è¿å空æ°æ®ï¼å¯è½æ¯exampleçwx.requestçæµç¨æé®é¢ï¼è¿é¨å就没ç»çäºï¼å è½½æ¯å è½½åºæ¥äºï¼è´´å¾å丢äº= =ãwx.request({ url, method: 'get', header: { // 'content-type': 'text/plain; charset=x-user-defined', // 'accept-charset': 'x-user-defined' }, responseType: 'arraybuffer', success (res) { console.log(resourcePath) try { scope.parse(res.data, resourcePath, function (gltf) { onLoad(gltf); }, _onError); } catch (e) { _onError(e); } }, fail (e) { } })
@yangger6 è´´å¾æåæä¹è§£å³çå¢
https://github.com/deepkolos/platformize 这个解决了
I'd really like to know what you were discussing here, as I'm perhaps facing a similar issue.