When I clone a mesh from another mesh and then translate and rotate it, I encounter an issue with ray-casting. The point seems to be intersecting with the original position before translation and rotation. Here is a snippet of the code:
const raycaster = THREE.Raycaster()
const clonedMesh = originalMesh.clone()
clonedMesh.translateX(1)
clonedMesh.translateY(1)
clonedMesh.translateZ(1)
const quaternion = new THREE.Quaternion(
-0.847,
-0.002,
-0.505,
0.168
)
clonedMesh.applyQuaternion(quaternion)
const point = new THREE.Vector3(1,1,1)
raycaster.set(point, new THREE.Vector3(1,1,1))
const intersects = raycaster.intersectObject(object) // It's still intersecting with the original position
Any guidance would be highly appreciated. Thank you!