Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- branch <- function(len) {
- line(0, 0, 0, -len);
- translate(0, -len);
- len = len * 0.66;
- if (len > 2) {
- pushMatrix();
- rotate(PI/6);
- branch(len);
- popMatrix();
- pushMatrix();
- rotate(-PI/6);
- branch(len);
- popMatrix();
- }
- }
- settings <- function(){
- size(300, 200)
- }
- draw <- function() {
- background(255);
- theta = map(mouseX,0,width,0,PI/2);
- translate(width/2, height);
- stroke(0);
- branch(60);
- }
- settings()
- draw()
Add Comment
Please, Sign In to add comment