// Pressing Control-R will render this sketch. void setup() { // this is run once. // set the background color background(255); size(200, 200); smooth(); frameRate(30); strokeWeight(10); } float off = 0; void draw() { // this is run repeatedly. background(255); pushMatrix(); translate(120,0); rotate(3.14 / 4); off += .1; for(float x1 = 0; x1 < 120; x1++){ float x2 = x1 + 1; float a1 = off + x1 / 40; float a2 = off + x2 / 40; float y1 = 20 * sin(a1); float y2 = 20 * sin(a2); if((x1 +1) % 31 == 0){ stroke(255,0,0); line(x1,100,x2,y2+100); line(x1,100,x2,-y2+100); } stroke(128); line(x1,y1+100,x2,y2+100); line(x1,-y1+100,x2,-y2+100); } popMatrix(); }