通过使用八叉树,我得到一个靠近物体的面数组。我怎样才能射线投射到他们身上。我只能找到如何射线投射到网格,线或点?
答案 0 :(得分:1)
如果您使用的是threeoctree,请执行以下操作:
// 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 );