Last active
June 12, 2019 11:47
-
-
Save simonreeves/1f493ca0dbcdc76a86e1d51217bb7483 to your computer and use it in GitHub Desktop.
#houdini #vex #wrangle
This file contains 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
// point wrangle using 'lage' attribute generated from L-System SOP | |
// looping over points is like doing a promote max sop | |
// get the max by looping over the points | |
float lage_max = 0; | |
// get point count | |
int pc = npoints(0); | |
// loop over points | |
for(int i=0; i < pc; i++) { | |
int result; | |
float pl = pointattrib(0, 'lage', i, result); | |
// update lage_max variable if current value is larger | |
if (pl > lage_max) { | |
lage_max = pl; | |
} | |
} | |
// make attribute | |
f@lage_max = lage_max; | |
// normalise the initial attr | |
float normlaised_lage = fit(@lage, 0, lage_max, 0,1); | |
// do stuff | |
float falloff = chramp('lage_falloff', normlaised_lage); | |
vector n = fit01(noise((v@P * ch('n_scale'))), -1,1) * chv('n_amp'); | |
vector push_base = chv('push_base'); | |
vector push = (push_base + n) * falloff; | |
v@P += push; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment