xxxxxxxxxx
let cell_mat;
let myFace;
function preload(){
cell_mat = loadImage("cell_1.jpg");
// myFace = loadImage("jrx.mov");
}
function setup() {
// myFace = createVideo("jrx.mov");
// myFace.size(800, 400);
// myFace.volume(0);
// myFace.loop();
// myFace.hide();
createCanvas(windowWidth, windowHeight,WEBGL);
background(0);
}
function draw() {
debugMode();
background(0);
orbitControl();
ambientLight(100,100,100);
let locX = mouseX - width / 2;
let locY = mouseY - height / 2;
pointLight(255, 255, 255, locX, locY, 100);
let rotateSpeed = frameCount/50;
push();
translate(-200,0);
fill('red');
rotateY(rotateSpeed);
rotateX(rotateSpeed);
box(sin(frameCount/50)*50+50);
pop();
push();
// fill("#fcec3f");
// translate(200,0);
texture(cell_mat);
rotateY(rotateSpeed);
noStroke();
sphere(300/2);
pop();
push();
translate(200,noise(frameCount/100)*500-250);
specularMaterial(86,198,255);
shininess(50);
rotateX(rotateSpeed);
cone(100, 150);
pop();
push();
translate(-width/2,-height/2);
for(let x = 0 ; x < width ; x += 30){
for(let y = 0 ; y < height ; y += 30){
push();
texture(cell_mat);
translate(x,y);
box(30,30,noise(x/200,y/200,frameCount/100)*200);
pop();
}
}
pop();
}