Skip to content

Amit-Roy/fractal-trees

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Fractal Trees

We implement fractal trees using p5.js and p5.dom.js libraries.

Check it out at: https://amit-roy.github.io/fractal-trees/

The basic tree has the code:

function stickTree(x, y, len, angle) {
    if (len > 10) {
        push();
        translate(x, y);
        rotate(angle * Math.PI / 180);
        line(0, 0, 0, -len);
        stickTree(0, -len, len * 0.8, -25);
        stickTree(0, -len, len * 0.8, 25);
        pop();
    }
}

This is how the Realistic Tree is generated as:

Warning:

The Artistic Tree and Realistic Tree are very computation intensive. You can safely let it complete computation for the former. For the later, please use caution as it may crash the browser. Also, avoid using Firefox.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published