In three.js I want to create a road. I have this
var width = 5;
var length = 4;
var height = 1;
var geometry = new THREE.BoxGeometry( width, length, height );
var textureloader = new THREE.TextureLoader();
var texture = textureloader.load('images/tile_brick.png', function(tx) {
var material = new THREE.MeshBasicMaterial({
map: tx,
wireframe: false
});
var cube = new THREE.Mesh( geometry, material );
scene.add( cube );
});
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( width, length );
and it ends up looking like this
It repeats on x axis 5 times which is good, it repeats 4 times on y axis which is good, but for z axis it is also repeating 4 times which is bad because it is getting compressed, I want it to repeat 1 times there.
Does anyone know how to fix it?
Thanks