Skip to content

The fractal tree code generates stunning branching patterns using JavaScript and p5.js. By adjusting the sliders, users can interactively modify the rotation angles of the branches, resulting in mesmerizing visuals reminiscent of natural trees.

Notifications You must be signed in to change notification settings

shyamalkirpan/fractalTree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Branching Patterns with JavaScript and p5.js

This repository contains a JavaScript code snippet that generates mesmerizing branching patterns using the p5.js library. By adjusting the sliders, you can create captivating visuals reminiscent of natural tree structures.

Getting Started

To run the code locally, follow these steps:

  1. Clone this repository to your local machine.
  2. Open the index.html file in a web browser.

Prerequisites

To run the code, you need a web browser that supports HTML5 and JavaScript.

Usage

Once the code is running in your browser, you will see a canvas with sliders and a branching pattern. The sliders control the rotation angles of the branches, allowing you to interactively modify the visual output. Experiment with different angles to create your own unique patterns!

Code Explanation

The main code is written in JavaScript using the p5.js library, which provides an easy-to-use framework for creative coding and visualization. The setup function initializes the canvas and sliders, while the draw function continuously updates the canvas and draws the branching pattern. The branch function is a recursive function responsible for drawing the branches.

Contributing

Contributions to this project are welcome! If you have any ideas, suggestions, or improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Acknowledgments

  • The p5.js library: p5.js
  • Inspiration and guidance from the creative coding community.

About

The fractal tree code generates stunning branching patterns using JavaScript and p5.js. By adjusting the sliders, users can interactively modify the rotation angles of the branches, resulting in mesmerizing visuals reminiscent of natural trees.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published