deepkolos/platformize

使用图片加载不出来

Closed this issue · 4 comments

使用 TextureLoader 抱错
const textureLoader = new TextureLoader(); textureLoader.crossOrigin = "" const texture = await textureLoader.loadAsync( "https://cjwx.oss-cn-zhangjiakou.aliyuncs.com/123456/testvr.jpeg" // "https://s3.ax1x.com/2021/02/26/yx0quq.jpg" ); const geometry = new SphereBufferGeometry(500, 60, 40); geometry.scale(-1, 1, 1); const material = new MeshBasicMaterial({ map: texture, }); const mesh = new Mesh(geometry, material); scene.add(mesh);
图片链接:https://cjwx.oss-cn-zhangjiakou.aliyuncs.com/123456/testvr.jpeg
报错:(in promise) MiniProgramError
{"timeStamp":1649817196750,"composed":false,"cancelable":false,"bubbles":false,"isTrusted":true,"type":"error","target":{"scale":0,"referrerPolicy":null,"premultiplyAlpha":true,"complete":true,"naturalHeight":0,"naturalWidth":0,"height":0,"width":0,"src":"https://cjwx.oss-cn-zhangjiakou.aliyuncs.com/123456/testvr.jpeg","__id":6,"crossOrigin":""},"currentTarget":{"scale":0,"referrerPolicy":null,"premultiplyAlpha":true,"complete":true,"naturalHeight":0,"naturalWidth":0,"height":0,"width":0,"src":"https://cjwx.oss-cn-zhangjiakou.aliyuncs.com/123456/testvr.jpeg","__id":6,"crossOrigin":""}}
Event

使用官方的图片可以,使用阿里云的不行

是不是图片大小问题啊?我换了一下图片小的,就可以了,大的图片不行

是不是图片大小问题啊?我换了一下图片小的,就可以了,大的图片不行

图片不能超2048*2048 ,而且最好是2的幂次方

是的图片大小有限制, 更多主要点可以看这个文档的经验部分
https://github.com/deepkolos/platformize/blob/main/packages/platformize-three/README.md