letw,n;letc=[0,5,15];leta=[];functionsetup(){cnv=createCanvas((w=500),w,WEBGL);noStroke();a=[];describe("a pebble texture that moves, but is drawn with shades of black");for(leti=0;i<5000;i++){a[i]={x:random(-w/2,w/2),y:random(-w/2,w/2),z:random(-w/2,w/2),r:random(-w/20,w/20),r1:random(-10,10),m:random(-1,1)};}}functiondraw(){strokeWeight(5);t=frameCount/100;n=int(random(40,60));background(c[0],c[1],c[2]);pointLight(c[0]+15,c[1]+15,c[2]+15,-1600,1600,1600);pointLight(c[0]+25,c[1]+25,c[2]+25,1600,1600,-1600);orbitControl();for(leti=0;i<a.length;i++){r1=random(-10,10);specularMaterial(c[0]+a[i].r1,c[1]+a[i].r1,c[2]+a[i].r1,100);push();letx=a[i].x+a[i].r*sin(t*a[i].m+a[i].r);lety=a[i].y+a[i].r*cos(t*a[i].m+a[i].r);letz=a[i].z+a[i].r*sin(t*a[i].m+a[i].r)*cos(t*a[i].m);translate(x,y,z);sphere(4+10*abs(sin(x/50+t-y/60)*cos(x/60+t-y/20)));pop();}}