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.
To run the code locally, follow these steps:
- Clone this repository to your local machine.
- Open the
index.html
file in a web browser.
To run the code, you need a web browser that supports HTML5 and JavaScript.
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!
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.
Contributions to this project are welcome! If you have any ideas, suggestions, or improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.
- The p5.js library: p5.js
- Inspiration and guidance from the creative coding community.