Distance mesuring between two blobs
Hey everyone,
I'm new to Max and I'm building a kind of a tracking software. The patch should measure the distance between two blobs (centroids). In the screenshot below you will see what I created so far. This is a screenshot of a subpatch. Here we're trying, by using the jit.spill node, to get all the x and y values. Now the problem is that in the first messagebox contains all the x values and the second message box all the y values (the third messagebox deliveres the area values which are not needed for distance measuring). We now need to combine these first 2 messageboxes so we get a float/int node where the values are formatted like "x1, y1, x2, y2" like in the message box above the "expr" formula, so we can then do the distance calculation.
Can anyone please help us to achieve the wanted result? This is for a university project and we're all no pros in Max.
Thank you very much in advance,
David

Hi, you'll need to learn to use the most important Max objects, like [t] and [pack], [unpack], etc. Go through some tutorials. Look if that fits your needs (note that I use a multiplication instead of the more expensive pow function.)
Also, learn to use the Copy Compressed function (Edit menu), then paste in your forum message.
Best.
Hey Jean-Francois, thank you very much for your answer, it was very helpful! But we got a lil problem, because we have around 50 x and 50 y values, so we got 50 blobs and we want to measure the distance from every blob to every blob all the time. So the optimal result would be a messagebox with many distance values from where we can go further into our sound generator (plays a sound if a value is higher or lower a certain number). Help would be very much apreciated! Thanks in advance. Also see the maxpatch below (now correctly exported to clipboard).
Maybe the zl objects will help. Specifically zl.lace and zl.delace. vexpr will likely come in handy, too.