Forums > MaxMSP

bouncing algorythm

January 4, 2007 | 9:20 pm

hey there!

i’m trying to scale a set of objets with an fake bounce algorythm. here’s what i do:

max v2;
#N vpatcher 479 369 1238 789;
#P inlet 495 86 15 0;
#P window setfont "Sans Serif" 9.;
#P message 495 107 53 9109513 0. , 12. 500;
#P newex 495 128 82 9109513 line 0.;
#B color 5;
#P flonum 495 157 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 508 181 45 9109513 loadbang;
#P message 508 207 35 9109513 sym 2;
#P user umenu 456 207 47 9109543 1 64 223 1;
#X add lin;
#X add exp;
#X add pow;
#P inlet 317 84 15 0;
#P message 317 105 53 9109513 0. , 33. 500;
#P newex 317 126 82 9109513 line 0.;
#B color 5;
#P flonum 317 155 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 330 179 45 9109513 loadbang;
#P message 330 205 35 9109513 sym 2;
#P user umenu 278 205 47 9109543 1 64 221 1;
#X add lin;
#X add exp;
#X add pow;
#P newex 124 355 27 9109513 + 1.;
#P newex 138 180 45 9109513 loadbang;
#P newex 124 329 27 9109513 / 90.;
#P inlet 124 80 15 0;
#P outlet 124 378 15 0;
#P message 124 101 58 9109513 0. , 100. 500;
#P newex 124 122 82 9109513 line 0.;
#B color 5;
#P flonum 124 151 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 137 205 35 9109513 sym 2;
#P user umenu 85 205 47 9109543 1 64 221 1;
#X add lin;
#X add exp;
#X add pow;
#P newex 124 227 165 9109513 lp.scampf map 100. 0. 100. 0. pow 1.;
#P background;
#P newex 317 227 155 9109513 lp.scampf map 33. 0. 33. 0. pow 1.;
#P background;
#P newex 495 229 155 9109513 lp.scampf map 12. 0. 12. 0. pow 1.;
#P background;
#P connect 9 0 7 0;
#P connect 7 0 6 0;
#P connect 6 0 5 0;
#P connect 3 1 2 0;
#P fasten 4 0 2 0 142 223 129 223;
#P connect 5 0 2 0;
#P connect 0 0 10 0;
#P connect 1 0 10 0;
#P connect 2 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 8 0;
#P connect 11 0 4 0;
#P connect 6 1 18 0;
#P connect 19 0 18 0;
#P connect 18 0 17 0;
#P connect 17 0 16 0;
#P connect 13 1 1 0;
#P fasten 14 0 1 0 335 223 322 223;
#P connect 16 0 1 0;
#P connect 15 0 14 0;
#P connect 17 1 25 0;
#P connect 26 0 25 0;
#P connect 25 0 24 0;
#P connect 24 0 23 0;
#P connect 20 1 0 0;
#P fasten 21 0 0 0 513 225 500 225;
#P connect 23 0 0 0;
#P connect 22 0 21 0;
#P pop;

is that a useful way??? – i’m asking, because i’m trying to control 150 spheres with that!!! – is there some expression maybe…?

thanks, mKern


January 5, 2007 | 8:14 am

hello,

I don’t really understand your patch… isn’t it just a
subpatcher ?…with main patch missing ?…

anyway, have a look at this thread:
http://www.cycling74.com/forums/index.php?
t=msg&rid=0&S=16912eeef5b96fae203f37736bf85feb&th=23677&goto=90203#msg_9
0203
the pmpd library will probably help you boucing!

Mathieu Chamagne


January 5, 2007 | 9:03 am

Have a look also at Andre Sier’s objects, which
contain some nice spring simulations etc. (now
available in UB!); you can find them at:
http://www.s373.net/code/a-objects/
cheers
Roger

— "mathieu.chamagne@gmail.com"

wrote:

> hello,
>
> I don’t really understand your patch… isn’t it
> just a
> subpatcher ?…with main patch missing ?…
>
> anyway, have a look at this thread:
> http://www.cycling74.com/forums/index.php?
>
t=msg&rid=0&S=16912eeef5b96fae203f37736bf85feb&th=23677&goto=90203#msg_9
>
> 0203
> the pmpd library will probably help you boucing!
>
> Mathieu Chamagne
>
>
>


Viewing 3 posts - 1 through 3 (of 3 total)