Advertisement
Sta99ot

Processing Fly Thingy

Dec 24th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. void setup()
  2. {
  3.   size(1600,900,P3D);  
  4. }
  5. float zoff = 0;
  6. void draw()
  7. {
  8.   strokeWeight(2);
  9.   background(0);
  10.   zoff -= 0.5f;
  11.   noFill();
  12.   translate(0,height/3);
  13.   rotateX(PI/3);
  14.   for(int z=0;z<50;z++)
  15.   {
  16.     stroke(lerpColor(color(255,100,255),color(255,0,255),(float)z/49.0));
  17.     beginShape(TRIANGLE_STRIP);
  18.     for(int x = 0;x<50 + 1;x++)
  19.     {
  20.       vertex(x * width/50,z * height/50,height/4.0 * noise((x) * 0.1, (z + zoff) * 0.1));
  21.       vertex(x * width/50,(z + 1) * height/50,height/4.0 * noise((x) * 0.1, (z + 1 + zoff) * 0.1));
  22.     }
  23.     endShape();
  24.   }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement