Here is the corrected version, you have to use two tLinks : one aginst x
and one against y.
n
marius schebella a écrit :
Frank Barknecht wrote:
Hallo,
marius schebella hat gesagt: // marius schebella wrote:
I know, I am already too old for posting feature requests. I was
just thinking that I miss the ability to damp the speed of masses in
msd.
right now I am using something like
mass mass1 1 100 0 0
mass mass2 1 100 1 0
link l mass1 mass2 10 10 0 0.01 0
link l 1
I want that the masses reject each other within a certain range and
then just reduce speed and stop if the speed is lower than a certain
threshold.
probably I should try to implement this myself. but maybe I am only
missing something.
Are you looking for some kind of "air resistance" damping? I normally
use an "nlink" or "tlink" to add a global damping to masses.
I am not quite sure how nlinks and tlink work. tLink seems to work
with a vector that is not related to the current link vector but to
absolute x/y, maybe nLink is what I need? but nlinks do not work for
me at all, or are they no real links or is this a bug?
tLink with a vector 1/1 seems to be the same as the plain link
message. correct? and there seems to be no difference between a tLink
1/1 and a tLink 2/2?
I tried to use tLink to get global damping, but I am not sure how to
do this (attached patch..)
marius.
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
--
http://nicomon.basseslumieres.org
#N canvas 612 22 787 645 10;
#X msg 270 41 create , 1;
#X msg 146 208 Xmax 4 , Xmin -4 , Ymax 4 , Ymin -4;
#X obj 93 518 route massesPos linksPos;
#N canvas 365 99 589 496 gemrender 0;
#X obj 171 206 inlet;
#X obj 434 220 inlet;
#X obj 387 404 curve 2;
#X msg 524 286 $4 $5 0;
#X msg 452 282 $2 $3 0;
#X obj 171 229 unpack f f f;
#X obj 387 359 gemhead;
#X obj 140 288 gemhead;
#X obj 140 403 translateXYZ 1.1 1 0;
#X obj 140 348 color 1 0 0;
#X obj 97 230 loadbang;
#X msg 96 252 0;
#X obj 191 54 gemhead;
#X obj 387 302 loadbang;
#X msg 387 324 0;
#X obj 434 250 t b l l;
#X text 241 53 this renders spheres and curves;
#X obj 140 308 ortho;
#X msg 220 81 bang , get massesPos;
#X msg 191 110 get linksPos;
#X obj 217 148 s to_msd;
#X obj 206 286 sel 0 1 2;
#X msg 207 308 0 1 0;
#X obj 140 258 t b a;
#X msg 217 328 1 0 0;
#X msg 257 328 0.3 0.3 0.3;
#X obj 140 449 circle 0.1;
#X connect 0 0 5 0;
#X connect 1 0 15 0;
#X connect 3 0 2 2;
#X connect 4 0 2 1;
#X connect 5 0 23 0;
#X connect 5 1 8 1;
#X connect 5 2 8 2;
#X connect 6 0 2 0;
#X connect 7 0 17 0;
#X connect 8 0 26 0;
#X connect 9 0 8 0;
#X connect 10 0 11 0;
#X connect 11 0 7 0;
#X connect 12 0 18 0;
#X connect 12 0 19 0;
#X connect 13 0 14 0;
#X connect 14 0 6 0;
#X connect 15 0 6 0;
#X connect 15 1 4 0;
#X connect 15 2 3 0;
#X connect 17 0 9 0;
#X connect 18 0 20 0;
#X connect 19 0 20 0;
#X connect 21 0 22 0;
#X connect 21 1 24 0;
#X connect 21 2 25 0;
#X connect 22 0 9 1;
#X connect 23 0 7 0;
#X connect 23 1 21 0;
#X connect 24 0 9 1;
#X connect 25 0 9 1;
#X restore 93 577 pd gemrender;
#X msg 146 180 reset;
#X msg 147 286 mass m2 1 100 -0.5 0.5;
#X obj 39 389 msd2D;
#N canvas 641 95 362 270 init 0;
#X obj 101 167 r geminit;
#X obj 101 189 outlet;
#X msg 102 50 THIS WILL INIT THE GEMWIN ; geminit 0 ; geminit destroy
; geminit cursor 1 ; geminit border 1 ; geminit dimen 500 500 ;
geminit offset 20 20 ; geminit menubar 1;
#X obj 102 27 loadbang;
#X connect 0 0 1 0;
#X connect 3 0 2 0;
#X restore 219 41 pd init;
#X obj 219 62 gemwin;
#X obj 29 347 r to_msd;
#X msg 146 331 mass fix 0 100 0 0;
#X text 235 407 $6 = power?;
#X text 417 204 <-- click all these messages;
#N canvas 135 163 589 368 gemmouse 0;
#X obj 104 197 spigot;
#X obj 154 197 spigot;
#X obj 104 219 - 4;
#X obj 155 218 - 4;
#X obj 155 238 * -1;
#X obj 104 71 gemmouse 8 8;
#X obj 104 286 s to_msd;
#X msg 104 262 posX m1 $1;
#X msg 178 263 posY m1 $1;
#X obj 112 163 0;
#X obj 162 163 0;
#X obj 171 98 t f f;
#X obj 171 121 sel 1;
#X text 252 58 mouse interaction;
#X text 194 162 immediately output current mousepos on click;
#X text 200 198 filter events , when button is not pressed;
#X connect 0 0 2 0;
#X connect 1 0 3 0;
#X connect 2 0 7 0;
#X connect 3 0 4 0;
#X connect 4 0 8 0;
#X connect 5 0 0 0;
#X connect 5 0 9 1;
#X connect 5 1 1 0;
#X connect 5 1 10 1;
#X connect 5 2 11 0;
#X connect 7 0 6 0;
#X connect 8 0 6 0;
#X connect 9 0 0 0;
#X connect 10 0 1 0;
#X connect 11 0 12 0;
#X connect 11 1 1 1;
#X connect 11 1 0 1;
#X connect 12 0 10 0;
#X connect 12 0 9 0;
#X restore 220 83 pd gemmouse;
#X text 350 391 problem: with this method damping does not damp the
current velocity , but is always aligned to the fix mass at 0/0...
;
#X obj 161 548 spigot;
#X obj 211 548 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X text 232 546 show links;
#X msg 271 61 destroy;
#X msg 146 257 mass m1 0 100 0.5 0.5;
#X msg 142 390 link l1 m1 m2 1 0 0 0 0.5;
#X text 396 264 then use mouse to the green circle to push the red
one around (press left mousebutton);
#X text 292 258 (green);
#X text 293 287 (red);
#X text 293 327 (center);
#X msg 142 452 tLink damp2 fix m2 0 5 1 0;
#X msg 143 480 tLink damp2 fix m2 0 5 0 1;
#X obj 116 128 t b b b b b b b b;
#X obj 114 98 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X text 346 453 tLink following x;
#X text 343 480 tLink following y;
#X connect 0 0 8 0;
#X connect 1 0 6 0;
#X connect 2 0 3 0;
#X connect 2 1 15 0;
#X connect 4 0 6 0;
#X connect 5 0 6 0;
#X connect 6 0 2 0;
#X connect 7 0 8 0;
#X connect 9 0 6 0;
#X connect 10 0 6 0;
#X connect 15 0 3 1;
#X connect 16 0 15 1;
#X connect 18 0 8 0;
#X connect 19 0 6 0;
#X connect 20 0 6 0;
#X connect 25 0 6 0;
#X connect 26 0 6 0;
#X connect 27 0 26 0;
#X connect 27 1 25 0;
#X connect 27 2 20 0;
#X connect 27 3 10 0;
#X connect 27 4 5 0;
#X connect 27 5 19 0;
#X connect 27 6 1 0;
#X connect 27 7 4 0;
#X connect 28 0 27 0;