2

有什么方法可以在 ParticleSystem 中捕获鼠标点击?使用 Mesh 和 Paticle 可以正常工作,但是如果我在 ParicleSystem 上调用 intersectObject,则相交长度始终为 0。

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 但它不适用于最新版本的three.js。

4

1 回答 1

1

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

所以答案是“不”,除非您自己修改库。

于 2012-11-27T15:30:11.897 回答