When attempting to utilize a local image for loadTexture in Three.js, I encountered the following error: Uncaught SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at .... may not be loaded.
My situation involves a java application running on apache tomcat (locally) which serves my image with the URL: http://localhost:8084/sve/img/wood-texture.jpg.
The javascript code I am using in an attempt to load the image is as follows:
var woodTexture = new THREE.ImageUtils.loadTexture('http://localhost:8084/sve/img/wood-texture.jpg');
I am using Google Chrome (Version 40.0.2214.111 m) to run my Three.js program. I even tried launching Chrome with the command: chrome.exe --allow-file-access-from-files. However, the error persists.
Is there anyone who has a solution for this issue?