MiniMandelbox

February 2019

An explorable WebGL Mandelbox with sound made in 1Kb with @balintcsala for JS1k 2019.

Click to start, move with mouse.

A random scale is chosen at each refresh.

- Github

- Demo

- Commented source code

- making-of

<body id=b>
<canvas id=a width=500 height=500></canvas>
<script>
g=a.getContext('webgl');
for(_='or~f~(|1e-L512KR.JxyHecGunif~m&rocess$(ET-3,#clamp("o=p+e.!cos(a)sin(),a-avG4 =(aton/99/3,,1o.Hzlength();=",-1..)*2.-,o=o*"Jz//,Jz,Jz*4.)+p+=o.movement;void main(){=o=>{with(}`ce(saS(p,s	sS(s=cS(FN++`flo gl_FragCo(-1.)/o.w=;!y&3f(gf(p,`z*=m2(a);;|i in g)g[i[0]+i[6]]=g[i];g)Mh)p=cP(eV(a=A=B=0)prGisi lowp ;& vG3 C,R,QpCe=l~L3,0,0d~d.H/5e2-.5,0o;a=Jx;d.ya=Jy;d.x|i=1.;i>0.;i-=L2){!HyyAHyByHCyyy_;if(<L3){l~i*dot(n~malize(-vG3(A,B,C)Q)-//4.);break;}p+=d*;}	tribute pgl_Positi=p;	lo(pvA(ug(p2,K0,bf#cB()),bD#new Int8Array(m=[1,-3]ET+79)top.document.title=C=2+random(clicknew AudioCtext)creeScriptP$~(K))audiop$|i=K;i--;)o.outputBuffer.getChannelDa(0)[i]=i*_.charCodeAt(B++%99)/9)},cnGt(destini(YQ`A)**A)dr(6,R`a,-A,C3C`...mm[0]+=A)*m[1]-=a)m[2]+=*A)setTimeout(Y,33)})(mousemoveAXaY/3}}';G=/[^ %(-FIM-{}]/.exec(_);)with(_.split(G))_=join(shift());eval(_)</script>


Click to start, then move mouse