xxxxxxxxxx
61
function preload(){
brain=loadImage("brain.jpg")
brain2= loadImage("brain2.jpg")
eyes=loadImage("eyes.png")
font = loadFont('Aileron-UltraLight.otf')
}
function setup() {
createCanvas(600, 600, WEBGL);
}
function draw() {
background(0)
//console.log(mouseX, mouseY)
//console.log(dist(0,0,mouseX-width/2, mouseY-height/2))
//text second()
push()
textFont(font)
textSize(50)
fill("#b3b3ff")
textAlign(CENTER)
text(second(),0,280,0)
text(second(),0,-240,0)
text(second(),260,0,0)
text(second(),-260,0,0)
pop()
//social bubble
push()
noFill()
stroke(153,153,255)
strokeWeight(0.09)
smooth()
sphere(205)
pop()
//external time piece
push()
stroke(179,179,255)
noFill()
rotateY(second())
sphere(150,10,10)
pop()
//line(0,0,mouseX-width/2,mouseY-height/2)
//inner time rhythm
if(dist(0,0,mouseX-width/2, mouseY-height/2)<=225){
textureMode(IMAGE)
texture(brain2)
//rotateY(millis()/500)
frameRate(5000)
box(random(70,100),random(70,100),random(70,100))
}
if(dist(0,0,mouseX-width/2, mouseY-height/2)>225){
textureMode(IMAGE)
texture(brain2)
rotateY(second())
//frameRate(2)
//box(random(85,100),random(85,100),random(85,100))
box(100)
}
}