I need assistance in finding the point where a ray cast from 'child' intersects with a mesh (child2) using Raycaster:
var raycaster = new THREE.Raycaster();
var meshList = [];
meshList.push(child2);
for (var i = 0; i < child.geometry.vertices.length; i++) {
var diff = new THREE.Vector3();
diff.subVectors(child.geometry.vertices[i], child2.position);
raycaster.set(child.geometry.vertices[i], diff.normalize());
var intersects = raycaster.intersectObjects(meshList);
console.log(intersects[0].point);
}
However, I encounter an error on the last line (console.log(intersects[0].distance)): "TypeError: undefined is not an object (evaluating 'intersects[0].point')".
Is there a way for me to retrieve the intersect point between the ray and the 'child2' mesh?