I want to add a texture to my plane that repeats horizontal and vertical. The thing is, when I try to apply the texture, it is always black. I don\'t get any errors, and i a
TextureLoader.load()
is an asynchronous method. That is why it has an onload
argument.
You are calling render()
before the texture loads. One solution is to call render()
in the loader callback.
var loader = new THREE.TextureLoader();
var texture = loader.load( 'myTexture.jpg', function ( texture ) {
renderer.render( scene, camera );
} );
Another solution is to have an animation loop. But that is not required for static scenes.
three.js r.78