float ugao = QUARTER_PI; float pomeraj = 0; void setup() { size(600, 400); background(0); stroke(255); } void draw() { background(0); translate(width/2, height); pomeraj = mouseX * QUARTER_PI/width - PI/8; stablo(120, 8); } void stablo(float dim, int n) { line(0, 0, 0, -dim); translate(0, -dim); if (n > 1) { pushMatrix(); rotate(ugao + pomeraj); stablo(2*dim/3, n-1); popMatrix(); pushMatrix(); rotate(-ugao + pomeraj); stablo(2*dim/3, n-1); popMatrix(); } }