I am trying to create an animation in three.js
with two scenes running at the same time. The first one has a fixed texture, which works as the background for the page, while the second one has a rotating cube. This is the part of the code where I am getting the issue:
THREE.ImageUtils.crossOrigin = '';
var texture = THREE.ImageUtils.loadTexture('https://i.imgur.com/eoWNz.jpg');
var backgroundMesh = new THREE.Mesh(
new THREE.PlaneGeometry(2, 2, 0),
new THREE.MeshBasicMaterial({
map: texture
}));
I tried to follow this example and this question to solve the issue with the security concerning cross-origin images by using a simple http server
with python
, but still the background remains black.
Do you by any chance have an idea of what am I doing wrong? This is the fiddle with the complete code.
Thanks in advance for your replies!
EDIT:
Locally I get this error: THREE.Material: 'map' parameter is undefined.
in three.min.js:428