threejs-miniprogram icon indicating copy to clipboard operation
threejs-miniprogram copied to clipboard

Error: THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported. Use LegacyGLTFLoader instead.

Open tjeeay opened this issue 4 years ago • 7 comments

克隆示例代码后运行报错,看似是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)

image

tjeeay avatar Sep 21 '20 07:09 tjeeay

我今天也碰到了,17号代码还能运行,今天21号突然报这个错,模型重新导出为gltf 2.0也不行,应该是FileLoader出错了

微信截图_20200921181732

okdin avatar Sep 21 '20 10:09 okdin

发现是因为升级了微信开发者工具后出现了这个报错,原来的版本1.03.2006090可以运行,升级到1.03.2009140后就出现这个报错了,但真机测试没问题

okdin avatar Sep 21 '20 16:09 okdin

@ele828 麻烦看看这个问题,这边也遇到了这个问题

yangger6 avatar Jan 28 '21 03:01 yangger6

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 avatar Jan 28 '21 06:01 yangger6

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 贴图最后怎么解决的呢

SunXinFei avatar Dec 18 '21 12:12 SunXinFei

https://github.com/deepkolos/platformize 这个解决了

deepkolos avatar Feb 07 '22 12:02 deepkolos

I'd really like to know what you were discussing here, as I'm perhaps facing a similar issue.

designbyadrian avatar Jun 08 '23 08:06 designbyadrian