I'm having trouble loading a texture in my JavaScript program using Three.js. Everything seems to be working fine with rendering a few objects, but as soon as I add the following code:
var grzybSkin = THREE.ImageUtils.loadTexture('grzybuv.png');
grzybSkin.repeat.set( 1,1);
grzybSkin.wrapS = THREE.RepeatWrapping;
grzybSkin.wrapT = THREE.RepeatWrapping;
grzybSkin.anisotropy = 16;
var texturaGrztb = new THREE.MeshBasicMaterial({map: grzybSkin});
var geometry_grzyb;
var loader = new THREE.JSONLoader();
loader.load( "grzyb.js", function( geometry_grzyb ) {
for (var i = 0;i < 4;i++)
{
grzyb[i] = new THREE.Mesh( geometry_grzyb, texturaGrztb );
grzyb[i].scale.set( 15, 18, 1);
scene.add( grzyb[i] );
grzyb[i].position.set(
5000,
5000,
5000
);
}
});
An error message pops up:
NS_ERROR_DOM_BAD_URI: Access to restricted URI denied
And it's pointing to a line in the Three.js library:
xhr.open( "GET", url, true );
xhr.withCredentials = this.withCredentials;
xhr.send( null );