I am facing an issue with raycasting on a line created using BufferGeometry
. It seems that raycasting is not supported in this case.
Upon initializing BufferGeometry
as demonstrated here, the raycasting functionality does not seem to work on the object.
Interestingly, when I switch from BufferGeometry
to Geometry
, raycasting works perfectly fine.
var geometry = new THREE.Geometry();
var lines = new THREE.Object3D();
for ( var i = 0; i <array.length; i++) {
x = ( Math.random() - 0.5 ) * 30;
y = ( Math.random() - 0.5 ) * 30;
z = ( Math.random() - 0.5 ) * 30;
geometry.vertices.push(new THREE.Vector3(x,y,z));
}
var line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: 0x9999FF, opacity: 0.5 } ) );
lines.add(line);
scene.add(lines);
I have attempted wrapping BufferGeometry
within Object3D
, but it did not change the outcome. How can I enable raycasting against a BufferGeometry
line?
EDIT