"Fractal Tree - copie" - Processing

ID Autor Duplicat din Ultima modificare
#4152 Apahidean Luca (grophousDot) Fractal Tree Luni, 07 dec 2020, 14:53
x
 
1
2
function setup() {
3
    createCanvas(400, 400);
4
    background(0);
5
    
6
}
7
8
function draw() {
9
    
10
  stroke(255);
11
  strokeWeight(1);
12
  draw_line(200,400,PI,80);
13
  noLoop();
14
}
15
16
function draw_line(x,y,angle,lenght)
17
{
18
    
19
  push();
20
  translate(x,y);
21
  rotate(angle);
22
  line(0,0,0,lenght);
23
  
24
    
25
  if(lenght > 0)
26
  {
27
   draw_line(0,lenght,PI/10,lenght-10);
28
   draw_line(0,lenght,-PI/10,lenght-10);
29
  }
30
  pop();
31
}
32
Du-te sus!