Why does not the texture three.js: loader.addEventListener('load',function(event){?

var cub_texture,loader;

 cub_texture= new THREE.Texture();
 loader= new THREE.ImageLoader();


loader.addEventListener('load',function(event){
cub_texture.image=event.content;
cub_texture.needsUpdate=true;
});

loader.load('./img/textBox.jpg');

 var cub_material = new THREE.MeshBasicMaterial({map:cub_texture,overdraw:true});

linewire.ru/t/TreeTest20clsess
How to do it properly?

loader.load("./img/textBox.jpg",function(event){
cub_texture.image=event.content;
cub_texture.needsUpdate=true;
 });


Tried so,but also doesn't work.
July 8th 19 at 16:41
2 answers
July 8th 19 at 16:43
Solution
var cube_geometry = new THREE.CubeGeometry(100, 100, 100);
 cube_two_texture = new THREE.TextureLoader().load( 'img.jpg' );//load texture
 var cube_two_material = new THREE.MeshBasicMaterial({map: cube_two_texture});
 var cube_two = new THREE.Mesh(cube_geometry, cube_two_material);
 cube_two.position.y = -200;
 scene.add(cube_two);


Here's how.

the princes above it is out of date.
July 8th 19 at 16:45
Even stumbled upon trouble - not loaded in chrome locally, uploaded to a server, works!
so it is normal,the local server postavite gulp and running - Rudy.Williamson commented on July 8th 19 at 16:48

Find more questions by tags three.jsJavaScript3DWebGL