我正在尝试对使用BufferGeometry
. 但它似乎不支持光线投射?
BufferGeometry
如此处所示启动时,光线投射不适用于此对象。
但是当我BufferGeometry
用光线投射替换时Geometry
效果很好。
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);
我也试过换BufferGeometry
行Object3D
,不影响结果。如何对BufferGeometry
线进行光线投射?
编辑