Currently, I have developed an application on app.domain.com and I am aiming to integrate images as textures from image1.domain.com, image2.domain.com, and so on.
Here is the code snippet I am currently using:
var texture = new THREE.Texture();
var image = new Image();
image.crossOrigin = 'anonymous';
image.onload = function() {
texture.image = image;
texture.needsUpdate = true;
texture.minFilter = THREE.LinearFilter;
};
image.src = url;
Despite setting
Access-Control-Allow-Origin:app.domain.com
in the image response header, I am encountering the following error message:
three.js?201606101337:30942 DOMException: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at url may not be loaded.