Skip to content

ayush-seth/fractal-tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Object Oriented Fractal Tree :

This project was made by me as a hobby using the p5.js library. It takes an object oriented approach towards building a fractal tree from branch objects and is built off and inspired from Daniel Shiffmann's p5 projects, it takes its base from his code and extends it providing more customization for you to mess around with and some other features.

See the Fractal Generator in action here.

Instructions:

  • Click on the canvas to proceed to the next generation of the fractal.

  • You can change the branch angle at each generation using the angle box and you can also alter the relative size slider to choose the size of the branch relative to its parent.

  • You can grow and shed leaves, the way the leaves behave when shedded depends on Gravity and Wind which you can alter using the checkboxes in the side panels.

  • You can also change the colour and size of leaves using the options on the side panel.

  • If you end up with a pattern you like, you can save it as an image using the save button.

Some paterns generated using this -

#1

#2

#3

#4(New spiderman logo?)

#5

#6

#7

#8

#9

Why not recursion?

Taking the object oriented approach over the more trivial recursive one allows for much more messing around as each branch is a seperate object. This opens up a lot of possibilities for animations and other stuff which wouldn't be possible with a recursive approach.

About

Takes an object oriented approach at generating a fractal tree using p5.js.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages