gil_mouseover_polygon3.pd 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #N canvas 326 76 832 567 10;
  2. #X obj 38 136 t l l;
  3. #X obj 38 463 outlet cursor-list;
  4. #X obj 38 105 inlet cursor-list;
  5. #X text 403 68 (c)2011 Marian Weger /part of GIL/;
  6. #X obj 405 12 cnv 15 220 50 empty empty HELP? 20 12 0 14 -261234 -258113
  7. 0;
  8. #X text 406 39 for further help: see [gil_example];
  9. #X obj 65 159 s \$0-cursor-list;
  10. #X obj 670 21 loadbang;
  11. #X obj 670 41 float \$1;
  12. #X obj 670 61 sel 0;
  13. #X msg 670 84 1000;
  14. #X obj 697 133 s \$0-test;
  15. #X text 269 431 The cursor C is inside a polygon \, if the line segment
  16. CD to a point outside the polygon is crossing an uneven number of sides
  17. of the polygon. This is always true for all kinds of polygons.;
  18. #X obj 75 320 gil_line&line;
  19. #X obj 186 296 r \$0-test;
  20. #X msg 697 110 \$1 \$1;
  21. #X obj 149 274 r \$0-cursor-list;
  22. #X obj 255 320 gil_line&line;
  23. #X obj 366 296 r \$0-test;
  24. #X obj 329 274 r \$0-cursor-list;
  25. #X obj 435 320 gil_line&line;
  26. #X obj 546 296 r \$0-test;
  27. #X obj 509 274 r \$0-cursor-list;
  28. #X obj 356 369 +;
  29. #X obj 366 344 t b f;
  30. #X obj 705 423 +;
  31. #X obj 716 398 t b f;
  32. #X obj 705 447 mod 2;
  33. #X obj 705 474 outlet mouseover;
  34. #X text 31 17 gil_mouseover_polygon3 <test point position (optional)>
  35. ;
  36. #X text 31 47 calculates \, if the cursor lies inside a given 3-point
  37. polygon.;
  38. #X obj 206 125 s \$0-one;
  39. #X obj 276 105 inlet two;
  40. #X obj 346 105 inlet three;
  41. #X obj 276 125 s \$0-two;
  42. #X obj 346 125 s \$0-three;
  43. #X obj 75 234 r \$0-one;
  44. #X obj 112 254 r \$0-two;
  45. #X obj 255 234 r \$0-two;
  46. #X obj 292 254 r \$0-three;
  47. #X obj 435 234 r \$0-three;
  48. #X obj 472 254 r \$0-one;
  49. #X obj 206 105 inlet one;
  50. #X text 433 176 testpoint D is set to (1000 / 1000) by default \, what
  51. should be always outside the polygon.;
  52. #X connect 0 0 1 0;
  53. #X connect 0 1 6 0;
  54. #X connect 2 0 0 0;
  55. #X connect 7 0 8 0;
  56. #X connect 8 0 9 0;
  57. #X connect 9 0 10 0;
  58. #X connect 9 1 15 0;
  59. #X connect 10 0 15 0;
  60. #X connect 13 2 23 0;
  61. #X connect 14 0 13 3;
  62. #X connect 15 0 11 0;
  63. #X connect 16 0 13 2;
  64. #X connect 17 2 24 0;
  65. #X connect 18 0 17 3;
  66. #X connect 19 0 17 2;
  67. #X connect 20 2 26 0;
  68. #X connect 21 0 20 3;
  69. #X connect 22 0 20 2;
  70. #X connect 23 0 25 0;
  71. #X connect 24 0 23 0;
  72. #X connect 24 1 23 1;
  73. #X connect 25 0 27 0;
  74. #X connect 26 0 25 0;
  75. #X connect 26 1 25 1;
  76. #X connect 27 0 28 0;
  77. #X connect 32 0 34 0;
  78. #X connect 33 0 35 0;
  79. #X connect 36 0 13 0;
  80. #X connect 37 0 13 1;
  81. #X connect 38 0 17 0;
  82. #X connect 39 0 17 1;
  83. #X connect 40 0 20 0;
  84. #X connect 41 0 20 1;
  85. #X connect 42 0 31 0;