var angle = 0; var gl = GL.create(); gl.onupdate = function(seconds) { angle += 45 * seconds; }; gl.ondraw = function() { gl.clearColor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); gl.loadIdentity(); gl.translate(0, 0, -2); gl.rotate(60, 1, 0, 0); gl.rotate(angle, 1, 1, 1); // トーラス(Torus)の座標データを用意 // 1.0 y // ^ -1.0 // | / z // |/ x // -1.0 -----------------> +1.0 // /