Professional Documents
Culture Documents
var x1 = 0;
var x2 = 0;
var fillVal = 126;
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
}
function draw(){
background(0);
if (mouseIsPressed){
pointLight(250, 250, 250, locX, locY, 0);
} else {
normalMaterial();
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}
function mouseMoved() {
x1 = int(map(mouseX, 0, width, 2, 20));
x2 = int(map(mouseY, 0, height, 2, 20));
}
function keyTyped() {
if(key === '0') {
var fs = fullscreen();
fullscreen(!fs);
}
}