Animation: Drawing More than Once

Continually call our render() function

We’ll use a special call to request a new frame

function render() {
   gl.clear(gl.COLOR_BUFFER_BIT);

   gl.useProgram(program);
   angle += 3.0; // rotate three degrees each frame
   angle %= 360.0;

   gl.uniform1f(uAngle, angle);

   gl.drawArrays(gl.TRIANGLES, 0, 3);

   requestAnimationFrame(render);
}