xxxxxxxxxx
//https://github.com/Creativeguru97/YouTube_tutorial/blob/master/p5_hacks/Glow_effect/glowing_shapes/sketch.js by Kazuki Umeda
let a = 0.0;
let inc;
function setup(){
createCanvas(1080,800);
colorMode(HSB, 360, 100, 100, 100);
rectMode(CENTER);
noFill();
stroke(320, 100, 99);
strokeWeight(20);
inc = TWO_PI / 1250.0;
}
function draw(){
background(0);
drawingContext.shadowBlur = color(320, 100, 99,0);
drawingContext.shadowColor = color(320, 100, 99,0);
let sx= sin(millis*0.008)*10;
push();
//;scale(0.5);
translate(width/2+ sin(a) * 40.0, height/2);
push();
rotate(PI/8);
rect(0,+sin(a) * 140.0, 200, 200);
pop();
push();
rotate(PI/8+a);
rect(0, 0, 80, 80);
pop();
rect(0-sin(a) * 240.0,0, 200, 200);
rect(0,-sin(a) * 140.0, 380, 380);
rect(0,0-sin(a) * 140.0, 60, 60);
rect(0+sin(a) * 240.0,0, 60, 60);
pop();
a = a + inc;
}