Skip to content

Instantly share code, notes, and snippets.

@nulltask
Created July 16, 2014 06:26
Show Gist options
  • Select an option

  • Save nulltask/ec6d0b309b19aae73013 to your computer and use it in GitHub Desktop.

Select an option

Save nulltask/ec6d0b309b19aae73013 to your computer and use it in GitHub Desktop.
float xoff = 0.0;
float yoff = 0.0;
void setup() {
size(600, 600);
}
void draw() {
noStroke();
fill(255, 255, 255);
rect(0, 0, width, height);
stroke(192);
JSONArray values = new JSONArray();
int length = (int)random(8192);
for (int i = 0; i < length; ++i) {
xoff += 0.001;
yoff += 0.001;
float x = noise(xoff, yoff);
float y = noise(xoff);
values.append(x);
values.append(y);
point(x * height, y * width);
}
saveJSONArray(values, "data/" + frameCount + ".json");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment