xxxxxxxxxx
// webGL is the web browser version of openGL
// openGL is a graphics standard
// need three things:
// 1: virtual world to put stuff in ('render context')
// 2: one or more viewports into #1 ('camera', 'window')
// 3a:3D shapes ('geometry', 'vertices')
// 3b:2D pictures ('textures', 'fragments')
// 3c:executable code aka algorithms ('shaders')
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
}
function draw() {
background(100);
fill(255);
translate(mouseX-width/2, mouseY-height/2);
rotateX(frameCount * 0.01);
rotateY(frameCount * 0.01);
box(100, 100, 50); // x, y, and z width
}