xxxxxxxxxx
89
var outline = [];
let number;
let a = 0.0;
function setup() {
//createCanvas(300, 300, WEBGL);
createCanvas(windowWidth, windowHeight, WEBGL);
translate(windowWidth/2-windowHeight/2.5, windowHeight/2-windowHeight/2.5,);
//ortho(-width / 2, width / 2, height / 2, -height / 2, 0, 1000);
//perspective(PI / 3.0, width / height, 0.1, (windowHeight+windowWidth)*0.5);
}
function preload(){
number = loadModel('8.obj');
}
function draw() {
//background((mouseX*0.01)*50);
background(0);
angleMode(RADIANS);
let locX = mouseX - (windowHeight / 2);
let locY = mouseY - (windowWidth / 2);
//pointLight(200, 200, 200, 0,155,locX*.7);
//pointLight(250, 250, 250, 0,-155,locX*.7);
//pointLight(100, 100, 100, locX, (sin(frameCount * 0.01)*(PI*10)),locY);
pointLight(150, 150, 150, locX, locY,windowHeight*.4);
pointLight(100, 100, 100, 0, windowHeight*.5,-1000);
//ambientLight(100,100,100);
noStroke();
translate(0,windowHeight*.5,-(windowHeight*.5));
box(windowWidth*10,100,windowWidth*10);
specularMaterial(2);
//ambientMaterial(250,250,250);
shininess(4);
translate(0,-windowHeight*.5,0);
// //orbitControl();
rotateY(sin(frameCount * 0.012)*(PI*2));
//rotateZ(millis() / 1500);
//angleMode(DEGREES);
//rotateX(180);
//rotateZ(windowHeight - mouseY * 0.017);
//rotateX(0.3);
// rotateY(windowWidth + mouseX * 0.007);
// //scale(1);
angleMode(RADIANS);
scale((windowHeight/300)+(windowWidth/300)*.0001);
translate(0,150,10);
translate(0,(cos(frameCount * 0.024)*(PI*50)),0)
model(number);
//specularMaterial(200);
//ambientMaterial(250,250,250);
//shininess(1);
//fill(200,255)
//emissiveMaterial(200, 200, 200,200);
//specularMaterial(255);
//ambientMaterial(100,100,100);
//shininess(1);
//blendMode(SUBTRACT);
//tint(255, 10); // Display at half opacity
//shininess(1);
//normalMaterial();
//shininess(1);
//ambientMaterial(0);
//specularMaterial(0);
}