[PD] Randomly coloured particles

IOhannes m zmoelnig zmoelnig at iem.at
Tue Jan 3 09:28:12 CET 2012


-----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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8CvBkACgkQkX2Xpv6ydvSXuQCaAkhlkOIBaqesoAhU5TmfAT5v
rk8An114sualmlFArR8knCh+d0MWz4CD
=nTtU
-----END PGP SIGNATURE-----

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3636 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20120103/83659743/attachment-0001.bin>


More information about the Pd-list mailing list