Hi guys,
I’m new in three.js and im trying to solve this problem regarding plotting texture extruded part. Is there a way to merge all faces (illustrated on image above) of extruded region which was automatically generated when using extrudegeometry? I need to put a perfectly fit texture image from left to right of extruded region.
Thanks in advance.
code:
var shape = new THREE.Shape();
var width = 20;
var height = 20;
shape.moveTo(0, 0, 0);
shape.lineTo(width, 0, 0);
shape.quadraticCurveTo(width, height/5, width - width/5, height/5);
shape.lineTo(width/5, height/5, 0);
shape.quadraticCurveTo(0, height/5, 0, 0);
img[0].wrapS = img[0].wrapT = THREE.RepeatWrapping;
img[0].repeat.set(1/width, 1/height);
var extrudeSettings = { depth: width * 0.03, bevelEnabled: false };
var mushroomGeometry = new THREE.ExtrudeGeometry( shape, extrudeSettings );
mushroomGeometry.translate(-width/2, 0, 0);
var customShape = new THREE.Mesh(mushroomGeometry, [
new THREE.MeshBasicMaterial({ map: img[0] }),
new THREE.MeshBasicMaterial({ map: img[0] })
]);
scene.add(customShape);