text: $(function(){function e(){E=window.innerWidth/2,d=window.innerHeight/2,a.aspect=window.innerWidth/window.innerHeight,a.updateProjectionMatrix(),l.setSize(window.innerWidth,window.innerHeight)}function t(e){c=e.clientX-E,p=e.clientY-d}function r(e){e.touches.length>1&&(c=e.touches[0].pageX-E)}function i(e){1==e.touches.length&&(c=e.touches[0].pageX-E)}function n(){requestAnimationFrame(n),o()}function o(){a.position.x+=.05*(c-a.position.x),a.position.y+=.05*(200-p-a.position.y),a.lookAt(s.position),l.render(s,a)}var a,s,l,c=0,p=0,E=window.innerWidth/2,d=window.innerHeight/2;!function(){var n,o;n=document.createElement("div"),n.style.position="fixed",n.style.top="0px",n.style.left="0px",n.style.zIndex="-1",n.style.opacity="0.5",document.body.appendChild(n),a=new THREE.PerspectiveCamera(75,window.innerWidth/window.innerHeight,1,1e4),a.position.z=100,s=new THREE.Scene,l=new THREE.CanvasRenderer,l.setClearColor(16119801,0),l.setPixelRatio(window.devicePixelRatio),l.setSize(window.innerWidth,window.innerHeight),n.appendChild(l.domElement);for(var c=2*Math.PI,p=new THREE.SpriteCanvasMaterial({color:10263708,program:function(e){e.beginPath(),e.arc(0,0,.5,0,c,!0),e.fill()}}),E=new THREE.Geometry,d=0;d<100;d++)o=new THREE.Sprite(p),o.position.x=2*Math.random()-1,o.position.y=2*Math.random()-1,o.position.z=2*Math.random()-1,o.position.normalize(),o.position.multiplyScalar(10*Math.random()+450),o.scale.x=o.scale.y=10,s.add(o),E.vertices.push(o.position);var h=new THREE.Line(E,new THREE.LineBasicMaterial({color:10263708,opacity:.5}));s.add(h),document.addEventListener("mousemove",t,!1),document.addEventListener("touchstart",r,!1),document.addEventListener("touchmove",i,!1),window.addEventListener("resize",e,!1)}(),n()}),THREE.RenderableObject=function(){this.id=0,this.object=null,this.z=0,this.renderOrder=0},THREE.RenderableFace=function(){this.id=0,this.v1=new THREE.RenderableVertex,this.v2=new THREE.RenderableVertex,this.v3=new THREE.RenderableVertex,this.normalModel=new THREE.Vector3,this.vertexNormalsModel=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this.vertexNormalsLength=0,this.color=new THREE.Color,this.material=null,this.uvs=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2],this.z=0,this.renderOrder=0},THREE.RenderableVertex=function(){this.position=new THREE.Vector3,this.positionWorld=new THREE.Vector3,this.positionScreen=new THREE.Vector4,this.visible=!0},THREE.RenderableVertex.prototype.copy=function(e){this.positionWorld.copy(e.positionWorld),this.positionScreen.copy(e.positionScreen)},THREE.RenderableLine=function(){this.id=0,this.v1=new THREE.RenderableVertex,this.v2=new THREE.RenderableVertex,this.vertexColors=[new THREE.Color,new THREE.Color],this.material=null,this.z=0,this.renderOrder=0},THREE.RenderableSprite=function(){this.id=0,this.object=null,this.x=0,this.y=0,this.z=0,this.rotation=0,this.scale=new THREE.Vector2,this.material=null,this.renderOrder=0},THREE.Projector=function(){function e(){if(l===R){var e=new THREE.RenderableObject;return x.push(e),R++,l++,e}return x[l++]}function t(){if(p===T){var e=new THREE.RenderableVertex;return y.push(e),T++,p++,e}return y[p++]}function r(){if(d===H){var e=new THREE.RenderableFace;return w.push(e),H++,d++,e}return w[d++]}function i(){if(f===S){var e=new THREE.RenderableLine;return g.push(e),S++,f++,e}return g[f++]}function n(){if(m===C){var e=new THREE.RenderableSprite;return M.push(e),C++,m++,e}return M[m++]}function o(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id!==t.id?e.id-t.id:0}function a(e,t){var r=0,i=1,n=e.z+e.w,o=t.z+t.w,a=-e.z+e.w,s=-t.z+t.w;return n>=0&&o>=0&&a>=0&&s>=0||!(n<0&&o<0||a<0&&s<0)&&(n<0?r=Math.max(r,n/(n-o)):o<0&&(i=Math.min(i,n/(n-o))),a<0?r=Math.max(r,a/(a-s)):s<0&&(i=Math.min(i,a/(a-s))),!(i<r)&&(e.lerp(t,r),t.lerp(e,1-i),!0))}var s,l,c,p,E,d,h,f,u,m,v,x=[],R=0,y=[],T=0,w=[],H=0,g=[],S=0,M=[],C=0,b={objects:[],lights:[],elements:[]},z=new THREE.Vector3,V=new THREE.Vector4,j=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),L=new THREE.Box3,O=new Array(3),B=(new Array(4),new THREE.Matrix4),W=new THREE.Matrix4,P=new THREE.Matrix4,k=new THREE.Matrix3,N=new THREE.Frustum,F=new THREE.Vector4,A=new THREE.Vector4;this.projectVector=function(e,t){console.warn("THREE.Projector: .projectVector() is now vector.project()."),e.project(t)},this.unprojectVector=function(e,t){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),e.unproject(t)},this.pickingRay=function(e,t){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")};var I=function(){function e(e){x=e,R=x.material,T.getNormalMatrix(x.matrixWorld),u.length=0,m.length=0}function n(e){var t=e.position,r=e.positionWorld,i=e.positionScreen;r.copy(t).applyMatrix4(v),i.copy(r).applyMatrix4(W);var n=1/i.w;i.x*=n,i.y*=n,i.z*=n,e.visible=i.x>=-1&&i.x<=1&&i.y>=-1&&i.y<=1&&i.z>=-1&&i.z<=1}function o(e,r,i){c=t(),c.position.set(e,r,i),n(c)}function a(e,t,r){u.push(e,t,r)}function s(e,t){m.push(e,t)}function l(e,t,r){return!0===e.visible||!0===t.visible||!0===r.visible||(O[0]=e.positionScreen,O[1]=t.positionScreen,O[2]=r.positionScreen,j.intersectsBox(L.setFromPoints(O)))}function p(e,t,r){return(r.positionScreen.x-e.positionScreen.x)*(t.positionScreen.y-e.positionScreen.y)-(r.positionScreen.y-e.positionScreen.y)*(t.positionScreen.x-e.positionScreen.x)<0}function d(e,t){var r=y[e],n=y[t];h=i(),h.id=x.id,h.v1.copy(r),h.v2.copy(n),h.z=(r.positionScreen.z+n.positionScreen.z)/2,h.renderOrder=x.renderOrder,h.material=x.material,b.elements.push(h)}function f(e,t,i){var n=y[e],o=y[t],a=y[i];if(!1!==l(n,o,a)&&(R.side===THREE.DoubleSide||!0===p(n,o,a))){E=r(),E.id=x.id,E.v1.copy(n),E.v2.copy(o),E.v3.copy(a),E.z=(n.positionScreen.z+o.positionScreen.z+a.positionScreen.z)/3,E.renderOrder=x.renderOrder,E.normalModel.fromArray(u,3*e),E.normalModel.applyMatrix3(T).normalize();for(var s=0;s<3;s++){var c=E.vertexNormalsModel[s];c.fromArray(u,3*arguments[s]),c.applyMatrix3(T).normalize();E.uvs[s].fromArray(m,2*arguments[s])}E.vertexNormalsLength=3,E.material=x.material,b.elements.push(E)}}var u=[],m=[],x=null,R=null,T=new THREE.Matrix3;return{setObject:e,projectVertex:n,checkTriangleVisibility:l,checkBackfaceCulling:p,pushVertex:o,pushNormal:a,pushUv:s,pushLine:d,pushTriangle:f}},D=new I;this.projectScene=function(c,x,R,T){function w(t){s=e(),s.id=t.id,s.object=t,z.setFromMatrixPosition(t.matrixWorld),z.applyMatrix4(W),s.z=z.z,s.renderOrder=t.renderOrder,b.objects.push(s)}d=0,f=0,m=0,b.elements.length=0,!0===c.autoUpdate&&c.updateMatrixWorld(),null===x.parent&&x.updateMatrixWorld(),B.copy(x.matrixWorldInverse.getInverse(x.matrixWorld)),W.multiplyMatrices(x.projectionMatrix,B),N.setFromMatrix(W),l=0,b.objects.length=0,b.lights.length=0,c.traverseVisible(function(e){if(e instanceof THREE.Light)b.lights.push(e);else if(e instanceof THREE.Mesh||e instanceof THREE.Line){if(!1===e.material.visible)return;if(!0===e.frustumCulled&&!1===N.intersectsObject(e))return;w(e)}else if(e instanceof THREE.Sprite){if(!1===e.material.visible)return;if(!0===e.frustumCulled&&!1===N.intersectsSprite(e))return;w(e)}}),!0===R&&b.objects.sort(o);for(var H=0,g=b.objects.length;H<g;H++){var S=b.objects[H].object,M=S.geometry;if(D.setObject(S),v=S.matrixWorld,p=0,S instanceof THREE.Mesh){if(M instanceof THREE.BufferGeometry){var C=M.attributes,j=M.groups;if(void 0===C.position)continue;for(var L=C.position.array,O=0,I=L.length;O<I;O+=3)D.pushVertex(L[O],L[O+1],L[O+2]);if(void 0!==C.normal)for(var G=C.normal.array,O=0,I=G.length;O<I;O+=3)D.pushNormal(G[O],G[O+1],G[O+2]);if(void 0!==C.uv)for(var U=C.uv.array,O=0,I=U.length;O<I;O+=2)D.pushUv(U[O],U[O+1]);if(null!==M.index){var q=M.index.array;if(j.length>0)for(var X=0;X<j.length;X++)for(var J=j[X],O=J.start,I=J.start+J.count;O<I;O+=3)D.pushTriangle(q[O],q[O+1],q[O+2]);else for(var O=0,I=q.length;O<I;O+=3)D.pushTriangle(q[O],q[O+1],q[O+2])}else for(var O=0,I=L.length/3;O<I;O+=3)D.pushTriangle(O,O+1,O+2)}else if(M instanceof THREE.Geometry){var Y=M.vertices,$=M.faces,K=M.faceVertexUvs[0];k.getNormalMatrix(v);for(var Q=S.material,Z=Q instanceof THREE.MultiMaterial,_=!0===Z?S.material:null,ee=0,te=Y.length;ee<te;ee++){var re=Y[ee];if(z.copy(re),!0===Q.morphTargets)for(var ie=M.morphTargets,ne=S.morphTargetInfluences,oe=0,ae=ie.length;oe<ae;oe++){var se=ne[oe];if(0!==se){var le=ie[oe],ce=le.vertices[ee];z.x+=(ce.x-re.x)*se,z.y+=(ce.y-re.y)*se,z.z+=(ce.z-re.z)*se}}D.pushVertex(z.x,z.y,z.z)}for(var pe=0,Ee=$.length;pe<Ee;pe++){var de=$[pe];if(void 0!==(Q=!0===Z?_.materials[de.materialIndex]:S.material)){var he=Q.side,fe=y[de.a],ue=y[de.b],me=y[de.c];if(!1!==D.checkTriangleVisibility(fe,ue,me)){var ve=D.checkBackfaceCulling(fe,ue,me);if(he!==THREE.DoubleSide){if(he===THREE.FrontSide&&!1===ve)continue;if(he===THREE.BackSide&&!0===ve)continue}E=r(),E.id=S.id,E.v1.copy(fe),E.v2.copy(ue),E.v3.copy(me),E.normalModel.copy(de.normal),!1!==ve||he!==THREE.BackSide&&he!==THREE.DoubleSide||E.normalModel.negate(),E.normalModel.applyMatrix3(k).normalize();for(var xe=de.vertexNormals,Re=0,ye=Math.min(xe.length,3);Re<ye;Re++){var Te=E.vertexNormalsModel[Re];Te.copy(xe[Re]),!1!==ve||he!==THREE.BackSide&&he!==THREE.DoubleSide||Te.negate(),Te.applyMatrix3(k).normalize()}E.vertexNormalsLength=xe.length;var we=K[pe];if(void 0!==we)for(var He=0;He<3;He++)E.uvs[He].copy(we[He]);E.color=de.color,E.material=Q,E.z=(fe.positionScreen.z+ue.positionScreen.z+me.positionScreen.z)/3,E.renderOrder=S.renderOrder,b.elements.push(E)}}}}}else if(S instanceof THREE.Line){if(M instanceof THREE.BufferGeometry){var C=M.attributes;if(void 0!==C.position){for(var L=C.position.array,O=0,I=L.length;O<I;O+=3)D.pushVertex(L[O],L[O+1],L[O+2]);if(null!==M.index)for(var q=M.index.array,O=0,I=q.length;O<I;O+=2)D.pushLine(q[O],q[O+1]);else for(var ge=S instanceof THREE.LineSegments?2:1,O=0,I=L.length/3-1;O<I;O+=ge)D.pushLine(O,O+1)}}else if(M instanceof THREE.Geometry){P.multiplyMatrices(W,v);var Y=S.geometry.vertices;if(0===Y.length)continue;fe=t(),fe.positionScreen.copy(Y[0]).applyMatrix4(P);for(var ge=S instanceof THREE.LineSegments?2:1,ee=1,te=Y.length;ee<te;ee++)fe=t(),fe.positionScreen.copy(Y[ee]).applyMatrix4(P),(ee+1)%ge>0||(ue=y[p-2],F.copy(fe.positionScreen),A.copy(ue.positionScreen),!0===a(F,A)&&(F.multiplyScalar(1/F.w),A.multiplyScalar(1/A.w),h=i(),h.id=S.id,h.v1.positionScreen.copy(F),h.v2.positionScreen.copy(A),h.z=Math.max(F.z,A.z),h.renderOrder=S.renderOrder,h.material=S.material,S.material.vertexColors===THREE.VertexColors&&(h.vertexColors[0].copy(S.geometry.colors[ee]),h.vertexColors[1].copy(S.geometry.colors[ee-1])),b.elements.push(h)))}}else if(S instanceof THREE.Sprite){V.set(v.elements[12],v.elements[13],v.elements[14],1),V.applyMatrix4(W);var Se=1/V.w;V.z*=Se,V.z>=-1&&V.z<=1&&(u=n(),u.id=S.id,u.x=V.x*Se,u.y=V.y*Se,u.z=V.z,u.renderOrder=S.renderOrder,u.object=S,u.rotation=S.rotation,u.scale.x=S.scale.x*Math.abs(u.x-(V.x+x.projectionMatrix.elements[0])/(V.w+x.projectionMatrix.elements[12])),u.scale.y=S.scale.y*Math.abs(u.y-(V.y+x.projectionMatrix.elements[5])/(V.w+x.projectionMatrix.elements[13])),u.material=S.material,b.elements.push(u))}}return!0===T&&b.elements.sort(o),b}},THREE.SpriteCanvasMaterial=function(e){THREE.Material.call(this),this.type="SpriteCanvasMaterial",this.color=new THREE.Color(16777215),this.program=function(e,t){},this.setValues(e)},THREE.SpriteCanvasMaterial.prototype=Object.create(THREE.Material.prototype),THREE.SpriteCanvasMaterial.prototype.constructor=THREE.SpriteCanvasMaterial,THREE.SpriteCanvasMaterial.prototype.clone=function(){var e=new THREE.SpriteCanvasMaterial;return e.copy(this),e.color.copy(this.color),e.program=this.program,e},THREE.CanvasRenderer=function(e){function t(){ve.setRGB(0,0,0),xe.setRGB(0,0,0),Re.setRGB(0,0,0);for(var e=0,t=w.length;e<t;e++){var r=w[e],i=r.color;r instanceof THREE.AmbientLight?ve.add(i):r instanceof THREE.DirectionalLight?xe.add(i):r instanceof THREE.PointLight&&Re.add(i)}}function r(e,t,r){for(var i=0,n=w.length;i<n;i++){var o=w[i];if(de.copy(o.color),o instanceof THREE.DirectionalLight){var a=ye.setFromMatrixPosition(o.matrixWorld).normalize(),s=t.dot(a);if(s<=0)continue;s*=o.intensity,r.add(de.multiplyScalar(s))}else if(o instanceof THREE.PointLight){var a=ye.setFromMatrixPosition(o.matrixWorld),s=t.dot(ye.subVectors(a,e).normalize());if(s<=0)continue;if(0==(s*=0==o.distance?1:1-Math.min(e.distanceTo(a)/o.distance,1)))continue;s*=o.intensity,r.add(de.multiplyScalar(s))}}}function i(e,t,r){d(r.opacity),h(r.blending);var i=t.scale.x*q,n=t.scale.y*X,o=.5*Math.sqrt(i*i+n*n);if(me.min.set(e.x-o,e.y-o),me.max.set(e.x+o,e.y+o),r instanceof THREE.SpriteMaterial){var a=r.map;if(null!==a){var s=he[a.id];if(void 0!==s&&s.version===a.version||(s=c(a),he[a.id]=s),void 0!==s.canvas){x(s.canvas);var l=a.image,p=l.width*a.offset.x,E=l.height*a.offset.y,f=l.width*a.repeat.x,u=l.height*a.repeat.y,m=i/f,R=n/u;Z.save(),Z.translate(e.x,e.y),0!==r.rotation&&Z.rotate(r.rotation),Z.translate(-i/2,-n/2),Z.scale(m,R),Z.translate(-p,-E),Z.fillRect(p,E,f,u),Z.restore()}}else x(r.color.getStyle()),Z.save(),Z.translate(e.x,e.y),0!==r.rotation&&Z.rotate(r.rotation),Z.scale(i,-n),Z.fillRect(-.5,-.5,1,1),Z.restore()}else r instanceof THREE.SpriteCanvasMaterial&&(v(r.color.getStyle()),x(r.color.getStyle()),Z.save(),Z.translate(e.x,e.y),0!==r.rotation&&Z.rotate(r.rotation),Z.scale(i,n),r.program(Z),Z.restore())}function n(e,t,r,i){if(d(i.opacity),h(i.blending),Z.beginPath(),Z.moveTo(e.positionScreen.x,e.positionScreen.y),Z.lineTo(t.positionScreen.x,t.positionScreen.y),i instanceof THREE.LineBasicMaterial){if(f(i.linewidth),u(i.linecap),m(i.linejoin),i.vertexColors!==THREE.VertexColors)v(i.color.getStyle());else{var n=r.vertexColors[0].getStyle(),o=r.vertexColors[1].getStyle();if(n===o)v(n);else{try{var a=Z.createLinearGradient(e.positionScreen.x,e.positionScreen.y,t.positionScreen.x,t.positionScreen.y);a.addColorStop(0,n),a.addColorStop(1,o)}catch(e){a=n}v(a)}}Z.stroke(),me.expandByScalar(2*i.linewidth)}else i instanceof THREE.LineDashedMaterial&&(f(i.linewidth),u(i.linecap),m(i.linejoin),v(i.color.getStyle()),R([i.dashSize,i.gapSize]),Z.stroke(),me.expandByScalar(2*i.linewidth),R([]))}function o(e,t,i,n,o,c,E,f){if(A.info.render.vertices+=3,A.info.render.faces++,d(f.opacity),h(f.blending),C=e.positionScreen.x,b=e.positionScreen.y,z=t.positionScreen.x,V=t.positionScreen.y,j=i.positionScreen.x,L=i.positionScreen.y,a(C,b,z,V,j,L),(f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial)&&null===f.map)pe.copy(f.color),Ee.copy(f.emissive),f.vertexColors===THREE.FaceColors&&pe.multiply(E.color),ce.copy(ve),Te.copy(e.positionWorld).add(t.positionWorld).add(i.positionWorld).divideScalar(3),r(Te,E.normalModel,ce),ce.multiply(pe).add(Ee),!0===f.wireframe?s(ce,f.wireframeLinewidth,f.wireframeLinecap,f.wireframeLinejoin):l(ce);else if(f instanceof THREE.MeshBasicMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial)if(null!==f.map){var u=f.map.mapping;u===THREE.UVMapping&&(O=E.uvs,p(C,b,z,V,j,L,O[n].x,O[n].y,O[o].x,O[o].y,O[c].x,O[c].y,f.map))}else null!==f.envMap?f.envMap.mapping===THREE.SphericalReflectionMapping&&(we.copy(E.vertexNormalsModel[n]).applyMatrix3(He),B=.5*we.x+.5,W=.5*we.y+.5,we.copy(E.vertexNormalsModel[o]).applyMatrix3(He),P=.5*we.x+.5,k=.5*we.y+.5,we.copy(E.vertexNormalsModel[c]).applyMatrix3(He),N=.5*we.x+.5,F=.5*we.y+.5,p(C,b,z,V,j,L,B,W,P,k,N,F,f.envMap)):(ce.copy(f.color),f.vertexColors===THREE.FaceColors&&ce.multiply(E.color),!0===f.wireframe?s(ce,f.wireframeLinewidth,f.wireframeLinecap,f.wireframeLinejoin):l(ce));else f instanceof THREE.MeshNormalMaterial?(we.copy(E.normalModel).applyMatrix3(He),ce.setRGB(we.x,we.y,we.z).multiplyScalar(.5).addScalar(.5),!0===f.wireframe?s(ce,f.wireframeLinewidth,f.wireframeLinecap,f.wireframeLinejoin):l(ce)):(ce.setRGB(1,1,1),!0===f.wireframe?s(ce,f.wireframeLinewidth,f.wireframeLinecap,f.wireframeLinejoin):l(ce))}function a(e,t,r,i,n,o){Z.beginPath(),Z.moveTo(e,t),Z.lineTo(r,i),Z.lineTo(n,o),Z.closePath()}function s(e,t,r,i){f(t),u(r),m(i),v(e.getStyle()),Z.stroke(),me.expandByScalar(2*t)}function l(e){x(e.getStyle()),Z.fill()}function c(e){if(0===e.version||e instanceof THREE.CompressedTexture||e instanceof THREE.DataTexture)return{canvas:void 0,version:e.version};var t=e.image;if(!1===t.complete)return{canvas:void 0,version:0};var r=e.wrapS===THREE.RepeatWrapping||e.wrapS===THREE.MirroredRepeatWrapping,i=e.wrapT===THREE.RepeatWrapping||e.wrapT===THREE.MirroredRepeatWrapping,n=e.wrapS===THREE.MirroredRepeatWrapping,o=e.wrapT===THREE.MirroredRepeatWrapping,a=document.createElement("canvas");a.width=t.width*(n?2:1),a.height=t.height*(o?2:1);var s=a.getContext("2d");s.setTransform(1,0,0,-1,0,t.height),s.drawImage(t,0,0),!0===n&&(s.setTransform(-1,0,0,-1,t.width,t.height),s.drawImage(t,-t.width,0)),!0===o&&(s.setTransform(1,0,0,1,0,0),s.drawImage(t,0,t.height)),!0===n&&!0===o&&(s.setTransform(-1,0,0,1,t.width,0),s.drawImage(t,-t.width,t.height));var l="no-repeat";!0===r&&!0===i?l="repeat":!0===r?l="repeat-x":!0===i&&(l="repeat-y");var c=Z.createPattern(a,l);return e.onUpdate&&e.onUpdate(e),{canvas:c,version:e.version}}function p(e,t,r,i,n,o,a,s,l,p,E,d,h){var f=he[h.id];if(void 0!==f&&f.version===h.version||(f=c(h),he[h.id]=f),void 0===f.canvas)return x("rgba( 0, 0, 0, 1)"),void Z.fill();x(f.canvas);var u,m,v,R,y,T,w,H,g=h.offset.x/h.repeat.x,S=h.offset.y/h.repeat.y,M=h.image.width*h.repeat.x,C=h.image.height*h.repeat.y;a=(a+g)*M,s=(s+S)*C,l=(l+g)*M,p=(p+S)*C,E=(E+g)*M,d=(d+S)*C,r-=e,i-=t,n-=e,o-=t,l-=a,p-=s,E-=a,d-=s,0!==(w=l*d-E*p)&&(H=1/w,u=(d*r-p*n)*H,m=(d*i-p*o)*H,v=(l*n-E*r)*H,R=(l*o-E*i)*H,y=e-u*a-v*s,T=t-m*a-R*s,Z.save(),Z.transform(u,m,v,R,y,T),Z.fill(),Z.restore())}function E(e,t,r){var i,n=t.x-e.x,o=t.y-e.y,a=n*n+o*o;0!==a&&(i=r/Math.sqrt(a),n*=i,o*=i,t.x+=n,t.y+=o,e.x-=n,e.y-=o)}function d(e){te!==e&&(Z.globalAlpha=e,te=e)}function h(e){re!==e&&(e===THREE.NormalBlending?Z.globalCompositeOperation="source-over":e===THREE.AdditiveBlending?Z.globalCompositeOperation="lighter":e===THREE.SubtractiveBlending?Z.globalCompositeOperation="darker":e===THREE.MultiplyBlending&&(Z.globalCompositeOperation="multiply"),re=e)}function f(e){oe!==e&&(Z.lineWidth=e,oe=e)}function u(e){ae!==e&&(Z.lineCap=e,ae=e)}function m(e){se!==e&&(Z.lineJoin=e,se=e)}function v(e){ie!==e&&(Z.strokeStyle=e,ie=e)}function x(e){ne!==e&&(Z.fillStyle=e,ne=e)}function R(e){le.length!==e.length&&(Z.setLineDash(e),le=e)}console.log("THREE.CanvasRenderer",THREE.REVISION),e=e||{};var y,T,w,H,g,S,M,C,b,z,V,j,L,O,B,W,P,k,N,F,A=this,I=new THREE.Projector,D=void 0!==e.canvas?e.canvas:document.createElement("canvas"),G=D.width,U=D.height,q=Math.floor(G/2),X=Math.floor(U/2),J=0,Y=0,$=G,K=U,Q=1,Z=D.getContext("2d",{alpha:!0===e.alpha}),_=new THREE.Color(0),ee=!0===e.alpha?0:1,te=1,re=0,ie=null,ne=null,oe=null,ae=null,se=null,le=[],ce=(new THREE.RenderableVertex,new THREE.RenderableVertex,new THREE.Color),pe=(new THREE.Color,new THREE.Color,new THREE.Color,new THREE.Color,new THREE.Color),Ee=new THREE.Color,de=new THREE.Color,he={},fe=new THREE.Box2,ue=new THREE.Box2,me=new THREE.Box2,ve=new THREE.Color,xe=new THREE.Color,Re=new THREE.Color,ye=new THREE.Vector3,Te=new THREE.Vector3,we=new THREE.Vector3,He=new THREE.Matrix3;void 0===Z.setLineDash&&(Z.setLineDash=function(){}),this.domElement=D,this.autoClear=!0,this.sortObjects=!0,this.sortElements=!0,this.info={render:{vertices:0,faces:0}},this.supportsVertexTextures=function(){},this.setFaceCulling=function(){},this.getContext=function(){return Z},this.getContextAttributes=function(){return Z.getContextAttributes()},this.getPixelRatio=function(){return Q},this.setPixelRatio=function(e){void 0!==e&&(Q=e)},this.setSize=function(e,t,r){G=e*Q,U=t*Q,D.width=G,D.height=U,q=Math.floor(G/2),X=Math.floor(U/2),!1!==r&&(D.style.width=e+"px",D.style.height=t+"px"),fe.min.set(-q,-X),fe.max.set(q,X),ue.min.set(-q,-X),ue.max.set(q,X),te=1,re=0,ie=null,ne=null,oe=null,ae=null,se=null,this.setViewport(0,0,e,t)},this.setViewport=function(e,t,r,i){J=e*Q,Y=t*Q,$=r*Q,K=i*Q},this.setScissor=function(){},this.setScissorTest=function(){},this.setClearColor=function(e,t){_.set(e),ee=void 0!==t?t:1,ue.min.set(-q,-X),ue.max.set(q,X)},this.setClearColorHex=function(e,t){console.warn("THREE.CanvasRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead."),this.setClearColor(e,t)},this.getClearColor=function(){return _},this.getClearAlpha=function(){return ee},this.getMaxAnisotropy=function(){return 0},this.clear=function(){!1===ue.isEmpty()&&(ue.intersect(fe),ue.expandByScalar(2),ue.min.x=ue.min.x+q,ue.min.y=-ue.min.y+X,ue.max.x=ue.max.x+q,ue.max.y=-ue.max.y+X,ee<1&&Z.clearRect(0|ue.min.x,0|ue.max.y,ue.max.x-ue.min.x|0,ue.min.y-ue.max.y|0),ee>0&&(h(THREE.NormalBlending),d(1),x("rgba("+Math.floor(255*_.r)+","+Math.floor(255*_.g)+","+Math.floor(255*_.b)+","+ee+")"),Z.fillRect(0|ue.min.x,0|ue.max.y,ue.max.x-ue.min.x|0,ue.min.y-ue.max.y|0)),ue.makeEmpty())},this.clearColor=function(){},this.clearDepth=function(){},this.clearStencil=function(){},this.render=function(e,r){if(r instanceof THREE.Camera==!1)return void console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");var a=e.background;a&&a.isColor?(x("rgb("+Math.floor(255*a.r)+","+Math.floor(255*a.g)+","+Math.floor(255*a.b)+")"),Z.fillRect(0,0,G,U)):!0===this.autoClear&&this.clear(),A.info.render.vertices=0,A.info.render.faces=0,Z.setTransform($/G,0,0,-K/U,J,U-Y),Z.translate(q,X),y=I.projectScene(e,r,this.sortObjects,this.sortElements),T=y.elements,w=y.lights,H=r,He.getNormalMatrix(r.matrixWorldInverse),t();for(var s=0,l=T.length;s<l;s++){var c=T[s],p=c.material;if(void 0!==p&&0!==p.opacity){if(me.makeEmpty(),c instanceof THREE.RenderableSprite)g=c,g.x*=q,g.y*=X,i(g,c,p);else if(c instanceof THREE.RenderableLine)g=c.v1,S=c.v2,g.positionScreen.x*=q,g.positionScreen.y*=X,S.positionScreen.x*=q,S.positionScreen.y*=X,me.setFromPoints([g.positionScreen,S.positionScreen]),!0===fe.intersectsBox(me)&&n(g,S,c,p);else if(c instanceof THREE.RenderableFace){if(g=c.v1,S=c.v2,M=c.v3,g.positionScreen.z<-1||g.positionScreen.z>1)continue;if(S.positionScreen.z<-1||S.positionScreen.z>1)continue;if(M.positionScreen.z<-1||M.positionScreen.z>1)continue;g.positionScreen.x*=q,g.positionScreen.y*=X,S.positionScreen.x*=q,S.positionScreen.y*=X,M.positionScreen.x*=q,M.positionScreen.y*=X,p.overdraw>0&&(E(g.positionScreen,S.positionScreen,p.overdraw),E(S.positionScreen,M.positionScreen,p.overdraw),E(M.positionScreen,g.positionScreen,p.overdraw)),me.setFromPoints([g.positionScreen,S.positionScreen,M.positionScreen]),!0===fe.intersectsBox(me)&&o(g,S,M,0,1,2,c,p)}ue.union(me)}}Z.setTransform(1,0,0,1,0,0)}};