-
-
Save ff6347/11214451 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int steps = 7; | |
| int dist; | |
| PVector [] pointset = new PVector [3]; | |
| int points = 1; | |
| int oldx = 0; | |
| int oldy = 0; | |
| int _x = 0; | |
| int _y = 0; | |
| int runs = 2; | |
| void setup (){ | |
| frameRate(1); | |
| size(700, 500); | |
| pointset[0] = new PVector(0,height/2); | |
| smooth(); | |
| dist = width/steps; | |
| stroke(255); | |
| strokeWeight(7); | |
| // for(int x = 0; x <= steps; x++) { | |
| // for(int y = 1; y <= points; y++) { | |
| // int posx = x + x * (width / steps); | |
| // int posy = (height / points) * y - ((height / points) / 2); | |
| // | |
| // line(posx,posy,oldx,oldy); | |
| // | |
| // point(posx, posy ); | |
| // | |
| // oldx = posx; | |
| // oldy = posy; | |
| // | |
| // | |
| // // linie 1: punkt bei 200 | |
| // // linie 2: 2 punkte bei 100 und 300 | |
| // // linie 3: 4 punkte bei 50 / 150 / 250 / 350 | |
| // // linie 4: 8 punkte bei 25 / 75 / 225 ... | |
| // // punkt davor ´-subtrahiert die hälfte (punkt 1) und addiert die hälfte (punkt 2) | |
| // } | |
| // | |
| // points = points * 2; | |
| // | |
| // // line(x + x * (width / steps), 0, x + x * (width / steps), height); | |
| // } | |
| } | |
| void draw() { | |
| dist+= width/steps; | |
| // background(0, 0, 0); | |
| pointset[1] = new PVector(dist, (height/ (runs + 1)) ); | |
| pointset[2] = new PVector(dist, (height/(runs + 1))*2 ); | |
| for(int i = 0; i < pointset.length;i++){ | |
| point(pointset[i].x,pointset[i].y); | |
| } | |
| line(pointset[0].x,pointset[0].y,pointset[1].x,pointset[1].y); | |
| line(pointset[0].x,pointset[0].y,pointset[2].x,pointset[2].y); | |
| pointset[0] = pointset[1]; | |
| runs = runs*2; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment