if i use the geometry.center() it affect the look.at property
this is my below code :
if (shapeType === AvailableShapes.Cuboid) {
const targetPosition = new THREE.Vector3();
const hitObject = this.faceIdentifierSrv.objectHit;
hitObject.getWorldPosition(targetPosition);
this.generatedShape.lookAt(targetPosition);
const orientation = hitObject.userData[Object3DUserData.orientationData];
const isValidOrientation = validOrientations.some((validOrientation) => {
return validOrientation.every((face, index) => orientation[index] === face);
});
if (isValidOrientation) {
this.generatedShape.rotateZ(-Math.PI / 2);
}
const offsetVector = new THREE.Vector3().subVectors(this.generatedShape.position, targetPosition).normalize().multiplyScalar(10);
this.generatedShape.position.add(offsetVector);
}
how can i handle this i still need the lookat property for every flip the cuboid will come perpendicular to the right triangle shape hypotenuse face