# PixelFlow: Is it possible to have multiple attractors that work with selected particles?

**URL:** https://discourse.processing.org/t/pixelflow-is-it-possible-to-have-multiple-attractors-that-work-with-selected-particles/23553
**Category:** Libraries
**Created:** [August 29, 2020, 5:41pm UTC](https://discourse.processing.org/t/pixelflow-is-it-possible-to-have-multiple-attractors-that-work-with-selected-particles/23553 "2020-08-29T17:41:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jwo](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jwo](https://discourse.processing.org/u/jwo)
#### Post date: [August 29, 2020, 5:41pm UTC](https://discourse.processing.org/t/pixelflow-is-it-possible-to-have-multiple-attractors-that-work-with-selected-particles/23553/1 "2020-08-29T17:41:34Z")

</div>

I see that the excellent [pixelFlow](https://github.com/diwi/PixelFlow) library (which really deserves more attention) allows attractors to be created (see [FlowFieldParticles\_Attractors](https://github.com/diwi/PixelFlow/blob/master/examples/FlowFieldParticles/FlowFieldParticles_Attractors/FlowFieldParticles_Attractors.java)). These will attract all particles to them with an acceleration dependent on distance (which itself can be modified via the fragment shader.

My question: Is it possible to apply the attractor to only selected particles? What I would like to do is send different particles to different attractors even if the particles originate from the same location.

My intuition is that this should be possible somehow by giving each attractor a ‘colour’ in the offscreen buffer that matches the (hidden) ‘colours’ of selected particles. But not really sure if this is the right approach, or how to go about coding it.

Thanks very much.
