[PD] GEM 3d movement

Frank Barknecht fbar at footils.org
Fri Mar 10 21:57:10 CET 2006


Hallo,
Frank Barknecht hat gesagt: // Frank Barknecht wrote:

> Ah, yes, of course, I don't know what I was thinking about when I made
> up my completely wrong formula. 

Okay, I know what I was thinking about now: 

[expr sqrt($f1*$f1 + $f2*$f2 + $f3*$f3)] 

will calculate the geometric length of a 3-dimensional vector. This
can be useful to have in an abstraction, so you don't have to type it. 

If you use this to calculate the length of the difference vector, you
get the distance. You can either do that as in your fixed version of
my wrong formula, or you can calculate the difference vector in a
seperate object like: 

[expr $f1-$f4; $f2-$f5;  $f3-$f6]

Attached is proof, that I tested it this time. ;)

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 473 499 638 433 10;
#X obj 228 175 expr $f1-$f4 \; $f2-$f5 \; $f3-$f6;
#X obj 228 256 expr sqrt($f1*$f1 + $f2*$f2 + $f3*$f3);
#X floatatom 298 335 5 0 0 0 - - -;
#X obj 228 125 unpack 0 0 0;
#X obj 321 125 unpack 0 0 0;
#X text 102 16 Test;
#X obj 228 94 inlet;
#X obj 321 95 inlet;
#X obj 298 315 spigot;
#X obj 335 297 tgl 15 0 empty empty show 0 -6 0 8 -262144 -1 -1 1 1
;
#X obj 228 334 outlet;
#X obj 101 144 list;
#X msg 101 77 \$1 0 0;
#X obj 101 55 t f f;
#X floatatom 101 38 5 0 0 0 - - -;
#X text 130 260 dotprod;
#X text 102 190 difference vect.;
#X msg 131 103 0 \$1 0;
#X connect 0 0 1 0;
#X connect 0 1 1 1;
#X connect 0 2 1 2;
#X connect 1 0 8 0;
#X connect 1 0 10 0;
#X connect 3 0 0 0;
#X connect 3 1 0 1;
#X connect 3 2 0 2;
#X connect 4 0 0 3;
#X connect 4 1 0 4;
#X connect 4 2 0 5;
#X connect 6 0 3 0;
#X connect 7 0 4 0;
#X connect 8 0 2 0;
#X connect 9 0 8 1;
#X connect 11 0 0 0;
#X connect 12 0 11 0;
#X connect 13 0 12 0;
#X connect 13 1 17 0;
#X connect 14 0 13 0;
#X connect 17 0 11 1;


More information about the Pd-list mailing list