xxxxxxxxxx
40
let capture;
let teapot;
function preload() {
teapot = loadModel('teapot.obj');
}
function setup() {
createCanvas(400, 400, WEBGL);
capture = createCapture(VIDEO);
capture.hide();
}
function draw() {
background(220);
// push();
// texture(capture);
// rotateX(frameCount * 0.01);
// rotateY(frameCount * 0.01);
// rotateZ(frameCount * 0.01);
// box(100);
// pop();
// push();
// texture(capture);
// translate(100, 100);
// rotateX(frameCount * (-0.01));
// rotateY(frameCount * 0.01);
// rotateZ(frameCount * 0.01);
// box(100);
// pop();
push();
texture(capture);
scale(600);
// translate(-100, -100);
rotateX(frameCount * (-0.01));
rotateY(frameCount * 0.01);
rotateZ(frameCount * 0.01);
model(teapot);
pop();
}