Interactive (as in one can zoom and move around) Mandelbrot set viewer. GPU-rendered with wgpu.
Prerequisites: cargo (rustc version >= 1.56.0), for WASM build wasm-pack, and for dev server go.
It's possible to run either natively or in the browser. It's now only possible to run in the browser.
First step is to clone the repository.
git clone https://github.com/bohjak/mandelbrot
cd mandelbrot
For running in the browser:
- build with wasm-pack;
wasm-pack build --target web
- run server;
go run server.go
- open in browser.
open http://localhost:3000
Note
The server uses server-sent events to reload the page when receiving a request to /sse/reload. It's possible to automatically build the project and reload the page for development convenience.
E.g. with entr:ls src/*.rs | entr -cs 'wasm-pack build --dev --target=web && curl http://localhost:3000/sse/reload'
- Mouse: left-click and drag to move around, scroll-wheel to zoom;
ArrowLeft
/H
/A
: pan left;ArrowDown
/J
/S
: pan down;ArrowUp
/K
/W
: pan up;ArrowRight
/L
/D
: pan right;Ctrl
+ Direction: pan faster;Shift
+ Direction: pan slower;Plus
/Equals
: zoom in;Minus
: zoom out;R
: reset position and zoom level.
Warning
Controls are being reworked, only mouse andR
for reset are functional currently.