I'm trying to load a texture but i keep getting this error no matter what i do:
Access to Image at '<file-path>/IMG/1.jpg' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
Here's the code i'm using to load the image:
var loader = new THREE.TextureLoader();
loader.crossOrigin = "";
var url = "IMG/1.jpg";
var materials = [
new THREE.MeshLambertMaterial({
map: loader.load(url)
}),
new THREE.MeshLambertMaterial({
map: loader.load(url)
}),
new THREE.MeshLambertMaterial({
map: loader.load(url)
}),
new THREE.MeshLambertMaterial({
map: loader.load(url)
}),
new THREE.MeshLambertMaterial({
map: loader.load(url)
}),
new THREE.MeshLambertMaterial({
map: loader.load(url)
}),
];