I am struggling to generate a list of intersections for an object using raycasting. Despite the ray intersecting the object, I keep receiving an empty array from intersectObjects(). Any assistance would be greatly appreciated. Please refer to the provided fiddle and code snippet below: https://jsfiddle.net/4dcfsvL6/
var rayStart = {
x: 1180.0475900351605,
y: 900.491932895052,
z: 50.01035975094526,
};
var rayEnd = {
x: 1162.0475900351605,
y: 930.491932895052,
z: 15.01035975094526,
};
const rayStartV = new THREE.Vector3(
rayStart.x - xMin - (xRange / 2),
rayStart.y - yMin - (yRange / 2),
rayStart.z - zMin - (zRange / 2),
);
const rayEndV = new THREE.Vector3(
rayEnd.x - xMin - (xRange / 2),
rayEnd.y - yMin - (yRange / 2),
rayEnd.z - zMin - (zRange / 2),
);
const directionV = new THREE.Vector3(
rayEnd.x - rayStart.x,
rayEnd.y - rayStart.y,
rayEnd.z - rayStart.z,
);
scene.updateMatrixWorld();
var raycaster = new THREE.Raycaster(rayStartV, directionV);
scene.add(new THREE.ArrowHelper(raycaster.ray.direction, raycaster.ray.origin, 300, 0xff0000) );
var intersects = raycaster.intersectObjects( [obj], true );
console.log(intersects)