hello,
your right, tLink3D does not do this, as i thought. i should fix it.... tLink2D does, but it's easy.
i've got an other patch that is doing this (with only 1 moving point : changing to your nead will be easy i think)
hope it will halp.
Cyrille
Frank Barknecht a écrit :
Hallo, cyrille henry hat gesagt: // cyrille henry wrote:
maybee you can have a look at the tLink3D object of the pmpd lib.
just send position of your 2 points on the 2 inlets, you'll have the orientation output in a gem compatible way.
Using tLink3D surly will make the computatons more effective, however calculating the vector between to points and its length (as tLink does) is not my real problem, the problem is more, how to correctly use this information to draw correct rotations in Gem.
In 2D (polar coordinates) this is simple, but I still haven't found a way to add the missing rotation to go from polar/cartesian to spherical coordinates.
Ciao
#N canvas 571 115 805 813 10; #N canvas 325 151 507 709 cartosphere 0; #X obj 19 25 inlet; #X obj 105 26 inlet; #X obj 192 25 inlet; #X obj 19 84 *; #X obj 105 84 *; #X obj 19 156 +; #X obj 19 177 sqrt; #X obj 192 86 *; #X obj 192 55 t f f; #X obj 103 123 +; #X obj 19 499 outlet; #X obj 164 303 atan; #X obj 164 280 /; #X obj 164 235 pack f f; #X msg 164 258 $2 $1; #X obj 164 328 / 3.14159; #X obj 164 353 * 180; #X obj 164 500 outlet; #X obj 307 288 /; #X obj 307 243 pack f f; #X msg 307 266 $2 $1; #X obj 307 312 acos; #X obj 307 336 / 3.14159; #X obj 307 361 * 180; #X obj 307 500 outlet; #X obj 177 392 moses 0; #X obj 105 53 t f f f f; #X msg 177 416 -180; #X msg 214 416 180; #X obj 177 446 * 0; #X obj 164 472 +; #X obj 20 53 t f f f f; #X obj 69 327 moses 0; #X msg 106 355 0; #X msg 69 355 1; #X obj 69 379 t b f; #X connect 0 0 31 0; #X connect 1 0 26 0; #X connect 2 0 8 0; #X connect 2 0 19 1; #X connect 3 0 5 0; #X connect 4 0 9 0; #X connect 5 0 6 0; #X connect 6 0 10 0; #X connect 6 0 19 0; #X connect 7 0 9 1; #X connect 8 0 7 0; #X connect 8 1 7 1; #X connect 9 0 5 1; #X connect 11 0 15 0; #X connect 12 0 11 0; #X connect 13 0 14 0; #X connect 14 0 12 0; #X connect 15 0 16 0; #X connect 16 0 30 0; #X connect 18 0 21 0; #X connect 19 0 20 0; #X connect 20 0 18 0; #X connect 21 0 22 0; #X connect 22 0 23 0; #X connect 23 0 24 0; #X connect 25 0 27 0; #X connect 25 1 28 0; #X connect 26 0 4 0; #X connect 26 1 4 1; #X connect 26 2 13 1; #X connect 26 3 25 0; #X connect 27 0 29 0; #X connect 28 0 29 0; #X connect 29 0 30 1; #X connect 30 0 17 0; #X connect 31 0 3 0; #X connect 31 1 3 1; #X connect 31 2 13 0; #X connect 31 3 32 0; #X connect 32 0 34 0; #X connect 32 1 33 0; #X connect 33 0 35 0; #X connect 34 0 35 0; #X connect 35 0 29 0; #X connect 35 1 29 1; #X restore 159 355 pd cartosphere; #X obj 83 116 vsl 15 128 -1 1 0 0 empty empty empty 0 -8 0 8 -262144 -1 -1 11600 1; #X obj 204 121 vsl 15 128 -1 1 0 0 empty empty empty 0 -8 0 8 -262144 -1 -1 0 1; #X obj 291 86 vsl 15 128 -1 1 0 0 empty empty empty 0 -8 0 8 -262144 -1 -1 200 1; #X floatatom 178 376 5 0 0 0 - - -; #X floatatom 217 376 5 0 0 0 - - -; #X floatatom 256 376 5 0 0 0 - - -; #X obj 496 323 gemhead; #X obj 498 540 sphere 0.2; #X obj 498 495 translateXYZ; #X obj 479 174 gemhead; #X obj 479 198 world_light; #X msg 553 518 30; #X obj 32 368 gemhead; #X obj 31 450 color 1 0 0; #X obj 238 403 - 90; #X floatatom 251 464 5 0 0 0 - - -; #X obj 238 482 +; #X floatatom 211 447 5 0 0 0 - - -; #X obj 198 465 +; #X floatatom 50 482 5 0 0 0 - - -; #X floatatom 66 500 5 0 0 0 - - -; #X floatatom 82 520 5 0 0 0 - - -; #X obj 32 690 cube 0.5; #X obj 30 739 cube 0.2; #X obj 291 234 * -1; #X obj 31 715 translateXYZ 0.7 0 0; #X floatatom 585 389 5 0 0 0 - - -; #X floatatom 582 416 5 0 0 0 - - -; #X floatatom 548 383 5 0 0 0 - - -; #X obj 496 425 rotateXYZ; #X obj 493 347 rotate -120 1 1 1; #X obj 31 419 rotate -120 1 1 1; #X obj 32 667 rotateXYZ; #X obj 32 533 rotateXYZ; #X obj 32 644 rotateXYZ; #X obj 487 129 gemwin; #X msg 485 90 create , 1; #X obj 160 265 t b f; #X obj 226 282 t b f; #X connect 0 0 4 0; #X connect 0 1 5 0; #X connect 0 1 19 0; #X connect 0 2 6 0; #X connect 0 2 15 0; #X connect 1 0 0 0; #X connect 1 0 9 1; #X connect 2 0 9 2; #X connect 2 0 38 0; #X connect 3 0 25 0; #X connect 7 0 31 0; #X connect 9 0 8 0; #X connect 10 0 11 0; #X connect 12 0 8 2; #X connect 13 0 32 0; #X connect 14 0 34 0; #X connect 15 0 17 0; #X connect 16 0 17 1; #X connect 17 0 33 2; #X connect 18 0 19 1; #X connect 19 0 35 3; #X connect 20 0 34 1; #X connect 21 0 34 2; #X connect 22 0 34 3; #X connect 23 0 26 0; #X connect 25 0 9 3; #X connect 25 0 39 0; #X connect 26 0 24 0; #X connect 27 0 30 2; #X connect 28 0 30 3; #X connect 29 0 30 1; #X connect 30 0 9 0; #X connect 31 0 30 0; #X connect 32 0 14 0; #X connect 33 0 23 0; #X connect 34 0 35 0; #X connect 35 0 33 0; #X connect 37 0 36 0; #X connect 38 0 1 0; #X connect 38 1 0 1; #X connect 39 0 1 0; #X connect 39 1 0 2;