memoscan
← all memos

Memo 0xeac36bcd…822b72 on Ethereum

r(x+0.5); vec3 a0=x-ox; m*=1.79284291400159-0.85373472095314*(a0*a0+h*h); vec3 g=vec3(0.0); g.x=a0.x*x0.x+h.x*x0.y; g.yz=a0.yz*vec2(x1.x,x2.x)+h.yz*vec2(x1.y,x2.y); return 130.0*dot(m,g);} vec2 rotateUV(vec2 uv,float rotation) {return vec2(cos(rotation)*(uv.x-0.5)+sin(rotation)*(uv.y-0.5)+0.5,cos(rotation)*(uv.y-0.5)-sin(rotation)*(uv.x-0.5)+0.5);} float SmoothStep(float edge0,float edge1,float x){float t=clamp((x-edge0) / (edge1-edge0),0.0,1.0); return t;} void main() {vec2 st=vTexCoord; vec2 st_1=st; vec2 st_2=st; vec2 st_3=st; vec2 st_4=st; vec2 st_5=st; vec2 st_6=st; vec3 color=vec3(0.0); st_1=rotateUV(st,LR1.x); st_1.x+=cos(st_1.y*dA1.x)/df1.x; st_1.y+=sin(st_1.x*dA1.x)/df1.x; float pos_1=st_1.x*LF1.x; float y=0.; float x=pos_1; y=sin((x+Ld.z)*Ld.y); y+=sin((x+Ld.z)*Ld.y*2.1+Ld.w)*4.5; y+=sin((x+Ld.z)*Ld.y*1.72+Ld.w*1.121)*4.0; y+=sin((x+Ld.z)*Ld.y*2.221+Ld.w*0.437)*5.0; y+=sin((x+Ld.z)*Ld.y*3.1122+Ld.w*4.269)*2.5; y*=Ld.x*0.06; pos_1=pos_1+y; float colL_1=wb1.x*bb1.x*((cos(pos_1*2.*3.14)+1.)/2.)-bb1.x+1.; float colLC_1=clamp(colL_1,0.090,1.0); vec2 posN_1=st*Nf1.x; float colN_1=(snoise(posN_1)*.5+.5); float colNC_1=smoothstep(Nn1.x,Nx1.x,colN_1); st_2=rotateUV(st_2,LR1.y); st_2.x+=cos(st_2.y*dA1.y)/df1.y; st_2.y+=sin(st_2.x*dA1.y)/df1.y; float pos_2=st_2.x*LF1.y; float colL_2=wb1.y*bb1.y*((cos(pos_2*2.*3.14)+1.)/2.)-bb1.y+1.; float colLC_2=clamp(colL_2,0.090,1.0); vec2 posN_2=st_2*Nf1.y; float colN_2=(snoise(posN_2)*.5+.5); float colNC_2=smoothstep(Nn1.y,Nx1.y,colN_2); st_3=rotateUV(st_3,LR1.z); st_3.x+=cos(st_3.y*dA1.z)/df1.z; st_3.y+=sin(st_3.x*dA1.z)/df1.z; float pos_3=st_3.x*LF1.z; float colL_3=wb1.z*bb1.z*((cos(pos_3*2.*3.14)+1.)/2.)-bb1.z+1.; float colLC_3=clamp(colL_3,0.090,1.0); vec2 posN_3=st_3*Nf1.z; float colN_3=(snoise(posN_3)*.5+.5); float colNC_3=smoothstep(Nn1.z,Nx1.z,colN_3); st_4=rotateUV(st_4,LR1.w); st_4.x+=cos(st_4.y*dA1.w)/df1.w; st_4.y+=sin(st_4.x*dA1.w)/df1.w; float pos_4=st_4.x*LF1.w; float colL_4=wb1.w*bb1.w*((cos(pos_4*2.*3.14)+1.)/2.)-bb1.w+1.; float colLC_4=clamp(colL_4,0.090,1.0); vec2 posN_4=st_4*Nf1.w; float colN_4=(snoise(posN_4)*.5+.5); float colNC_4=smoothstep(Nn1.w,Nx1.w,colN_4); st_5=rotateUV(st_5,LR2.x); st_5.x+=cos(st_5.y*dA2.x)/df2.x; st_5.y+=sin(st_5.x*dA2.x)/df2.x; float pos_5=st_5.x*LF2.x; float colL_5=wb2.x*bb2.x*((cos(pos_5*2.*3.14)+1.)/2.)-bb2.x+1.; float colLC_5=clamp(colL_5,0.090,1.0); vec2 posN_5=st_5*Nf2.x; float colN_5=(snoise(posN_5)*.5+.5); float colNC_5=smoothstep(Nn2.x,Nx2.x,colN_5); vec2 posN_6=st_6*Nf2.y; float colN_6=(snoise(posN_6)*.5+.5); float colNC_6=smoothstep(Nn2.y,Nx2.y,colN_6); if(indx==1.0){colNC_5=colNC_5+colNC_2; colNC_4=colNC_4+colNC_3; colNC_1=0.108*(colNC_6-0.)+colNC_1; colNC_2=0.292*(colNC_6-0.)+colNC_2; colNC_3=-0.448*(-colNC_6+0.024)+colNC_3;}else if (indx==2.0){colNC_5=colNC_5+colNC_2; colNC_4=1.; colNC_3=0.664*colNC_6+colNC_3; colNC_2=1.664*colNC_6+colNC_2; colNC_1=1.;}else if (indx==3.0){colNC_5=colNC_5+colNC_3; colNC_4=0.032*colNC_6+colNC_4; colNC_3=0.712*colNC_6+colNC_3; colNC_1=0.672*colNC_6+colNC_1;}else if (indx==4.0){colNC_5=colNC_5+colNC_3; colNC_3=1.680*colNC_5+colNC_3-1.; colNC_4=0.784*colNC_6+colNC_4; colNC_3=0.736*colNC_6+colNC_3; colNC_1=-0.016*colNC_6+colNC_1;}else if (indx==5.0){colNC_5=colNC_5+colNC_3; colNC_4=0.016*colNC_6+colNC_4; colNC_3=0.000*colNC_6+colNC_3; colNC_2=0.328*colNC_6+colNC_2; colNC_1=0.992*(colNC_6-0.024)+colNC_1;}else if (indx==6.0){colNC_5=colNC_5+colNC_3;}else if (indx==7.0){colNC_5=colNC_5+colNC_3;}else if (indx==8.0){colNC_5=colNC_5+colNC_3;} float colB_1=BlendScreen(colNC_1,colLC_1); float colB_2=BlendScreen(colNC_2,colLC_2); float colB_3=BlendScreen(colNC_3,colLC_3); float colB_4=BlendScreen(colNC_4,colLC_4); float colB_5=BlendScreen(colNC_5,colLC_5); float colF_1=SmoothStep(cBlend,1.,colB_1); float colF_2=SmoothStep(cBlend,1.,colB_2); float colF_3=SmoothStep(cBlend,1.,colB_3); float colF_4=SmoothStep(cBlend,1.,colB_4); float colF_5=SmoothStep(cBlend,1.,colB_5); float colF=min(colF_1,colF_2); colF=min(colF,colF_3); colF=min(colF,colF_4); colF=min(colF,colF_5); color=vec3(colF); gl_FragColor=vec4(color,1.0);} ",angle=Math.PI/3,defaultZoom=1.15,zoom=1.15,zoomStart=1.15,zoomTarg=1.15,v=0,vStart=0,vTarg=0,ratio=0,camSpeed=.02,easing=.05,initCamAngle=R.random_int(0,5)*angle,cam=[initCamAngle.PI/6,initCamAngle,initCamAngle],camStart=[0,0,0],camTarg=[0,0,0],rx1=1+R.random_dec()/100,ry1=1+R.random_dec()/100,rz1=1+R.random_dec()/100,rx2=1+R.random_dec()/100,ry2=1+R.random_dec()/100,rz2=1+R.random_dec()/100,rx3=1+R.random_dec()/100,ry3=1+R.random_dec()/100,rz3=1+R.random_dec()/100;class Go3d{constructor(e,t,r,o,a,s,c,n,i,l){if(this.verts=[],this.faces=[],this.faceIndx=[],this.gScale=a,this.x=0,this.y=0,this.z=0,this.center=new p5.Vector,this.ballCenter1=new p5.Vector,this.ballCenter2=new p5.Vector,1==e){this.x=t,this.y=r,this.z=o,this.verts[0]=createVector(0,0,0),this.verts[1]=createVector(-.548,1.097,1.687),this.verts[2]=createVector(1.226,0,1.687),this.verts[3]=createVector(1.226,1.984,1.687),this.verts[4]=createVector(1.774,.887,0),this.verts[5]=createVector(0,1.984,0),this.verts[6]=createVector(-.548,-.887,1.688),this.verts[7]=createVector(1.774,2.87,-0);for(let e=0;e<this.verts.length;e++)this.verts[e].x=this.verts[e].x*this.gScale+this.x,this.verts[e].y=this.verts[e].y*this.gScale+this.y,this.verts[e].z=this.verts[e].z*this.gScale+this.z;this.faceIndx=[[0,1,2],[3,5,4],[0,5,1],[5,3,1],[1,3,2],[2,3,4],[0,2,4],[0,4,5]]}else if(2==e){let e,t=new Face(c.facePts[0],c.facePts[1],c.facePts[2]);e=n;for(let r=0;r<8;r++)this.verts[r]=reflect3d(e.verts[r],t);for(let t=0;t<8;t++)this.faceIndx.push([e.faceIndx[t][0],e.faceIndx[t][2],e.faceIndx[t][1]])}else if(3==e){let e=i,t=l,r=n;for(let o=0;o<8;o++)this.verts[o]=scale3d(r.verts[o],e,t);for(let e=0;e<8;e++)this.faceIndx.push([r.faceIndx[e][0],r.faceIndx[e][1],r.faceIndx[e][2]])}this.ballCenter1=this.verts[6],this.ballCenter2=this.verts[7],this.center=vertex_average([this.verts[0],this.verts[1],this.verts[2],this.verts[3],this.verts[4],this.verts[5]]);for(let e=0;e<8;e++){let t;t=e<2?"e":"i",this.faces.push(new Face(this.verts[this.faceIndx[e][0]],this.verts[this.faceIndx[e][1]],this.verts[this.faceIndx[e][2]],t))}}}class Grid_Rhomb{constructor(e,t,r,o){this.gPts=[],this.gIndx=[],this.vecNum=3,this.moveVectors=new p5.Vector(2*this.vecNum),this.moveVectorsIndx=new Array(2*this.vecNum),this.gVectors=new p5.Vector,this.w=e,this.h=t,this.l=r,this.gridScale=o,this.moveVectorSize=2*this.vecNum,this.gVectors=this.findDodecaVectors();for(let e=0;e<20;e++)this.gVectors[e].mult(2);this.moveVectors[0]=this.gVectors[0],this.moveVectors[1]=this.gVectors[1],this.moveVectors[2]=this.gVectors[10],this.moveVectors[3]=this.gVectors[17],this.moveVectors[4]=this.gVectors[18],this.moveVectors[5]=this.gVectors[8],this.moveVectorsIndx[0]=0,this.moveVectorsIndx[1]=1,this.moveVectorsIndx[2]=10,this.moveVectorsIndx[3]=17,this.moveVectorsIndx[4]=18,this.moveVectorsIndx[5]=8;for(let e=0;e<this.l;e++){this.gPts[e]=[],this.gIndx[e]=[];for(let t=0;t<this.w;t++){this.gPts[e][t]=[],this.gIndx[e][t]=[];for(let r=0;r<this.h;r++){let o=new p5.Vector(this.moveVectors[0].x,this.moveVectors[0].y,this.moveVectors[0].z),a=new p5.Vector(this.moveVectors[1].x,this.moveVectors[1].y,this.moveVectors[1].z),s=new p5.Vector(this.moveVectors[2].x,this.moveVectors[2].y,this.moveVectors[2].z),c=.5*this.w;o.mult((e-c)*this.gridScale),a.mult((t-c)*this.gridScale),s.mult((r-c)*this.gridScale);let n=new p5.Vector(0,0,0);n.add(o),n.add(a),n.add(s),this.gPts[e][t][r]=new p5.Vector(n.x,n.y,n.z),this.gIndx[e][t][r]=new p5.Vector(e,t,r)}}}}findDodecaVectors(){let e=[],t=[],r=52.6226359,o=10.81231754,a=1,s=PI*r/180,c=PI*o/180,n=PI*-o/180,i=PI*-r/180,l=72*PI/180,m=l/2,h=0,d=createVector(0,0,0);for(let e=0;e<5;e++)t[e]=[],t[e][0]=a*cos(h)*cos(s),t[e][1]=a*sin(h)*cos(s),t[e][2]=a*sin(s),t.push(d),h+=l;h=0;for(let e=5;e<10;e++)t[e]=[],t[e][0]=a*cos(h)*cos(c),t[e][1]=a*sin(h)*cos(c),t[e][2]=a*sin(c),h+=l;h=m;for(let e=10;e<15;e++)t[e]=[],t[e][0]=a*cos(h)*cos(n),t[e][1]=a*sin(h)*cos(n),t[e][2]=a*sin(n),h+=l;h=m;for(let e=15;e<20;e++)t[e]=[],t[e][0]=a*cos(h)*cos(i),t[e][1]=a*sin(h)*cos(i),t[e][2]=a*sin(i),h+=l;for(let r=0;r<20;r++)e.push(new p5.Vector(t[r][0],t[r][1],t[r][2]));return e}}class GrowSys{constructor(e){this.gens=e,this.gen1=0}growToTarget(e){let t=e,r=!0,o=currGo,a=o.verts[3].dist(o.verts[0]),s=0;for(;1==r;){s+=1,o=currGo;let e=o.center.dist(t);if(e>a&&s<199){let e=[];e=this.growByBall(o,t);let r,a=99,s=9999;for(let o=0;o<e.length;o++){let c=e[o];r=c.center.dist(t),r<s&&(s=r,a=o),go.push(c)}currGo=e[a]}else r=!1,go=this.remDups(go),this.gen1=go.length,1==DECORATE&&this.decorate(),go=this.remDups(go)}}growByBall(e,t){let r=[],o=e,a=t,s=99;return s=o.faces[0].center.dist(a)<=o.faces[1].center.dist(a)?0:1,r=this.render(Lstring,o,s),r}decorate(){let e=go.length;for(let t=0;t<=this.gens;t++){for(let t=currArraySize;t<e;t++){let e=[],r=0;if(rand=R.random_dec(),rand>growth_percent){let o,a=go[t];rand1=R1.random_dec(),rand1>growth_type_ratio?(o=a.ballCenter1,r=0):(o=a.ballCenter2,r=3);let s=0,c=go[0].center.dist(go[0].faces[0].center);for(let e=0;e<go.length;e++)go[e].center.dist(o)<c&&(s=1);if(0==s){go.push(new Go3d(3,void 0,void 0,void 0,void 0,void 0,void 0,a,o,.5)),a=go[go.length-1];let t=!0,s="",c=0;for(;1==t;){rand2=R2.random_dec();let e=small_death_chance;rand2>e?(s+="f",c+=1,c>=4&&(s+="+",c=0),rand3=R3.random_dec(),e=.98,rand3>e&&(s+="/",c=0)):t=!1}e=this.render(s,a,r),e=this.remDups(e),e=this.remFaces(e);for(let t=0;t<e.length;t++)go.push(e[t])}}}currArraySize=e,e=go.length}}remDups(e){for(let t=0;t<e.length;t++){let r=e[t];for(let o=0;o<e.length;o++)if(o!=t){let t;t=e[o],r.center.dist(t.center)<.1&&e.splice(o,1)}}return e}remFaces(e){for(let t=0;t<e.length;t++){e[t];for(let r=0;r<e.length;r++)if(r!=t)for(let o=0;o<e[t].faces.length;o++){let a=e[t].faces[o].center;for(let s=0;s<e[r].faces.length;s++)if(a.dist(e[r].faces[s].center)<.1){e[t].faces.splice(o,1),e[r].faces.splice(s,1);break}}}return e}render(e,t,r