Skip to content

Instantly share code, notes, and snippets.

@lizkhoo
Created September 26, 2012 12:33
Show Gist options
  • Save lizkhoo/3787765 to your computer and use it in GitHub Desktop.
Save lizkhoo/3787765 to your computer and use it in GitHub Desktop.
Grass
int ax = -20;
int ay = -20;
int bx = 0;
int by = 0;
int cx = -10;
int cy = 60;
int dx = 0;
int dy = 60;
void setup(){
size(500,500);
background(255);
}
void draw(){
strokeWeight(3);
for (int i = 0; i < width+20; i+=10){
for (int u = 0; u < height; u+=20){
stroke(0, random(90,200), random(90,200));
bezier(ax+i, ay+u*2, bx+i, by+u*2, cx+i, cy+u*2, dx+i,dy+u*2);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment