xxxxxxxxxx
23
let pos = 25;
function setup() {
createCanvas (window.innerWidth, window.innerHeight, WEBGL);
}
function draw() {
background(0);
rotateX(pos * 0.01);
rotateY(pos * 0.01);
box(200);
}
function mouseWheel(event) {
print(event.delta);
print(event.deltaX);
//move the square according to the vertical scroll amount
pos += event.deltaX;
pos += event.delta;
//uncomment to block page scrolling
//return false;
}