xxxxxxxxxx
let my3dModel;
let myTextureImg;
let angle = 0;
function preload(){
my3dModel = loadModel('3d-test-model.obj', true);
myTextureImg = loadImage('Aluminum-Texture.jpg');
}
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
background(100);
}
function draw() {
background(0);
orbitControl();
fill(23,23,154,5)
beginShape();
for(let a=0; a<100;a++){
stroke(255,random(5,100));
// vertex(noise(frameCount*a)*1000, noise(frameCount(a+1))*1000, noise(frameCount*(a+2))*1000);
vertex(random(-1000,1000),random(-1000,1000),random(-1000,1000));
}
endShape();
pointLight(255,255,255, mouseX - 200, mouseY - 200, 200);
rotateX(angle);
rotateY(angle * 0.3);
rotateZ(angle * 0.13);
push()
ambientLight(154,23,23);
ambientMaterial(255);
noStroke();
noFill();
texture(myTextureImg);
textureMode(NORMAL);
let s = 1+noise(frameCount)+sin((frameCount)/TWO_PI)/2;
scale(s);
model(my3dModel);
pop();
stroke(154,23,23,40)
fill(100,20);
for(let n = 1; n < windowHeight; n+=windowHeight/5){
sphere(300+sin(n*frameCount/windowHeight) * windowHeight/n);
}
angle += 0.02;
}