xxxxxxxxxx
32
var glitching = false;
function setup() {
createCanvas3D(600, 400);
//Change background color of the scene
background3D("#333333");
hideGrid();
//Change material color to orange
diffuse("#ff7d00");
roughness(0.2);
sphere(-2, 0, 0, 2);
diffuse("#03A9F4");
cube(2, 0, 0, 3);
}
function draw() {}
function keyPressed() {
//Start glitch or stop if already started
glitching = !glitching;
if (glitching) {
pushFX(GLITCH); //add glitch
} else {
//remove all effects with clearFX() or...
popFX(); //remove last effect (glitch)
}
}