Fork of Tree Fractal
✓ Published0🌍 Public
An interactive tree fractal drawn on a Canvas element responds to mouse movement. The branching depth and angle of successive branches are controlled by the cursor's horizontal and vertical position, altering the fractal's shape in real time. The code uses the Canvas 2D API with `beginPath`, `lineTo`, and `stroke` to render each line, and accounts for high-resolution displays by scaling the drawing context with `devicePixelRatio`. It recursively draws branching lines from a central trunk.
AI-generated descriptionInteractive tree fractal with Canvas.
Move the mouse to change the branching!
Draws from HTML5 Examples.
Extended to use high resolution Canvas for high pixel density displays.
MIT Licensed