Can anyone enlighten me on how you would use [part_info] together with [color] to generate randomly coloured particles, with each particle having a randomly generated colour?
Le 2012-01-02 à 21:57:00, Antonio Roberts a écrit :
Can anyone enlighten me on how you would use [part_info] together with [color] to generate randomly coloured particles, with each particle having a randomly generated colour?
BTW, you can generate GL shapes using [gf/gl] together with thinly sliced matrices. You make big random matrices with the probability distributions that you want, process them like you want, and then use [#import] and [#to_l] to create small lists, and then messageboxes to construct input for [gf/gl], which is easier to use than the GEMgl classes, most of the time.
[gf/gl] is still made solely for interacting with [gemwin], though one day, it could also be made to work independently of it, as an option.
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC
Hi
Here is a patch that uses random colours in particles although it cycles through colours rather than have each particle coloured individually- have a look at the [part_targetcolor] object for more info?
best
On Mon, Jan 2, 2012 at 9:57 PM, Antonio Roberts antonio@hellocatfood.comwrote:
Can anyone enlighten me on how you would use [part_info] together with [color] to generate randomly coloured particles, with each particle having a randomly generated colour?
--
antonio@hellocatfood.com http://www.hellocatfood.com ============================
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Thanks Alan, that worked perfectly. I think my problem was that I placed [part_targetcolor] in the wrong place in the render chain.
Ant
On 2 January 2012 23:58, ALAN BROOKER alan.brooker2010@gmail.com wrote:
Hi
Here is a patch that uses random colours in particles although it cycles through colours rather than have each particle coloured individually- have a look at the [part_targetcolor] object for more info?
best
On Mon, Jan 2, 2012 at 9:57 PM, Antonio Roberts antonio@hellocatfood.com wrote:
Can anyone enlighten me on how you would use [part_info] together with [color] to generate randomly coloured particles, with each particle having a randomly generated colour?
--
antonio@hellocatfood.com http://www.hellocatfood.com ============================
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-01-02 22:57, Antonio Roberts wrote:
Can anyone enlighten me on how you would use [part_info] together with [color] to generate randomly coloured particles, with each particle having a randomly generated colour?
instead of connecting the 4th outlet of [part_info] directly to [color], use it to trigger the generation of 3 random values, and feed those to [color].
if you want the colors to be persistent (that is: a given particle will have the _same_ random colors in 2 consecutive render cycles), you might want to reset the random generator to a given "seed" for each render cycle. a good time and place to do that would be the bang from a [t a b] right before [part_info].
more interesting things could be acchieved by storing the "random" values in a table (of size partnum) and read those values, starting at 0 for each render cycle (again: derived from the trigger [part_info] receives) and incrementing the counter for each particle (derived from the output of [part_info].
fgamsdr IOhannes