Cross-origin image load denied with three.js in chrome

前端 未结 7 2006
情深已故
情深已故 2020-12-06 05:05

Trying to add material in THREE.js like this

var materialWall = new materialClass( { color: 0xffffff, map: THREE.ImageUtils.loadTexture( \'image         


        
7条回答
  •  长情又很酷
    2020-12-06 05:19

    1) Chrome shortcut -> Properties -> Shortcut tab -> target and add --allow-file-access-from-files in target at last. (kill all the chrome tasks before doing this.)

    OR

    2) Download Mongoose web server software. Put it in your working directory, and run it. It will open in the browser http://localhost:PORT where it will serve all your files.

    OR

    3) You can also use NodeJS server in your application.

提交回复
热议问题