"use strict"; // draws wire frame teapot data // by evaluating Bezier polynomials // for each patch var canvas, gl; // number of evaluations along each curve var numDivisions = 10; var index = 0; var points = []; var bezier = function(u) { var b = []; var a = 1-u; b.push(u*u*u); b.push(3*a*u*u); b.push(3*a*a*u); b.push(a*a*a); return b; } onload = function init() { canvas = document.getElementById( "gl-canvas" ); gl = canvas.getContext('webgl2'); if (!gl) { alert( "WebGL 2.0 isn't available" ); } gl.viewport( 0, 0, canvas.width, canvas.height ); gl.clearColor( 1.0, 1.0, 1.0, 1.0 ); var h = 1.0/numDivisions; var patch = new Array(numTeapotPatches); for(var i=0; i