2012-11-27 120 views
2

有没有什么方法捕获在粒子系统中的鼠标点击?网和Paticle其工作正常,但如果我叫intersectObject上ParicleSystem的交叉长度始终为0Ray与粒子系统相交对象(捕获鼠标点击粒子系统)

vector = new THREE.Vector3(mouse.x, mouse.y, 0.5); 
projector.unprojectVector(vector, camera); 
ray.set(camera.position,vector.subSelf(camera.position).normalize()); 
intersects = ray.intersectObjects(particleSystem); 
console.log(intersects.length); 

继承人与互动颗粒为例:https://dl.dropbox.com/u/4253186/three/examples/webgl_interactive_particles.html ,但它不是三的最新版本。 JS。

回答

1

Ray.intersectObjects()在当前版本的three.js(r.53)中不支持ParticleSystem

所以答案是'不',除非你自己修改库。