Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup(){
- background(0);
- size(720,700);
- smooth();
- }
- void draw(){
- int x1 = ceil(random(0,height/2));
- int y1 = ceil(random(0,width/2));
- int x2 = ceil(random(0,height/2));
- int y2 = ceil(random(0,width/2));
- int x3 = ceil(random(0,height/2));
- int y3 = ceil(random(0,width/2));
- int h = height/2;
- int w = width/2;
- int r = floor(random(1,height));
- if (r > h){
- frameRate(r/2);
- fill(0);
- noStroke();
- }
- else{
- frameRate(r);
- fill(255);
- //stroke(0,0,0,20); //uncomment for more detail
- }
- triangle(w-x1,h-y1, w-x2, h-y2, w-x3, h-y3);
- triangle(w+x1,h-y1, w+x2, h-y2, w+x3, h-y3);
- triangle(w-x1,h+y1, w-x2, h+y2, w-x3, h+y3);
- triangle(w+x1,h+y1, w+x2, h+y2, w+x3, h+y3);
- }
Add Comment
Please, Sign In to add comment