Skip to main content
100%

Fork of Tree Fractal

✓ Published0🌍 Public
SSuchayan
Last edited Feb 11, 2022
Created on Feb 11, 2022
Forked from Tree Fractal

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 description

Interactive 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

Similar vizzes