I can’t seem to set the repeat on a texture…
const geometry = new THREE.BoxGeometry(10,20,20);
let cubeMat = new THREE.MeshBasicMaterial( {map: new THREE.TextureLoader().load('/materials/plaid3.jpg'),
side: THREE.DoubleSide, name: "cubeMat"});
cubeMat.wrapS = THREE.RepeatWrapping;
cubeMat.wrapT = THREE.RepeatWrapping;
const tileX = 4;
const tileY = 4;
cubeMat.repeat.set(tileX, tileY);
const cube = new THREE.Mesh( geometry, cubeMat );
scene.add( cube );
throws the error setTiling.html:38 Uncaught TypeError: Cannot read property ‘set’ of undefined
- at setTiling.html:38*
What am I missing? Many thanks.