I would like to ask you if you know how to repeat texture using THREE.TextureLoader(). I've found solutions just for using THREE.ImageUtils.loadTexture(). Here is part of my code:
var loader = new THREE.TextureLoader();
var wall;
loader.load('../images/concreteWall.jpg', function (texture) {
var wallMaterial = new THREE.MeshBasicMaterial({
map: texture
});
wall = new THREE.Mesh(sideWallsGeometry, wallMaterial);
scene.add(wall);
}
);
Here is the pattern to follow if you want to repeat a texture:
var loader = new THREE.TextureLoader();
var texture = loader.load( 'path.jpg', function ( texture ) {
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.offset.set( 0, 0 );
texture.repeat.set( 1, 1 );
// your code
} );
three.js r.84
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With