Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void recursiveArt(int x, int y, double len, double angle, int steps) {
- // TODO: base case
- if(steps == 0){
- System.out.println("Steps gleich 0");
- canvas.drawLine(x,y,getNewX(x, len, angle),getNewY(y, len, angle),steps);
- //
- //
- }else{
- //System.out.println("Angle: "+angle*i/10);
- canvas.drawLine(x,y,getNewX(x, len, angle*-2),getNewY(y, len, angle*-2),steps);
- canvas.drawLine(x,y,getNewX(x, len, angle*1),getNewY(y, len, angle*1),steps);
- canvas.drawLine(x,y,getNewX(x, len, angle*2),getNewY(y, len, angle*2),steps);
- canvas.drawLine(x,y,getNewX(x, len, angle*-1),getNewY(y, len, angle*-1),steps);
- //
- // canvas.drawLine(x,y,getNewX(x, len, angle*3),getNewY(y, len, angle*3),1);
- //
- // canvas.drawLine(x,y,getNewX(x, len, angle*4),getNewY(y, len, angle*4),1);
- System.out.println("new X: "+getNewX(x, len, angle));
- System.out.println("new Y: "+getNewY(y, len, angle) );
- System.out.println("ANgle: "+angle );
- recursiveArt(getNewX(x,len,angle), getNewY(y,len,angle), getNewLen(len),getNewAngle(angle,openAngle,branches) , --steps);
- System.out.println("Neuer Step");
- }
- // if (steps <= 0){
- // return;
- // }
- //
- //
- // // TODO: standard case, part 1: calculate new x/y and draw a single line
- // // to draw use canvas.drawLine(..., steps);
- // System.out.println(steps);
- //
- // canvas.drawLine(x,y,getNewX(x, len, angle),getNewY(y, len, angle),steps);
- //
- // len = getNewLen(len);
- // getNewX(x, len, angle);
- // getNewY(y, len, angle);
- // angle = getNewAngle(angle, openAngle/branches, steps);
- //
- // recursiveArt(x,y,len, angle, steps-1);
- // recursiveArt(x,y,len, angle, steps-1);
- // recursiveArt(x,y,len, angle, steps-1);
- //
- // //canvas.drawLine(x,y,getNewX(x, len, angle),getNewY(y, len, angle),steps);
- //
- //
- // // TODO: standard case, part 2: calculate startAngle and angleDiff and recur
- }
Advertisement
Add Comment
Please, Sign In to add comment