let graphics;
function
setup() {
createCanvas(600, 600, WEBGL);
graphics = createGraphics(200, 200);
graphics.background(255);
}
function
draw() {
background(0);
graphics.line(0, 0, 200, 200);
graphics.line(100, 0, 200, 200);
graphics.line(100, 200, 200, 100);
graphics.fill(
"green"
);
graphics.triangle(30, 75, 50, 20, 85, 70);
ambientLight(150);
pointLight(255, 255, 255, 0, -200, 200);
rotateZ(frameCount * 0.02);
rotateX(frameCount * 0.02);
texture(graphics);
box(150);
}