Spreads 2D compare

Hey folks,

im new to vvvv and i simply dont get spreads and wanted to ask if someone is able to help here.

The attached patch includes an example which illustrates my problem.

it contains:
a spread of 2D vectors representing interactive objects…
a spread of 2D vectors representing persons|cursors who all have different colors and are supposed to interact with these objects…

now i want to check for each object (vector) which of the persons (vector) is the closest and then make this object color the way this person is colored…

in code it would be a 2d loop…for each object - check each person and update lowest distance…

from my little understanding i need to resample (repeat?) the 2d vectors of the persons to the number of the objects and then compare…and then resample sorted? Or …nooo i actually dont know…if someone could help out or show me an instructional that works here…then please point me in the right direction.

Thank you very much for taking the time to read — thank you…

mio

Persons_Objects_Spreads.v4p (8.7 kB)

I would do something like this.

Persons_Objects_Spreads2.v4p (21.5 kB)

you still need to decide what happens when two persons share the same closest object and if two objects are at the same distance to one person

OUUU thank you!!!..i still have to use your patch for training cause it seems really hard for me to think into spreads - but this one clarified a lot!!!

Thanks for taking the time and help a newB out!!!

One thing to keep in mind, if you have more visitors than objects, it doesn’t work anymore. (hint: a MAX to figure out if Objects or Visitors are most)

Have a look at SiftNearmost (2d)

and of course NearestNeighbour (2d)

Wow thx for the input…

@Westbam…i play around with it thank you…

@bjoern …Nearestneighbour sounds perfect :)