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')
// 3 - some stuff to put into the word:
// 3a - 3D stuff aka shapes ('geometry', 'vertices')
// 3b - 2D stuff aka pictures ('textures', 'fragments')
// 3c - executable code aka algorithms ('shaders')
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
}
function draw() {
background(255);
fill(mouseX/width*255, mouseY/height*255, 128);
translate(mouseX-width/2, mouseY-height/2);
rotateX(frameCount * 0.01);
rotateY(frameCount * 0.013);
box(100, 100, 50); // x, y, and z width
}