When using a THREE.Raycaster to determine if a line will intersect with my ray, I am facing an issue where the intersectObject method is returning true even when compared with a parallel line. Could there be something wrong in my code?
var rc = new THREE.Raycaster(new THREE.Vector3(500,0,0), new THREE.Vector3(1,0,0), 0, 100);
var material = new THREE.LineBasicMaterial();
var spline = new THREE.SplineCurve3([
new THREE.Vector3(0,0,3),
new THREE.Vector3(1000,0,3)
]);
var geometry = new THREE.Geometry();
geometry.vertices = spline.getPoints(1);
var line = new THREE.Line(geometry, material);
if (rc.intersectObject(line)) {
var found = document.createElement('div');
found.innerHTML = 'detected intersection, but why?';
document.querySelector('body').appendChild(found);
}
The snippet above results in the message:
detected intersection, but why?