xxxxxxxxxx
let img
function preload() {
img = loadImage(`./${floor(random(1, 13))}.png`)
}
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL)
noStroke()
}
function draw() {
background(0)
ambientLight(127)
const lx = mouseX - width / 2
const ly = mouseY - height / 2
pointLight(255, 255, 255, lx, ly, 250)
specularMaterial(250)
shininess(50)
orbitControl(1, 1, 1, { freeRotation: true })
textureWrap(REPEAT)
texture(img)
torus(150, 75, 64)
}
let STOP = false
function keyPressed() {
if (key == " ") (STOP = !STOP) ? noLoop() : loop()
}