- Author:
- notcub
- Twitter:
- @
- GitHub:
- Facebook:
- Google+:
- +
- Reddit:
- /r/
- Pouet:
- Website:
- Compo:
- classic
- Demo link:
- https://js1k.com/2010-first/demo/361
- Shortlink:
- https://js1k.com/361
- Blog post:
- please update here!
- Bytes:
- 748
- Chars:
- 748
- Submission
f=Math; C=f.cos; S=f.sin; _=document.body; _.style.background="#000"; e=_.children[0]; e.width=w=innerWidth-10; e.height=h=innerHeight-25; g=e.getContext("2d"); t=w/h;
with(g){
scale(w*0.5/t,h*0.5); translate(1*t,1); globalCompositeOperation="lighter"; lw=1/h; x=y=z=d=c=0;
R=function(p,q,r){return [p*C(r)-q*S(r),p*S(r)+q*C(r)]; }
setInterval(function(){if(++c%250==0){clearRect(-t,-1,2*t,2)}x=S(c/83+2.1); y=S(c/101+3); z=S(c/79+0.9); P=[]; for(i=0;i<4;++i){s=R((i%2)-0.5,(i/2&1)-0.5,x); k=R(s[1],((i/2^i)&1)-0.5,y); u=R(k[1],s[0],z); k[0]+=2; P[2*i]=u[0]/k[0]; P[2*i+1]=u[1]/k[0];}
for(i=0;i<4;++i)for(j=i;j<4;++j){beginPath(); lineWidth=2/h; moveTo(P[2*i],P[2*i+1]); lineTo(P[2*j],P[2*j+1]); strokeStyle="rgb(10,20,30);"; stroke();}},33)}
- Description
- Spins a pyramid, with blue->white additive compositing effect.
Now works on Firefox.
- Base64 encoded
Zj1NYXRoOyBDPWYuY29zOyBTPWYuc2luOyBfPWRvY3VtZW50LmJvZHk7IF8uc3R5bGUuYmFja2dyb3VuZD0iIzAwMCI7IGU9Xy5jaGlsZHJlblswXTsgZS53aWR0aD13PWlubmVyV2lkdGgtMTA7IGUuaGVpZ2h0PWg9aW5uZXJIZWlnaHQtMjU7IGc9ZS5nZXRDb250ZXh0KCIyZCIpOyB0PXcvaDsNCndpdGgoZyl7DQpzY2FsZSh3KjAuNS90LGgqMC41KTsgdHJhbnNsYXRlKDEqdCwxKTsgZ2xvYmFsQ29tcG9zaXRlT3BlcmF0aW9uPSJsaWdodGVyIjsgbHc9MS9oOyB4PXk9ej1kPWM9MDsNClI9ZnVuY3Rpb24ocCxxLHIpe3JldHVybiBbcCpDKHIpLXEqUyhyKSxwKlMocikrcSpDKHIpXTsgfSANCnNldEludGVydmFsKGZ1bmN0aW9uKCl7aWYoKytjJTI1MD09MCl7Y2xlYXJSZWN0KC10LC0xLDIqdCwyKX14PVMoYy84MysyLjEpOyB5PVMoYy8xMDErMyk7IHo9UyhjLzc5KzAuOSk7IFA9W107IGZvcihpPTA7aTw0OysraSl7cz1SKChpJTIpLTAuNSwoaS8yJjEpLTAuNSx4KTsgaz1SKHNbMV0sKChpLzJeaSkmMSktMC41LHkpOyB1PVIoa1sxXSxzWzBdLHopOyBrWzBdKz0yOyBQWzIqaV09dVswXS9rWzBdOyBQWzIqaSsxXT11WzFdL2tbMF07fQ0KZm9yKGk9MDtpPDQ7KytpKWZvcihqPWk7ajw0Oysrail7YmVnaW5QYXRoKCk7IGxpbmVXaWR0aD0yL2g7IG1vdmVUbyhQWzIqaV0sUFsyKmkrMV0pOyBsaW5lVG8oUFsyKmpdLFBbMipqKzFdKTsgc3Ryb2tlU3R5bGU9InJnYigxMCwyMCwzMCk7Ijsgc3Ryb2tlKCk7fX0sMzMpfQ==
- Original source
f=Math; C=f.cos; S=f.sin; _=document.body; _.style.background="#000"; e=_.children[0]; e.width=w=innerWidth-10; e.height=h=innerHeight-25; g=e.getContext("2d"); t=w/h;
with(g){
scale(w*0.5/t,h*0.5); translate(1*t,1); globalCompositeOperation="lighter"; lw=1/h; x=y=z=d=c=0;
R=function(p,q,r){return [p*C(r)-q*S(r),p*S(r)+q*C(r)]; }
setInterval(function(){if(++c%250==0){clearRect(-t,-1,2*t,2)}x=S(c/83+2.1); y=S(c/101+3); z=S(c/79+0.9); P=[]; for(i=0;i<4;++i){s=R((i%2)-0.5,(i/2&1)-0.5,x); k=R(s[1],((i/2^i)&1)-0.5,y); u=R(k[1],s[0],z); k[0]+=2; P[2*i]=u[0]/k[0]; P[2*i+1]=u[1]/k[0];}
for(i=0;i<4;++i)for(j=i;j<4;++j){beginPath(); lineWidth=2/h; moveTo(P[2*i],P[2*i+1]); lineTo(P[2*j],P[2*j+1]); strokeStyle="rgb(10,20,30);"; stroke();}},33)}