Three.js and loading a cross-domain image

后端 未结 4 1590
梦谈多话
梦谈多话 2020-11-30 02:16

I know this has been asked before, and I\'ve read ever question and answer I\'ve been able to find, but nothing works.

I\'m running this on a local server (IIS). I\'

4条回答
  •  情书的邮戳
    2020-11-30 03:06

    A screencapture of the error

    VM266 three.min.js:127 THREE.WebGLState: DOMException: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The image element contains cross-origin data, and may not be loaded.
        at Object.texImage2D (https://unpkg.com/three@0.86.0/build/three.min.js:127:99)
        at dg.r [as setTexture2D] (https://unpkg.com/three@0.86.0/build/three.min.js:103:189)
    

    Just met the same issue while working on my codepen demo: https://codepen.io/fritx/project/editor/AoLRoy

    Solved by upgrading three.js from 0.86 to >=0.87

    - 
    + 
    

提交回复
热议问题