diff options
author | Cyrille Henry <nusmuk@users.sourceforge.net> | 2014-02-21 11:17:00 +0000 |
---|---|---|
committer | Cyrille Henry <nusmuk@users.sourceforge.net> | 2014-02-21 11:17:00 +0000 |
commit | 9cde4c4f3367675ad84c3d2d08292e1bfa13d673 (patch) | |
tree | 5c7f2c3359243fdc1d59c42a9072ae7a8b83f56d | |
parent | a279f0b055123b98c0f216d57a895a6dbe74d5c7 (diff) |
2 diferent distortion mode for this example
svn path=/trunk/externals/pmpd/; revision=17268
-rw-r--r-- | examples/64_distordable_object.pd | 315 |
1 files changed, 202 insertions, 113 deletions
diff --git a/examples/64_distordable_object.pd b/examples/64_distordable_object.pd index 707d1ad..54d5aa6 100644 --- a/examples/64_distordable_object.pd +++ b/examples/64_distordable_object.pd @@ -1,95 +1,128 @@ -#N canvas 385 163 669 579 10; +#N canvas 656 184 734 630 10; #X declare -lib Gem -path ../; -#X obj 52 300 pmpd2d; +#X obj 52 340 pmpd2d; #X obj 52 78 loadbang; #X obj 64 101 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; -#N canvas 163 153 1137 609 creation 0; -#X obj 256 -12 inlet; -#X obj 266 16 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +#N canvas 551 233 1328 695 creation 0; +#X obj 631 -17 inlet; +#X obj 641 11 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; -#X obj 257 49 t b b b b b b b b b b b; -#X msg 824 175 reset; -#X obj 504 540 outlet; -#X obj 637 147 until; -#X obj 637 179 f; -#X obj 709 231 + 1; -#X msg 679 147 0; -#X obj 637 305 pack f f; -#X msg 637 330 mass net 1 1 \$1 \$2; -#X msg 746 512 print; -#X obj 672 257 % 20; -#X obj 637 258 / 20; -#X obj 637 279 i; -#X obj 637 226 t f f f f; -#X obj 448 339 until; -#X obj 448 371 f; -#X obj 520 423 + 1; -#X obj 448 418 t f f f f; -#X obj 449 448 + 1; -#X obj 447 476 pack f f; -#X msg 448 317 19; -#X obj 463 179 until; -#X obj 463 211 f; -#X msg 505 179 0; -#X obj 524 242 + 1; -#X obj 488 313 * 20; -#X msg 463 157 20; -#X msg 637 125 400; -#X obj 314 297 until; -#X obj 314 329 f; -#X obj 386 381 + 1; -#X obj 314 376 t f f f f; -#X obj 313 434 pack f f; -#X obj 329 137 until; -#X obj 329 169 f; -#X msg 371 137 0; -#X obj 406 212 + 1; -#X obj 354 271 * 20; -#X msg 314 275 20; -#X msg 329 115 19; -#X obj 315 406 + 20; -#X obj 148 299 until; -#X obj 148 331 f; -#X obj 220 383 + 1; -#X obj 148 378 t f f f f; -#X obj 147 436 pack f f; -#X obj 163 139 until; -#X obj 163 171 f; -#X msg 205 139 0; -#X obj 248 219 + 1; -#X obj 188 273 * 20; -#X msg 163 117 19; -#X msg 148 277 19; -#X obj 149 408 + 21; -#X obj 0 290 until; -#X obj 0 322 f; -#X obj 72 374 + 1; -#X obj 0 369 t f f f f; -#X obj -1 427 pack f f; -#X obj 15 130 until; -#X obj 15 162 f; -#X msg 57 130 0; -#X obj 73 213 + 1; -#X obj 40 264 * 20; -#X msg 15 108 19; -#X msg 0 268 19; -#X obj 56 407 + 1; -#X obj 14 237 t b f f; -#X obj 162 246 t b f f; -#X obj 328 244 t b f f; -#X obj 462 286 t b f f; -#X obj 2 399 + 20; -#X msg 846 276 min -9 -9 \, max 29 29; -#X msg 1 455 link mesh \$1 \$2 0.03 0.1; -#X msg 152 463 link mesh \$1 \$2 0.03 0.1; -#X msg 316 462 link mesh \$1 \$2 0.03 0.1; -#X msg 448 501 link mesh \$1 \$2 0.03 0.1; +#X obj 632 44 t b b b b b b b b b b b; +#X msg 1082 220 reset; +#X obj 614 611 outlet; +#X obj 951 188 until; +#X obj 951 220 f; +#X obj 1023 272 + 1; +#X msg 993 188 0; +#X obj 951 346 pack f f; +#X msg 951 371 mass net 1 1 \$1 \$2; +#X msg 1074 468 print; +#X obj 986 298 % 20; +#X obj 951 299 / 20; +#X obj 951 320 i; +#X obj 951 267 t f f f f; +#X obj 823 334 until; +#X obj 823 366 f; +#X obj 895 418 + 1; +#X obj 823 413 t f f f f; +#X obj 824 443 + 1; +#X obj 822 471 pack f f; +#X msg 823 312 19; +#X obj 838 174 until; +#X obj 838 206 f; +#X msg 880 174 0; +#X obj 899 237 + 1; +#X obj 863 308 * 20; +#X msg 838 152 20; +#X msg 951 166 400; +#X obj 659 331 until; +#X obj 659 363 f; +#X obj 731 415 + 1; +#X obj 659 410 t f f f f; +#X obj 658 468 pack f f; +#X obj 674 171 until; +#X obj 674 203 f; +#X msg 716 171 0; +#X obj 751 246 + 1; +#X obj 699 305 * 20; +#X msg 659 309 20; +#X msg 674 149 19; +#X obj 660 440 + 20; +#X obj 493 333 until; +#X obj 493 365 f; +#X obj 565 417 + 1; +#X obj 493 412 t f f f f; +#X obj 492 470 pack f f; +#X obj 508 173 until; +#X obj 508 205 f; +#X msg 550 173 0; +#X obj 593 253 + 1; +#X obj 533 307 * 20; +#X msg 508 151 19; +#X msg 493 311 19; +#X obj 494 442 + 21; +#X obj 338 333 until; +#X obj 338 365 f; +#X obj 410 417 + 1; +#X obj 338 412 t f f f f; +#X obj 337 470 pack f f; +#X obj 353 173 until; +#X obj 353 205 f; +#X msg 395 173 0; +#X obj 411 256 + 1; +#X obj 378 307 * 20; +#X msg 353 151 19; +#X msg 338 311 19; +#X obj 394 450 + 1; +#X obj 352 280 t b f f; +#X obj 507 280 t b f f; +#X obj 673 278 t b f f; +#X obj 837 281 t b f f; +#X obj 340 442 + 20; +#X msg 1095 274 min -9 -9 \, max 29 29; +#X msg 339 498 link mesh \$1 \$2 0.03 0.1; +#X msg 497 497 link mesh \$1 \$2 0.03 0.1; +#X msg 661 496 link mesh \$1 \$2 0.03 0.1; +#X msg 823 496 link mesh \$1 \$2 0.03 0.1; +#X obj 170 335 until; +#X obj 170 367 f; +#X obj 242 419 + 1; +#X obj 170 414 t f f f f; +#X obj 169 472 pack f f; +#X obj 185 175 until; +#X obj 185 207 f; +#X msg 227 175 0; +#X obj 270 255 + 1; +#X obj 210 309 * 20; +#X obj 15 335 until; +#X obj 15 367 f; +#X obj 87 419 + 1; +#X obj 15 414 t f f f f; +#X obj 14 472 pack f f; +#X obj 30 175 until; +#X obj 30 207 f; +#X msg 72 175 0; +#X obj 88 258 + 1; +#X obj 55 309 * 20; +#X obj 29 282 t b f f; +#X obj 184 282 t b f f; +#X msg 20 502 link mesh \$1 \$2 0.03 0.1; +#X msg 174 499 link mesh \$1 \$2 0.03 0.1; +#X obj 71 452 + 2; +#X msg 15 313 18; +#X msg 30 153 18; +#X obj 171 444 + 42; +#X msg 184 153 18; +#X msg 170 313 18; +#X obj 17 444 + 40; #X connect 0 0 2 0; #X connect 1 0 2 0; +#X connect 2 0 105 0; +#X connect 2 1 107 0; #X connect 2 2 74 0; +#X connect 2 4 53 0; #X connect 2 4 66 0; -#X connect 2 6 53 0; #X connect 2 7 41 0; #X connect 2 8 28 0; #X connect 2 9 29 0; @@ -99,6 +132,8 @@ #X connect 2 10 37 0; #X connect 2 10 50 0; #X connect 2 10 63 0; +#X connect 2 10 86 0; +#X connect 2 10 96 0; #X connect 3 0 4 0; #X connect 5 0 6 0; #X connect 6 0 15 0; @@ -192,12 +227,49 @@ #X connect 76 0 4 0; #X connect 77 0 4 0; #X connect 78 0 4 0; +#X connect 79 0 80 0; +#X connect 80 0 82 0; +#X connect 81 0 80 1; +#X connect 82 0 106 0; +#X connect 82 1 83 1; +#X connect 82 2 81 0; +#X connect 83 0 102 0; +#X connect 84 0 85 0; +#X connect 85 0 100 0; +#X connect 86 0 85 1; +#X connect 87 0 85 1; +#X connect 88 0 80 1; +#X connect 89 0 90 0; +#X connect 90 0 92 0; +#X connect 91 0 90 1; +#X connect 92 0 109 0; +#X connect 92 1 103 0; +#X connect 92 2 91 0; +#X connect 93 0 101 0; +#X connect 94 0 95 0; +#X connect 95 0 99 0; +#X connect 96 0 95 1; +#X connect 97 0 95 1; +#X connect 98 0 90 1; +#X connect 99 0 104 0; +#X connect 99 1 98 0; +#X connect 99 2 97 0; +#X connect 100 0 108 0; +#X connect 100 1 88 0; +#X connect 100 2 87 0; +#X connect 103 0 93 1; +#X connect 104 0 89 0; +#X connect 105 0 94 0; +#X connect 106 0 83 0; +#X connect 107 0 84 0; +#X connect 108 0 79 0; +#X connect 109 0 93 0; #X restore 52 126 pd creation; -#X obj 69 224 gemhead; -#X obj 69 247 t b; +#X obj 69 264 gemhead; +#X obj 69 287 t b; #X obj 54 45 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1 ; -#N canvas 485 216 591 562 linkrender 0; +#N canvas 483 221 591 562 linkrender 0; #X obj 146 9 inlet; #X obj 67 285 separator; #X obj 150 148 t b f; @@ -235,7 +307,7 @@ #X connect 14 0 1 0; #X connect 15 0 14 0; #X connect 16 0 8 0; -#X restore 52 345 pd linkrender; +#X restore 52 385 pd linkrender; #N canvas 266 267 304 262 create_gem 0; #X msg 137 179 0 \, destroy; #X obj 118 104 inlet; @@ -257,8 +329,8 @@ #X obj 207 -13 gemhead; #X obj 207 10 t b; #X obj 207 53 until; -#X obj 52 323 route linkEnd testLink; -#X msg 151 366 setInactive \$1 \, setLinkId \$1 broken; +#X obj 52 363 route linkEnd testLink; +#X msg 151 406 setInactive \$1 \, setLinkId \$1 broken; #X obj 480 70 gemhead 45; #X obj 480 113 translateXYZ -10 -10 0; #X obj 480 92 scaleXYZ 0.2 0.2 0.2; @@ -267,35 +339,45 @@ #X obj 536 34 + 30; #X obj 480 134 translateXYZ; #X obj 480 155 circle 2; -#X obj 151 345 route break plastic; +#X obj 151 385 route break plastic; #X msg 207 197 bang \, forceY net -1e-05 \,; #X msg 451 38 0; #X obj 451 14 loadbang; -#X msg 239 169 iCircle net \$1 \$2 1 -0.1 1 0 0 0 1; -#X msg 207 32 20; #X obj 26 -19 declare -lib Gem -path ../; -#X text 62 452 Click and drag the mouse cursor over the object : you -can interact with it. If forces in the links are superior to 0.002 -\, the connection lenght will adapt a bit (plastic deformation). If -forces are even bigger (> 0.03) \, the link will break.; #X text 239 7 simulation speed x20; -#X text 378 367 link with forces > 0.03 breaks; -#X text 350 398 link with forces > 0.002 adpats 1% of their length +#X text 188 331 ask pmpd to test the forces of each links; +#X msg 69 308 linkEnd mesh; +#X obj 181 225 t b b; +#X obj 181 265 spigot 0; +#X obj 281 263 spigot 0; +#X obj 226 226 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj 326 243 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X text 86 100 reset object; +#X msg 239 169 iCircle net \$1 \$2 1 -0.03 1 0 0 0 1; +#X text 247 224 plastic distortion; +#X text 347 241 breakable link; +#X msg 181 286 testLink plastic Id mesh forceSup 0.004; +#X msg 205 436 setLCurrent mesh 0.005; +#X msg 282 311 testLink break Id mesh forceSup 0.01; +#X msg 207 32 20; +#X text 62 492 Click and drag the mouse cursor over the object : you +can interact with it. If forces in the links are superior to 0.004 +\, the connection lenght will adapt a bit (plastic deformation). If +forces are even bigger (> 0.01) \, the link will break.; +#X text 378 407 link with forces > 0.01 breaks; +#X text 350 438 link with forces > 0.004 adpats 0.5% of their length ; -#X text 186 280 ask pmpd to test the forces of each links; -#X msg 69 268 linkEnd mesh; -#X msg 185 245 testLink break Id mesh forceSup 0.03 \, testLink plastic -Id mesh forceSup 0.002; -#X msg 206 396 setLCurrent mesh 0.01; #X connect 0 0 18 0; #X connect 1 0 3 0; #X connect 2 0 3 0; #X connect 3 0 0 0; #X connect 4 0 5 0; -#X connect 5 0 40 0; +#X connect 5 0 35 0; #X connect 6 0 8 0; #X connect 9 0 10 0; -#X connect 10 0 32 0; +#X connect 10 0 42 0; #X connect 11 0 14 1; #X connect 11 1 13 0; #X connect 11 2 10 1; @@ -303,10 +385,10 @@ Id mesh forceSup 0.002; #X connect 13 0 9 1; #X connect 14 0 12 0; #X connect 15 0 16 0; -#X connect 16 0 33 0; -#X connect 17 0 29 0; +#X connect 16 0 48 0; #X connect 17 0 14 0; -#X connect 17 0 41 0; +#X connect 17 0 36 0; +#X connect 17 0 29 0; #X connect 18 0 7 0; #X connect 18 1 28 0; #X connect 19 0 0 0; @@ -320,12 +402,19 @@ Id mesh forceSup 0.002; #X connect 25 0 26 2; #X connect 26 0 27 0; #X connect 28 0 19 0; -#X connect 28 1 42 0; +#X connect 28 1 46 0; #X connect 29 0 0 0; #X connect 30 0 20 0; #X connect 31 0 30 0; -#X connect 32 0 0 0; -#X connect 33 0 17 0; -#X connect 40 0 0 0; -#X connect 41 0 0 0; +#X connect 35 0 0 0; +#X connect 36 0 37 0; +#X connect 36 1 38 0; +#X connect 37 0 45 0; +#X connect 38 0 47 0; +#X connect 39 0 37 1; +#X connect 40 0 38 1; #X connect 42 0 0 0; +#X connect 45 0 0 0; +#X connect 46 0 0 0; +#X connect 47 0 0 0; +#X connect 48 0 17 0; |