I took this particular road only to have a gui to draw in. This was an interactive musical project, where people equipped with a smartphone would trigger different sounds or events by visiting a city. The patch i've sent could be easily reduced to a single object taking the polygon's points coordinates and a position, only telling if the point is inside the polygon or not.

2017-04-20 12:53 GMT+02:00 patrice colet <colet.patrice@free.fr>:
 If it's about mouse binding in [gemwin], the math is really heavy, particulary if the camera is moving.

 It can be solved differently by rendering the polygons in an hidden frame or another gemwin, and set a different color for each new polygon, the binding will be about detecting color under mouse cursor with the help of [pix_snap] and [pix_data] and it will work even if the camera is moving.


Le 20/04/2017 à 12:26, baptiste chatel a écrit :
I think so for point in polygon, see attached. It's an old attempt of mine, with a mechanism to draw polygons in Gem and then tell in which polygon your mouse pointer is.

2017-04-20 9:13 GMT+02:00 Max <abonnements@revolwear.com <mailto:abonnements@revolwear.com>>:

    Did someone here solve this in Pd before?

    https://en.wikipedia.org/wiki/Point_in_polygon
    <https://en.wikipedia.org/wiki/Point_in_polygon>
    https://rosettacode.org/wiki/Ray-casting_algorithm
    <https://rosettacode.org/wiki/Ray-casting_algorithm>

    _______________________________________________
    Pd-list@lists.iem.at <mailto:Pd-list@lists.iem.at> mailing list
    UNSUBSCRIBE and account-management ->
    https://lists.puredata.info/listinfo/pd-list
    <https://lists.puredata.info/listinfo/pd-list>




_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list


_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list