mrdoob/three.js — Issue #944: about the use of texture
Author: avicha
Created: 2011-12-21 06:51:28+00:00
State: open

It is recently that I started learning THREE.js,now I came across,a question.I created a plane,and I want the plane was covered with an image as the texture.The code as follows:

//The size of the plane is 2200*1800
var plane=new THREE.PlaneGeometry( 2200, 1800, 100, 100 );

//The size of the image "shadow.png" is 128*128
var material=new THREE.MeshPhongMaterial( { color:0xFF0000 ,map:THREE.ImageUtils.loadTexture("shadow.png")} )

mesh = new THREE.Mesh( plane, material);

mesh.position.y = - 100;

mesh.rotation.x = - 90 * Math.PI / 180;

scene.add( mesh );

But after the code runs,the plane doesn't appear,because it said "Uncaught Error: SECURITY_ERR: DOM Exception 18".
If I remove the map attribute,it can run normally.So how to do this with the texture to cover with the plane??Can somebody get me an example?Should I do something else to set up the attributes to let it run success??