在three.js中,我似乎无法与这样构建的拉伸网格相交:
// intersections is an array of Vector3
var curve = new THREE.CatmullRomCurve3(intersections);
var extrudeSettings = {
steps: someLength,
bevelEnabled: false,
extrudePath: curve
};
var geometry = new THREE.ExtrudeGeometry( pencil, extrudeSettings );
geometry.computeFaceNormals();
var color = new THREE.Color("rgb(0, 0, 0)");
var material = new THREE.MeshBasicMaterial( { color: color } );
var mesh = new THREE.Mesh( geometry, material ) ;
scene.add( mesh );
和光线投射看起来像这样:
m1.x = (p.x) / $(webGLelement).width() * 2 - 1;
m1.y = 1 - (p.y) / $(webGLelement).height() * 2;
raycaster.setFromCamera( m1, camera );
var intersects = raycaster.intersectObjects( scene.children, true );
场景中的所有其他网格似乎都可以正常工作:相交了其他网格,我检查了屏幕坐标到单面水平的3D坐标的转换。
我还试图将拉伸的网格扩大(30倍),看看情况是否会改变,但没有区别。
我在这里想念什么?