xxxxxxxxxx
40
let teapot;
let capture;
function preload() {
teapot = loadModel('teapot_s0.obj');
capture = createCapture(VIDEO);
capture.hide();
}
function setup() {
createCanvas(400, 400, WEBGL);
// ortho(-width / 2, width / 2, height / 2, -height / 2, 0, 500);
}
function draw() {
background(220);
// orbitControl();
var dirX = map(mouseX, 0, width, -1, 1);
var dirY = map(mouseY, 0, height, -1, 1);
directionalLight(250, 250, 250, -dirX, -dirY, 0.25);
specularMaterial(250);
texture(capture);
push();
// scale(700);
rotateX(frameCount * 0.01);
rotateY(frameCount * 0.01);
rotateZ(frameCount * 0.01);
// model(teapot, true);
box(50);
pop();
push();
translate(100, 100);
rotateX(frameCount * (-0.01));
rotateY(frameCount * (0.01));
rotateZ(frameCount * (0.01));
// model(teapot, true);
box(50);
pop();
}