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
// User parameters added to attribute wrangle parameter interface | |
int walkers = chi("walkers"); | |
int steps = chi("steps"); // Placing $F in steps, each walker will grow during playback | |
vector step = chv("step"); | |
int connectPoints = chi("connect"); | |
vector direct = {0,1,0}; | |
vector offset = 0.5; | |
vector rand = 0.0; | |
vector stepinc = 0.0; | |
for (int j = 0; j < walkers; j++){ | |
rand = 0.0; | |
for(int i = 0; i < steps; i++){ | |
direct = rand(i) - offset; | |
stepinc = rand(i) + step; | |
rand += direct * (random(i+j) - offset) * stepinc; | |
vector newPos = rand; | |
i@pt = addpoint(geoself(), newPos); | |
if(connectPoints && i > 0){ | |
int prim = addprim(geoself(), "polyline"); | |
addvertex(geoself(), prim, @pt-1); | |
addvertex(geoself(), prim, @pt); | |
} | |
} | |
} |