0

I have an app that uses a Three.js ParticleSystem to render on the order of 50,000 points. I have spent a lot of time searching for efficient ways to do picking (ray-casting) so as to be able to interact with individual points but have not found a good solution. I am considering changing to just using an array of Particles instead of ParticleSystems.

My questions are:

  1. Am I missing something; is there a good way to do picking with the ParticleSystem?
  2. Will I suffer a performance hit using an array of Particles instead of the ParticleSystem, especially since I am taking advantage of the ability to pass several arrays of attributes into the shader.

Thanks for any insight anyone can provide!

gman
  • 83,286
  • 25
  • 191
  • 301
  • On the three.js `dev` branch see http://github.com/mrdoob/three.js/blob/dev/examples/webgl_interactive_raycasting_pointcloud.html. – WestLangley Jul 04 '14 at 04:06

1 Answers1

0

You're checking 50,000 points every time. That's a bit too much.

You may want to split those points into different ParticleSystems... Like 10 objects with 5000 particles each.

Ideally each object would compose a different "quadrant" so the Raycaster can check the boundingSphere first and ignore all those points if not intersecting.

mrdoob
  • 18,129
  • 3
  • 56
  • 59