Hi,
I'm new to PD and trying to use boids
(http://puredata.info/community/projects/software/boids) with GEM
(http://puredata.info/community/projects/software/gem).
The example boids2d-help.pd (attached) that comes with boids is almost
what I need, but it renders each boids result in a separate pd subpatch;
in pd gem_example a route object is used to route each result of boids
to a separate subpatch pd boid which takes care of the gem rendering.
Is there a way to send the results of boids to one subpatch that would
take care of all the rendering no matter how many boids results there
are ? This would allow me to fluctuate the number of boids without
having to create and attach new subpatches.
Any help is highly appreciated.
Best,
--
Oussama Mubarak
http://semiaddict.com
#N canvas 0 22 975 712 10;
#X obj 604 10 import jasch_lib;
#X msg -99 601 dump;
#X msg 266 113 neighbors \$1;
#X floatatom 266 98 5 0 4 0 - neighbors -;
#X floatatom 266 133 5 0 0 0 - maxspeed -;
#X msg 266 148 maxspeed \$1;
#X floatatom 266 168 5 0 0 0 - minspeed -;
#X msg 266 183 minspeed \$1;
#X floatatom 266 203 5 0 0 0 - center -;
#X msg 266 218 center \$1;
#X floatatom 266 238 5 0 0 0 - attract -;
#X msg 266 253 attract \$1;
#X floatatom 266 273 5 0 0 0 - match -;
#X msg 266 288 match \$1;
#X floatatom 266 308 5 0 0 0 - avoid -;
#X msg 266 323 avoid \$1;
#X obj -125 411 r boidParam;
#X floatatom 266 343 5 0 0 0 - repel -;
#X msg 266 358 repel \$1;
#X floatatom 266 378 5 0 0 0 - edgedist -;
#X msg 266 393 edgedist \$1;
#X floatatom 266 413 5 0 0 0 - speed -;
#X msg 266 428 speed \$1;
#X floatatom 266 448 5 0 0 0 - inertia -;
#X msg 266 463 inertia \$1;
#X floatatom 266 483 5 0 0 0 - accel -;
#X msg 266 498 accel \$1;
#X floatatom 266 518 5 0 0 0 - prefdist -;
#X msg 266 533 prefdist \$1;
#X msg -99 620 reset;
#X text 357 148 maximum speed of speed range;
#X text 359 182 minimum speed of speed range;
#X text 356 217 strength of centering instinct;
#X text 358 428 overall speed;
#X text 359 499 speed of acceleration;
#X text 359 530 preferred distance from neighbors;
#X floatatom 267 556 5 0 0 0 - flyrect[0] -;
#X floatatom 306 556 5 0 0 0 - flyrect[1] -;
#X floatatom 345 556 5 0 0 0 - flyrect[2] -;
#X floatatom 384 556 5 0 0 0 - - -;
#X floatatom 266 615 5 0 0 0 - - -;
#X floatatom 306 615 5 0 0 0 - - -;
#X floatatom 266 63 5 0 0 0 - - -;
#X msg 266 78 number \$1;
#X text 357 76 number of boids;
#X floatatom -99 567 5 0 0 0 - - -;
#X msg -99 582 mode \$1;
#X text -35 582 output mode;
#X obj 266 676 s boidParam;
#X obj -99 641 s boidParam;
#X text -35 601 parameter dump;
#X text -36 621 reset boids randomly inside flyrect;
#X text 357 111 number of neighbors each boid consults when flocking
;
#X text 356 288 strength of neighbor speed matching instinct;
#X text 356 323 strength of neighbor avoidance instinct;
#X text 356 355 strength of wall avoidance instinct;
#X text 358 391 distance of vision for avoiding wall edges;
#X text 359 462 willingness to change speed and direction;
#X text 355 251 strength of attraction to 'attractpt';
#X text -191 84 (c) 1995-98 Eric L. Singer (e...@ericsinger.com);
#X text -191 126 Based on Simon Fraser's implementation of Craig Reynolds'
Boids algorithm. Boids is free for non-commercial use;
#X text -191 159 Boids is a bird flight and animal flock simulator.
It is based on the same algorithm which was used in Jurassic Park for
the herding dinosaurs.;
#X text -191 208 Boids takes an integer argument which is the number
of boids. Each time Boids receives a bang \, it calculates and outputs
the new positions of the boids. The output consists of thew coordiantes
for each boid \, the number and type depending on the mode.;
#X text -190 282 The flight parameters can be changed with messages.
Use the 'dump' message to output a list of the current parameter settings.
;
#X text -190 328 For more information about the Boids algorithm \,
see Craig Reynolds' Web site at
http://reality.sgi.com/employees/craig/boids.html;.
;
#X text -188 64 arguments: float number of boids \, float output
mode;
#X obj -72 460 print dump;
#X obj -203 9 cnv 15 800 48 empty empty boids2d 20 12 2 24 -228915
-66577 0;
#X obj -151 410 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144
-1 -1;
#N canvas 430 22 471 383 gem_example 0;
#X msg 33 31 destroy;
#N canvas 494 140 629 324 gemwin 0;
#X obj 219 190 gemwin;
#X obj 66 194 outlet;
#X obj 67 10 inlet;
#X obj 67 41 route create;
#X msg 67 70 set destroy;
#X msg 157 70 set create;
#X msg 350 115 destroy \, reset;
#X msg 238 71 color 0 0 0.5;
#X msg 212 146 create \, 1 \, frame 30 \, color 1 1 1;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 0 8 0;
#X connect 3 1 5 0;
#X connect 3 1 6 0;
#X connect 4 0 1 0;
#X connect 5 0 1 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X connect 8 0 0 0;
#X restore 33 51 pd gemwin;
#X obj 33 91 tgl 15 0 empty empty start_flocking_animation 20 6 1 10
-262144 -1 -1 1 1;
#X obj 204 135 r boidParam;
#X obj 33 112 metro 33;
#X floatatom 33