memoscan
← all memos

Memo 0x35e2b45f…4ea52c on Ethereum

const F3=1/3,G3=1/6,fastFloor=e=>0|Math.floor(e),grad3=new Float64Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]);function createNoise3D(e=Math.random){const t=buildPermutationTable(e),o=new Float64Array(t).map(e=>grad3[e%12*3]),n=new Float64Array(t).map(e=>grad3[e%12*3+1]),r=new Float64Array(t).map(e=>grad3[e%12*3+2]);return function(e,i,s){let a,l,c,d;const f=(e+i+s)*F3,m=fastFloor(e+f),w=fastFloor(i+f),u=fastFloor(s+f),y=(m+w+u)*G3,h=e-(m-y),p=i-(w-y),x=s-(u-y);let F,g,G,b,A,O;h>=p?p>=x?(F=1,g=0,G=0,b=1,A=1,O=0):h>=x?(F=1,g=0,G=0,b=1,A=0,O=1):(F=0,g=0,G=1,b=1,A=0,O=1):p<x?(F=0,g=0,G=1,b=0,A=1,O=1):h<x?(F=0,g=1,G=0,b=0,A=1,O=1):(F=0,g=1,G=0,b=1,A=1,O=0);const H=h-F+G3,D=p-g+G3,M=x-G+G3,k=h-b+2*G3,B=p-A+2*G3,P=x-O+2*G3,W=h-1+3*G3,$=p-1+3*G3,v=x-1+3*G3,C=255&m,E=255&w,I=255&u;let N=.6-h*h-p*p-x*x;if(N<0)a=0;else{const e=C+t[E+t[I]];a=(N*=N)*N*(o[e]*h+n[e]*p+r[e]*x)}let T=.6-H*H-D*D-M*M;if(T<0)l=0;else{const e=C+F+t[E+g+t[I+G]];l=(T*=T)*T*(o[e]*H+n[e]*D+r[e]*M)}let U=.6-k*k-B*B-P*P;if(U<0)c=0;else{const e=C+b+t[E+A+t[I+O]];c=(U*=U)*U*(o[e]*k+n[e]*B+r[e]*P)}let R=.6-W*W-$*$-v*v;if(R<0)d=0;else{const e=C+1+t[E+1+t[I+1]];d=(R*=R)*R*(o[e]*W+n[e]*$+r[e]*v)}return 32*(a+l+c+d)}}function buildPermutationTable(e){const t=new Uint8Array(512);for(let e=0;e<256;e++)t[e]=e;for(let o=0;o<255;o++){const n=o+~~(e()*(256-o)),r=t[o];t[o]=t[n],t[n]=r}for(let e=256;e<512;e++)t[e]=t[e-256];return t}p5.disableFriendlyErrors=!0,w=500,h=333;const truew=Math.min(window.innerWidth>3*window.innerHeight/2?3*window.innerHeight/2:innerWidth,500),trueh=Math.min(window.innerWidth>3*window.innerHeight/2?window.innerHeight:2*window.innerWidth/3,333),s=w*h,posx=Uint8Array.from({length:s},(e,t)=>t%w),posy=Float32Array.from({length:s},(e,t)=>t/w);let x,y,i=0,t=0,m=0;const noise3D=createNoise3D();let complexity=0,resolution=0,colorBase=0,colorOffset=0,aOffset=0,bOffset=0;function setup(){if("undefined"!=typeof blockHash){const e=`${tokenId}${blockHash.slice(0,10)}`;randomSeed(e)}createCanvas(w,h),pixelDensity(1),frameRate(24),complexity=random(30,60),resolution=random(4,8),colorBase=random(1,200),colorOffset=random(55,60),aOffset=random(0,4e3),bOffset=random(0,4e3);const e=document.getElementById("defaultCanvas0");e.style.height=`${trueh}px`,e.style.width=`${truew}px`}function draw(){background("#000"),t++;const e=Float32Array.from(posx,e=>e/complexity),o=Float32Array.from(posy,e=>e/complexity);for(loadPixels(),i=0;++i<s;){const n=Math.round(noise3D(e[i],o[i],t/complexity+m++%2)*resolution);x=posx[i]+n+aOffset,y=posy[i]+n,index=x+y*w<<2,c=colorBase+pixels[index],pixels[index]=c,pixels[index+1]=c<<colorOffset%255,pixels[index+2]=c<<(colorOffset+1)%255}updatePixels()}