Here's the scenario: I have a local file where I attempt to load a texture using the following code:
var texture = THREE.ImageUtils.loadTexture( 'image.jpg' );
var cubeGeo = new THREE.CubeGeometry( 50, 50, 50 );
var cubeMat = new THREE.MeshBasicMaterial( { map: texture } );
var cube = new THREE.Mesh( cubeGeo, cubeMat );
scene.add( cube );
However, when I try to run this code on my computer, the image does not appear (the cube remains black). Strangely, when I move the entire folder to a server and access it from there, the image is displayed as expected.
My question is, why does the code work when the files are hosted on a server but not when they are stored locally on my computer? All necessary files have been copied over properly. I even tried using an absolute path but still no luck. Is there a specific setting that needs to be adjusted on my computer for this to work? I am currently running Windows 7 with Chrome version 32.0.1700.76 m and using THREE.js r64 without any additional libraries or plugins.