Javascript 使用Three.js对面进行光线投射

Javascript 使用Three.js对面进行光线投射,javascript,three.js,collision-detection,raycasting,Javascript,Three.js,Collision Detection,Raycasting,通过使用八叉树,我得到了一个接近对象的面数组。我怎样才能向他们施放射线。我只能找到如何将光线投射到网格、线或点?如果使用,请执行以下操作: // get the faces using octree search var octreeObjects = this.octree.search( raycaster.ray.origin, raycaster.ray.far, true, raycaster.ray.direction ); // find the intersections onl

通过使用八叉树,我得到了一个接近对象的面数组。我怎样才能向他们施放射线。我只能找到如何将光线投射到网格、线或点?

如果使用,请执行以下操作:

// get the faces using octree search
var octreeObjects = this.octree.search( raycaster.ray.origin, raycaster.ray.far, true, raycaster.ray.direction );
// find the intersections only with the faces you found
var intersections = raycaster.intersectOctreeObjects( octreeObjects );

你是在问如何使用八叉树吗?光线和人脸之间的交集测试是另一回事。我已经让八叉树工作了。我想知道的是,我是否可以单独对面进行光线投射,存储在数组中,或者我是否必须用它们创建网格。我想你需要改进这个问题。到目前为止你都试了些什么。据我所知,three.js提供了类和函数来测试三角形和光线的交点。我想你只要回答这个问题就行了。我可能可以使用光线和相交三角形:)