Created
June 18, 2018 20:11
-
-
Save mimetaur/28ffc1f8f48438362b15db922f95ea20 to your computer and use it in GitHub Desktop.
contents of week 02 / sketch 07 / attributewrangle1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int seed = set(ch("seed")); | |
| float strength = ch("strength"); | |
| // trying out smoothing between two random values | |
| float smoothedRand = smooth(random(seed + @pointnum),random(seed + @pointnum+1), 0.5); | |
| // moving random from 0 to 1 to -0.5 to 0.5 | |
| float equalized = 0.5 -smoothedRand; | |
| // y pos displaced based to rand * strength param | |
| float randomDisplace = smoothedRand * strength; | |
| @P.y += randomDisplace; | |
| // using the same rand value to scale the particles | |
| @pscale = fit(smoothedRand, 0, 1, 0, 3); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment