(function(){function h(a,c,b){b=a.createShader(b);a.shaderSource(b,c);a.compileShader(b);return b}window.getShaderSource=function(a){return document.getElementById(a).textContent.replace(/^\s+|\s+$/g,"")};window.createProgram=function(a,c,b){var d=a.createProgram(),c=h(a,c,a.VERTEX_SHADER),b=h(a,b,a.FRAGMENT_SHADER);a.attachShader(d,c);a.deleteShader(c);a.attachShader(d,b);a.deleteShader(b);a.linkProgram(d);var e=a.getProgramInfoLog(d);e&&console.log(e);(e=a.getShaderInfoLog(c))&&console.log(e);(e=
a.getShaderInfoLog(b))&&console.log(e);return d};window.loadImage=function(a,c){var b=new Image;b.src=a;b.onload=function(){c(b)};return b};window.loadShader=function(a,c){var b=new XMLHttpRequest;b.addEventListener("load",function(a){c(a.target.response)});b.open("GET",a);b.send();return"/**/"};window.loadImages=function(a,c){function b(){0>=--e&&c(d)}for(var d=[],e=a.length,f=0;f<e;++f)d.push(loadImage(a[f],b))};window.loadObj=function(a,c){var b=new XMLHttpRequest;b.open("GET",a,!0);b.responseType=
"text";b.onload=function(){var a=new OBJ.Mesh(this.response);c(a)};b.send()};for(var i=0,g=["ms","moz","webkit","o"],f=0;f<g.length&&!window.requestAnimationFrame;++f)window.requestAnimationFrame=window[g[f]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[g[f]+"CancelAnimationFrame"]||window[g[f]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(a){var c=(new Date).getTime(),b=M(0,16-(c-i)),d=window.setTimeout(function(){a(c+b)},b);i=c+
b;return d});window.cancelAnimationFrame||(window.cancelAnimationFrame=function(a){clearTimeout(a)})})();
