please I tried to extrude selected face of the box Geometry could you someone help solve this issue
// Define the box geometry
const geometry = new THREE.BoxGeometry(10, 1, 10);
geometry.rotateX(-Math.PI * 0.5);
// Create a mesh using the geometry
const boxMesh = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial({
wireframe: true,
color: "red"
}));
scene.add(boxMesh);
const draggableObjects = [boxMesh.geometry.faces[0]];
const dragControls = new THREE.DragControls(draggableObjects, camera, renderer.domElement);
dragControls.addEventListener('drag', function (event) {
const face = event.object.geometry.faces[event.faceIndex];
const mouseDelta = event.delta;
// Extrude the face based on the mouse movement
const extrusionAmount = mouseDelta.length() * 0.01; // Adjust the extrusion amount as needed
face.translateOnAxis(face.normal, extrusionAmount);
});
thank in advance