xxxxxxxxxx
35
const CYCLE = 100;
let tex;
function setup() {
createCanvas(windowWidth, windowHeight,WEBGL);
let s = min(windowWidth,windowHeight);
tex = createGraphics(s*2,s*2);
tex.noFill();
tex.background('#ff69b4');
texture(tex);
noStroke();
}
function draw() {
background('#ABCDEF');
// orbitControl();
//texture
let fc = (frameCount % CYCLE)/CYCLE;
let step = (tex.width)/20;
//tex.clear();
tex.background(150, 10);
tex.stroke('#df006f');
tex.strokeWeight(step/10);
for(let x = step*(- 3) ; x < tex.width + step*5; x+=step){
tex.beginShape();
for(let y = 0; y <= tex.height; y+=5){
let r = map(y,0,tex.height, 0, TAU*3) + fc*TAU;
tex.vertex(x + sin(r)*step*(1 + cos(fc*TAU)*0.05), y);
}
tex.endShape();
}
rotateY(0.8);
rotateX(1);
sphere(min(width,height)*0.3,60,30);
}