let bg; function setup() { createCanvas(400, 400, WEBGL); bg=createGraphics(400,400); bg.stroke(0); bg.strokeWeight(2.5); for(let i=0;i<1000;i++){ bg.point(random(width),random(height)); } } function draw() { background(245); rotateX(radians(frameCount)); texture(bg); box(100); }