おそらく、10 単位のようにまっすぐ前方にあるポイントを取得し、それに最も近い粒子を取得する必要があります。
この投稿は、これを伝えるのに役立ちます。ところで、私はそれをすべて行ったことがあります。
Three.js プロジェクターと Ray オブジェクト
画面上のポイントをクリックして、そこからベクトルを取得します。
projector = new THREE.Projector();
// This is like clicking on the center of the screen, 0, 0 is center
straight_ahead = new THREE.Vector3(0,0,.5);
// Now we have straight_ahead relative to the camera
projector.unprojectVector(straight_ahead, camera);
// Now straight_ahead is just the direction of the camera, since we're taking away the camera's position from it
straight_ahead.sub(camera.position)
// It's a direction of where the camera is looking, so lets make it 10 units away( pick your own number)
straight_ahead.normalize().multiplyScalar(10)
// Now we we have a length of 10 units, we can get 10 units in front of the camera
straight_ahead.add(camera.position)
// At this point, straight ahead is a point in space 10 units in front of you, so lets find the closest point to that
// here's where you put a simple loop in
min_point = null
min_distance = 999999999
_.each( my_particles, function(particle) {
distance = particle.position.distanceTo(straight_ahead)
if (distance < min_distance) {
min_point = particle
min_distance = distance
}
});
// now you have min_point, which should be the closest point to 10 feet in front of your face