xxxxxxxxxx
let overAllTexture
function setup() {
createCanvas(800,800);
background(100);
fill(0)
rect(0,0,width,height)
overAllTexture=createGraphics(width,height)
overAllTexture.loadPixels()
// noStroke()
for(var i=0;i<width+50;i++){
for(var o=0;o<height+50;o++){
overAllTexture.set(i,o,color(100,noise(i/3,o/3,i*o/50)*random([0,40,80])))
}
}
overAllTexture.updatePixels()
// frameRate(2)
}
let glitchAmount =5
function draw() {
noStroke()
// glitchAmount = mouseX/100
rectMode(CORNER)
colorMode(RGB)
fill(0, 0, 80,180)
rect(0,0,width,height)
rectMode(CENTER)
colorMode(HSB)
for(var o=50;o<height;o+=100){
// rotate(PI/1000)
let eyes = []
push()
translate(0,o)
for(var i=0;i<width;i++){
push()
translate(i, sin(i/(20+mouseX/100))*15)
fill(noise(i/500,o/400,noise(frameCount/150) + frameCount/50)*600%360,noise(i/90,o/1000,frameCount/100)*100,noise(i/80,o/1000,frameCount/100)*30+80)
let progAng = (i/40+frameCount/20+o*50 + mouseY/100 + mouseX*noise(o)/100) % (PI*2)
let hh = (sin(progAng) + cos(progAng/2) + cos(progAng/5)/3+1)*30
rotate(sin(i/10))
rect(random(-0,glitchAmount),
random(-glitchAmount,glitchAmount),
+ hh)
if ( int(progAng/PI/2*100)==2 ){
eyes.push(i)
}
pop()
}
eyes.forEach(eyeX=>{
let mAng = atan2(mouseY-o,mouseX-eyeX)
fill('white')
ellipse(eyeX,0,25)
fill('#333')
ellipse(eyeX+cos(mAng)*5,sin(mAng)*5,10)
stroke(0)
push()
translate(eyeX+30,0)
noFill()
rotate(sin(eyeX/2+o/10)/2)
triangle(0,0,
50,-20,
50,20)
pop()
})
pop()
}
push()
blendMode(MULTIPLY)
image(overAllTexture,0,0)
pop()
// ellipse(mouseX, mouseY, 20, 20);
}