diff --git a/build/Three.js b/build/Three.js index 46a41cf8..6abc17d7 100755 --- a/build/Three.js +++ b/build/Three.js @@ -1,6 +1,6 @@ // Three.js r32 - http://github.com/mrdoob/three.js var THREE=THREE||{};THREE.Color=function(a){this.autoUpdate=true;this.setHex(a)}; -THREE.Color.prototype={setRGB:function(a,c,d){this.r=a;this.g=c;this.b=d;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,c,d){var f,i,j,u,b,o;if(d==0)f=i=j=0;else{u=Math.floor(a*6);b=a*6-u;a=d*(1-c);o=d*(1-c*b);c=d*(1-c*(1-b));switch(u){case 1:f=o;i=d;j=a;break;case 2:f=a;i=d;j=c;break;case 3:f=a;i=o;j=d;break;case 4:f=c;i=a;j=d;break;case 5:f=d;i=a;j=o;break;case 6:case 0:f=d;i=c;j=a}}this.r=f;this.g=i;this.b=j;if(this.autoUpdate){this.updateHex();this.updateStyleString()}}, +THREE.Color.prototype={setRGB:function(a,c,d){this.r=a;this.g=c;this.b=d;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,c,d){var f,k,m,r,b,n;if(d==0)f=k=m=0;else{r=Math.floor(a*6);b=a*6-r;a=d*(1-c);n=d*(1-c*b);c=d*(1-c*(1-b));switch(r){case 1:f=n;k=d;m=a;break;case 2:f=a;k=d;m=c;break;case 3:f=a;k=n;m=d;break;case 4:f=c;k=a;m=d;break;case 5:f=d;k=a;m=n;break;case 6:case 0:f=d;k=c;m=a}}this.r=f;this.g=k;this.b=m;if(this.autoUpdate){this.updateHex();this.updateStyleString()}}, setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGBA();this.updateStyleString()}},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGBA:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)},toString:function(){return"THREE.Color ( r: "+ this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,c){this.x=a||0;this.y=c||0}; THREE.Vector2.prototype={set:function(a,c){this.x=a;this.y=c;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},add:function(a,c){this.x=a.x+c.x;this.y=a.y+c.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},sub:function(a,c){this.x=a.x-c.x;this.y=a.y-c.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},unit:function(){this.multiplyScalar(1/this.length());return this},length:function(){return Math.sqrt(this.x* @@ -13,52 +13,52 @@ THREE.Vector4=function(a,c,d,f){this.x=a||0;this.y=c||0;this.z=d||0;this.w=f||1} THREE.Vector4.prototype={set:function(a,c,d,f){this.x=a;this.y=c;this.z=d;this.w=f;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w||1;return this},add:function(a,c){this.x=a.x+c.x;this.y=a.y+c.y;this.z=a.z+c.z;this.w=a.w+c.w;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub:function(a,c){this.x=a.x-c.x;this.y=a.y-c.y;this.z=a.z-c.z;this.w=a.w-c.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w; return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){this.x/=a;this.y/=a;this.z/=a;this.w/=a;return this},lerpSelf:function(a,c){this.x+=(a.x-this.x)*c;this.y+=(a.y-this.y)*c;this.z+=(a.z-this.z)*c;this.w+=(a.w-this.w)*c},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}}; THREE.Ray=function(a,c){this.origin=a||new THREE.Vector3;this.direction=c||new THREE.Vector3}; -THREE.Ray.prototype={intersectScene:function(a){var c,d,f=a.objects,i=[];a=0;for(c=f.length;a0&&I>0&&p+I<1}var d,f,i,j,u,b,o,q,y,z, -x,s=a.geometry,G=s.vertices,J=[];d=0;for(f=s.faces.length;do?f:o;i=i>q? -i:q}a()};this.add3Points=function(o,q,y,z,x,s){if(b){b=false;c=oy?o>x?o:x:y>x?y:x;i=q>z?q>s?q:s:z>s?z:s}else{c=oy?o>x?o>f?o:f:x>f?x:f:y>x?y>f?y:f:x>f?x:f;i=q>z?q>s?q>i?q:i:s>i?s:i:z>s?z>i?z:i:s>i?s:i}a()};this.addRectangle=function(o){if(b){b=false;c=o.getLeft();d=o.getTop();f=o.getRight();i=o.getBottom()}else{c=co.getRight()?f:o.getRight();i=i>o.getBottom()?i:o.getBottom()}a()};this.inflate=function(o){c-=o;d-=o;f+=o;i+=o;a()};this.minSelf=function(o){c=c>o.getLeft()?c:o.getLeft();d=d>o.getTop()?d:o.getTop();f=f=0&&Math.min(i,o.getBottom())-Math.max(d,o.getTop())>=0};this.empty=function(){b=true;i=f=d=c=0;a()};this.isEmpty=function(){return b};this.toString= -function(){return"THREE.Rectangle ( left: "+c+", right: "+f+", top: "+d+", bottom: "+i+", width: "+j+", height: "+u+" )"}};THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={transpose:function(){var a,c=this.m;a=c[1];c[1]=c[3];c[3]=a;a=c[2];c[2]=c[6];c[6]=a;a=c[5];c[5]=c[7];c[7]=a;return this},transposeIntoArray:function(a){var c=this.m;a[0]=c[0];a[1]=c[3];a[2]=c[6];a[3]=c[1];a[4]=c[4];a[5]=c[7];a[6]=c[2];a[7]=c[5];a[8]=c[8];return this}}; -THREE.Matrix4=function(a,c,d,f,i,j,u,b,o,q,y,z,x,s,G,J){this.n11=a||1;this.n12=c||0;this.n13=d||0;this.n14=f||0;this.n21=i||0;this.n22=j||1;this.n23=u||0;this.n24=b||0;this.n31=o||0;this.n32=q||0;this.n33=y||1;this.n34=z||0;this.n41=x||0;this.n42=s||0;this.n43=G||0;this.n44=J||1;this.flat=Array(16);this.m33=new THREE.Matrix3}; -THREE.Matrix4.prototype={identity:function(){this.n11=1;this.n21=this.n14=this.n13=this.n12=0;this.n22=1;this.n32=this.n31=this.n24=this.n23=0;this.n33=1;this.n43=this.n42=this.n41=this.n34=0;this.n44=1;return this},set:function(a,c,d,f,i,j,u,b,o,q,y,z,x,s,G,J){this.n11=a;this.n12=c;this.n13=d;this.n14=f;this.n21=i;this.n22=j;this.n23=u;this.n24=b;this.n31=o;this.n32=q;this.n33=y;this.n34=z;this.n41=x;this.n42=s;this.n43=G;this.n44=J;return this},copy:function(a){this.n11=a.n11;this.n12=a.n12;this.n13= -a.n13;this.n14=a.n14;this.n21=a.n21;this.n22=a.n22;this.n23=a.n23;this.n24=a.n24;this.n31=a.n31;this.n32=a.n32;this.n33=a.n33;this.n34=a.n34;this.n41=a.n41;this.n42=a.n42;this.n43=a.n43;this.n44=a.n44;return this},lookAt:function(a,c,d){var f=THREE.Matrix4.__tmpVec1,i=THREE.Matrix4.__tmpVec2,j=THREE.Matrix4.__tmpVec3;j.sub(a,c).normalize();f.cross(d,j).normalize();i.cross(j,f).normalize();this.n11=f.x;this.n12=f.y;this.n13=f.z;this.n14=-f.dot(a);this.n21=i.x;this.n22=i.y;this.n23=i.z;this.n24=-i.dot(a); -this.n31=j.x;this.n32=j.y;this.n33=j.z;this.n34=-j.dot(a);this.n43=this.n42=this.n41=0;this.n44=1;return this},multiplyVector3:function(a){var c=a.x,d=a.y,f=a.z,i=1/(this.n41*c+this.n42*d+this.n43*f+this.n44);a.x=(this.n11*c+this.n12*d+this.n13*f+this.n14)*i;a.y=(this.n21*c+this.n22*d+this.n23*f+this.n24)*i;a.z=(this.n31*c+this.n32*d+this.n33*f+this.n34)*i;return a},multiplyVector4:function(a){var c=a.x,d=a.y,f=a.z,i=a.w;a.x=this.n11*c+this.n12*d+this.n13*f+this.n14*i;a.y=this.n21*c+this.n22*d+this.n23* -f+this.n24*i;a.z=this.n31*c+this.n32*d+this.n33*f+this.n34*i;a.w=this.n41*c+this.n42*d+this.n43*f+this.n44*i;return a},crossVector:function(a){var c=new THREE.Vector4;c.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;c.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;c.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;c.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return c},multiply:function(a,c){var d=a.n11,f=a.n12,i=a.n13,j=a.n14,u=a.n21,b=a.n22,o=a.n23,q=a.n24,y=a.n31, -z=a.n32,x=a.n33,s=a.n34,G=a.n41,J=a.n42,I=a.n43,w=a.n44,Q=c.n11,F=c.n12,e=c.n13,p=c.n14,h=c.n21,g=c.n22,k=c.n23,m=c.n24,t=c.n31,l=c.n32,n=c.n33,r=c.n34,v=c.n41,A=c.n42,C=c.n43,K=c.n44;this.n11=d*Q+f*h+i*t+j*v;this.n12=d*F+f*g+i*l+j*A;this.n13=d*e+f*k+i*n+j*C;this.n14=d*p+f*m+i*r+j*K;this.n21=u*Q+b*h+o*t+q*v;this.n22=u*F+b*g+o*l+q*A;this.n23=u*e+b*k+o*n+q*C;this.n24=u*p+b*m+o*r+q*K;this.n31=y*Q+z*h+x*t+s*v;this.n32=y*F+z*g+x*l+s*A;this.n33=y*e+z*k+x*n+s*C;this.n34=y*p+z*m+x*r+s*K;this.n41=G*Q+J*h+ -I*t+w*v;this.n42=G*F+J*g+I*l+w*A;this.n43=G*e+J*k+I*n+w*C;this.n44=G*p+J*m+I*r+w*K;return this},multiplyToArray:function(a,c,d){var f=a.n11,i=a.n12,j=a.n13,u=a.n14,b=a.n21,o=a.n22,q=a.n23,y=a.n24,z=a.n31,x=a.n32,s=a.n33,G=a.n34,J=a.n41,I=a.n42,w=a.n43;a=a.n44;var Q=c.n11,F=c.n12,e=c.n13,p=c.n14,h=c.n21,g=c.n22,k=c.n23,m=c.n24,t=c.n31,l=c.n32,n=c.n33,r=c.n34,v=c.n41,A=c.n42,C=c.n43;c=c.n44;this.n11=f*Q+i*h+j*t+u*v;this.n12=f*F+i*g+j*l+u*A;this.n13=f*e+i*k+j*n+u*C;this.n14=f*p+i*m+j*r+u*c;this.n21= -b*Q+o*h+q*t+y*v;this.n22=b*F+o*g+q*l+y*A;this.n23=b*e+o*k+q*n+y*C;this.n24=b*p+o*m+q*r+y*c;this.n31=z*Q+x*h+s*t+G*v;this.n32=z*F+x*g+s*l+G*A;this.n33=z*e+x*k+s*n+G*C;this.n34=z*p+x*m+s*r+G*c;this.n41=J*Q+I*h+w*t+a*v;this.n42=J*F+I*g+w*l+a*A;this.n43=J*e+I*k+w*n+a*C;this.n44=J*p+I*m+w*r+a*c;d[0]=this.n11;d[1]=this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34; -d[15]=this.n44;return this},multiplySelf:function(a){var c=this.n11,d=this.n12,f=this.n13,i=this.n14,j=this.n21,u=this.n22,b=this.n23,o=this.n24,q=this.n31,y=this.n32,z=this.n33,x=this.n34,s=this.n41,G=this.n42,J=this.n43,I=this.n44,w=a.n11,Q=a.n21,F=a.n31,e=a.n41,p=a.n12,h=a.n22,g=a.n32,k=a.n42,m=a.n13,t=a.n23,l=a.n33,n=a.n43,r=a.n14,v=a.n24,A=a.n34;a=a.n44;this.n11=c*w+d*Q+f*F+i*e;this.n12=c*p+d*h+f*g+i*k;this.n13=c*m+d*t+f*l+i*n;this.n14=c*r+d*v+f*A+i*a;this.n21=j*w+u*Q+b*F+o*e;this.n22=j*p+u* -h+b*g+o*k;this.n23=j*m+u*t+b*l+o*n;this.n24=j*r+u*v+b*A+o*a;this.n31=q*w+y*Q+z*F+x*e;this.n32=q*p+y*h+z*g+x*k;this.n33=q*m+y*t+z*l+x*n;this.n34=q*r+y*v+z*A+x*a;this.n41=s*w+G*Q+J*F+I*e;this.n42=s*p+G*h+J*g+I*k;this.n43=s*m+G*t+J*l+I*n;this.n44=s*r+G*v+J*A+I*a;return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this}, -determinant:function(){var a=this.n11,c=this.n12,d=this.n13,f=this.n14,i=this.n21,j=this.n22,u=this.n23,b=this.n24,o=this.n31,q=this.n32,y=this.n33,z=this.n34,x=this.n41,s=this.n42,G=this.n43,J=this.n44;return f*u*q*x-d*b*q*x-f*j*y*x+c*b*y*x+d*j*z*x-c*u*z*x-f*u*o*s+d*b*o*s+f*i*y*s-a*b*y*s-d*i*z*s+a*u*z*s+f*j*o*G-c*b*o*G-f*i*q*G+a*b*q*G+c*i*z*G-a*j*z*G-d*j*o*J+c*u*o*J+d*i*q*J-a*u*q*J-c*i*y*J+a*j*y*J},transpose:function(){function a(c,d,f){var i=c[d];c[d]=c[f];c[f]=i}a(this,"n21","n12");a(this,"n31", +THREE.Ray.prototype={intersectScene:function(a){var c,d,f=a.objects,k=[];a=0;for(c=f.length;a0&&K>0&&e+K<1}var d,f,k,m,r,b,n,p,B,A, +x,y=a.geometry,w=y.vertices,I=[];d=0;for(f=y.faces.length;dn?f:n;k=k>p? +k:p}a()};this.add3Points=function(n,p,B,A,x,y){if(b){b=false;c=nB?n>x?n:x:B>x?B:x;k=p>A?p>y?p:y:A>y?A:y}else{c=nB?n>x?n>f?n:f:x>f?x:f:B>x?B>f?B:f:x>f?x:f;k=p>A?p>y?p>k?p:k:y>k?y:k:A>y?A>k?A:k:y>k?y:k}a()};this.addRectangle=function(n){if(b){b=false;c=n.getLeft();d=n.getTop();f=n.getRight();k=n.getBottom()}else{c=cn.getRight()?f:n.getRight();k=k>n.getBottom()?k:n.getBottom()}a()};this.inflate=function(n){c-=n;d-=n;f+=n;k+=n;a()};this.minSelf=function(n){c=c>n.getLeft()?c:n.getLeft();d=d>n.getTop()?d:n.getTop();f=f=0&&Math.min(k,n.getBottom())-Math.max(d,n.getTop())>=0};this.empty=function(){b=true;k=f=d=c=0;a()};this.isEmpty=function(){return b};this.toString= +function(){return"THREE.Rectangle ( left: "+c+", right: "+f+", top: "+d+", bottom: "+k+", width: "+m+", height: "+r+" )"}};THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={transpose:function(){var a,c=this.m;a=c[1];c[1]=c[3];c[3]=a;a=c[2];c[2]=c[6];c[6]=a;a=c[5];c[5]=c[7];c[7]=a;return this},transposeIntoArray:function(a){var c=this.m;a[0]=c[0];a[1]=c[3];a[2]=c[6];a[3]=c[1];a[4]=c[4];a[5]=c[7];a[6]=c[2];a[7]=c[5];a[8]=c[8];return this}}; +THREE.Matrix4=function(a,c,d,f,k,m,r,b,n,p,B,A,x,y,w,I){this.n11=a||1;this.n12=c||0;this.n13=d||0;this.n14=f||0;this.n21=k||0;this.n22=m||1;this.n23=r||0;this.n24=b||0;this.n31=n||0;this.n32=p||0;this.n33=B||1;this.n34=A||0;this.n41=x||0;this.n42=y||0;this.n43=w||0;this.n44=I||1;this.flat=Array(16);this.m33=new THREE.Matrix3}; +THREE.Matrix4.prototype={identity:function(){this.n11=1;this.n21=this.n14=this.n13=this.n12=0;this.n22=1;this.n32=this.n31=this.n24=this.n23=0;this.n33=1;this.n43=this.n42=this.n41=this.n34=0;this.n44=1;return this},set:function(a,c,d,f,k,m,r,b,n,p,B,A,x,y,w,I){this.n11=a;this.n12=c;this.n13=d;this.n14=f;this.n21=k;this.n22=m;this.n23=r;this.n24=b;this.n31=n;this.n32=p;this.n33=B;this.n34=A;this.n41=x;this.n42=y;this.n43=w;this.n44=I;return this},copy:function(a){this.n11=a.n11;this.n12=a.n12;this.n13= +a.n13;this.n14=a.n14;this.n21=a.n21;this.n22=a.n22;this.n23=a.n23;this.n24=a.n24;this.n31=a.n31;this.n32=a.n32;this.n33=a.n33;this.n34=a.n34;this.n41=a.n41;this.n42=a.n42;this.n43=a.n43;this.n44=a.n44;return this},lookAt:function(a,c,d){var f=THREE.Matrix4.__tmpVec1,k=THREE.Matrix4.__tmpVec2,m=THREE.Matrix4.__tmpVec3;m.sub(a,c).normalize();f.cross(d,m).normalize();k.cross(m,f).normalize();this.n11=f.x;this.n12=f.y;this.n13=f.z;this.n14=-f.dot(a);this.n21=k.x;this.n22=k.y;this.n23=k.z;this.n24=-k.dot(a); +this.n31=m.x;this.n32=m.y;this.n33=m.z;this.n34=-m.dot(a);this.n43=this.n42=this.n41=0;this.n44=1;return this},multiplyVector3:function(a){var c=a.x,d=a.y,f=a.z,k=1/(this.n41*c+this.n42*d+this.n43*f+this.n44);a.x=(this.n11*c+this.n12*d+this.n13*f+this.n14)*k;a.y=(this.n21*c+this.n22*d+this.n23*f+this.n24)*k;a.z=(this.n31*c+this.n32*d+this.n33*f+this.n34)*k;return a},multiplyVector4:function(a){var c=a.x,d=a.y,f=a.z,k=a.w;a.x=this.n11*c+this.n12*d+this.n13*f+this.n14*k;a.y=this.n21*c+this.n22*d+this.n23* +f+this.n24*k;a.z=this.n31*c+this.n32*d+this.n33*f+this.n34*k;a.w=this.n41*c+this.n42*d+this.n43*f+this.n44*k;return a},crossVector:function(a){var c=new THREE.Vector4;c.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;c.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;c.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;c.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return c},multiply:function(a,c){var d=a.n11,f=a.n12,k=a.n13,m=a.n14,r=a.n21,b=a.n22,n=a.n23,p=a.n24,B=a.n31, +A=a.n32,x=a.n33,y=a.n34,w=a.n41,I=a.n42,K=a.n43,u=a.n44,R=c.n11,F=c.n12,P=c.n13,e=c.n14,q=c.n21,h=c.n22,g=c.n23,o=c.n24,i=c.n31,t=c.n32,j=c.n33,l=c.n34,s=c.n41,z=c.n42,v=c.n43,M=c.n44;this.n11=d*R+f*q+k*i+m*s;this.n12=d*F+f*h+k*t+m*z;this.n13=d*P+f*g+k*j+m*v;this.n14=d*e+f*o+k*l+m*M;this.n21=r*R+b*q+n*i+p*s;this.n22=r*F+b*h+n*t+p*z;this.n23=r*P+b*g+n*j+p*v;this.n24=r*e+b*o+n*l+p*M;this.n31=B*R+A*q+x*i+y*s;this.n32=B*F+A*h+x*t+y*z;this.n33=B*P+A*g+x*j+y*v;this.n34=B*e+A*o+x*l+y*M;this.n41=w*R+I*q+ +K*i+u*s;this.n42=w*F+I*h+K*t+u*z;this.n43=w*P+I*g+K*j+u*v;this.n44=w*e+I*o+K*l+u*M;return this},multiplyToArray:function(a,c,d){var f=a.n11,k=a.n12,m=a.n13,r=a.n14,b=a.n21,n=a.n22,p=a.n23,B=a.n24,A=a.n31,x=a.n32,y=a.n33,w=a.n34,I=a.n41,K=a.n42,u=a.n43;a=a.n44;var R=c.n11,F=c.n12,P=c.n13,e=c.n14,q=c.n21,h=c.n22,g=c.n23,o=c.n24,i=c.n31,t=c.n32,j=c.n33,l=c.n34,s=c.n41,z=c.n42,v=c.n43;c=c.n44;this.n11=f*R+k*q+m*i+r*s;this.n12=f*F+k*h+m*t+r*z;this.n13=f*P+k*g+m*j+r*v;this.n14=f*e+k*o+m*l+r*c;this.n21= +b*R+n*q+p*i+B*s;this.n22=b*F+n*h+p*t+B*z;this.n23=b*P+n*g+p*j+B*v;this.n24=b*e+n*o+p*l+B*c;this.n31=A*R+x*q+y*i+w*s;this.n32=A*F+x*h+y*t+w*z;this.n33=A*P+x*g+y*j+w*v;this.n34=A*e+x*o+y*l+w*c;this.n41=I*R+K*q+u*i+a*s;this.n42=I*F+K*h+u*t+a*z;this.n43=I*P+K*g+u*j+a*v;this.n44=I*e+K*o+u*l+a*c;d[0]=this.n11;d[1]=this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34; +d[15]=this.n44;return this},multiplySelf:function(a){var c=this.n11,d=this.n12,f=this.n13,k=this.n14,m=this.n21,r=this.n22,b=this.n23,n=this.n24,p=this.n31,B=this.n32,A=this.n33,x=this.n34,y=this.n41,w=this.n42,I=this.n43,K=this.n44,u=a.n11,R=a.n21,F=a.n31,P=a.n41,e=a.n12,q=a.n22,h=a.n32,g=a.n42,o=a.n13,i=a.n23,t=a.n33,j=a.n43,l=a.n14,s=a.n24,z=a.n34;a=a.n44;this.n11=c*u+d*R+f*F+k*P;this.n12=c*e+d*q+f*h+k*g;this.n13=c*o+d*i+f*t+k*j;this.n14=c*l+d*s+f*z+k*a;this.n21=m*u+r*R+b*F+n*P;this.n22=m*e+r* +q+b*h+n*g;this.n23=m*o+r*i+b*t+n*j;this.n24=m*l+r*s+b*z+n*a;this.n31=p*u+B*R+A*F+x*P;this.n32=p*e+B*q+A*h+x*g;this.n33=p*o+B*i+A*t+x*j;this.n34=p*l+B*s+A*z+x*a;this.n41=y*u+w*R+I*F+K*P;this.n42=y*e+w*q+I*h+K*g;this.n43=y*o+w*i+I*t+K*j;this.n44=y*l+w*s+I*z+K*a;return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this}, +determinant:function(){var a=this.n11,c=this.n12,d=this.n13,f=this.n14,k=this.n21,m=this.n22,r=this.n23,b=this.n24,n=this.n31,p=this.n32,B=this.n33,A=this.n34,x=this.n41,y=this.n42,w=this.n43,I=this.n44;return f*r*p*x-d*b*p*x-f*m*B*x+c*b*B*x+d*m*A*x-c*r*A*x-f*r*n*y+d*b*n*y+f*k*B*y-a*b*B*y-d*k*A*y+a*r*A*y+f*m*n*w-c*b*n*w-f*k*p*w+a*b*p*w+c*k*A*w-a*m*A*w-d*m*n*I+c*r*n*I+d*k*p*I-a*r*p*I-c*k*B*I+a*m*B*I},transpose:function(){function a(c,d,f){var k=c[d];c[d]=c[f];c[f]=k}a(this,"n21","n12");a(this,"n31", "n13");a(this,"n32","n23");a(this,"n41","n14");a(this,"n42","n24");a(this,"n43","n34");return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){var a=this.flat;a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]= this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArray:function(a){a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},setTranslation:function(a,c,d){this.set(1,0,0,a,0,1,0,c,0,0,1,d,0,0,0, -1);return this},setScale:function(a,c,d){this.set(a,0,0,0,0,c,0,0,0,0,d,0,0,0,0,1);return this},setRotX:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,c,-a,0,0,a,c,0,0,0,0,1);return this},setRotY:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,0,a,0,0,1,0,0,-a,0,c,0,0,0,0,1);return this},setRotZ:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,-a,0,0,a,c,0,0,0,0,1,0,0,0,0,1);return this},setRotAxis:function(a,c){var d=Math.cos(c),f=Math.sin(c),i=1-d,j=a.x,u=a.y,b=a.z, -o=i*j,q=i*u;this.set(o*j+d,o*u-f*b,o*b+f*u,0,o*u+f*b,q*u+d,q*b-f*j,0,o*b-f*u,q*b+f*j,i*b*b+d,0,0,0,0,1);return this},toString:function(){return"| "+this.n11+" "+this.n12+" "+this.n13+" "+this.n14+" |\n| "+this.n21+" "+this.n22+" "+this.n23+" "+this.n24+" |\n| "+this.n31+" "+this.n32+" "+this.n33+" "+this.n34+" |\n| "+this.n41+" "+this.n42+" "+this.n43+" "+this.n44+" |"}};THREE.Matrix4.translationMatrix=function(a,c,d){var f=new THREE.Matrix4;f.setTranslation(a,c,d);return f}; +1);return this},setScale:function(a,c,d){this.set(a,0,0,0,0,c,0,0,0,0,d,0,0,0,0,1);return this},setRotX:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,c,-a,0,0,a,c,0,0,0,0,1);return this},setRotY:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,0,a,0,0,1,0,0,-a,0,c,0,0,0,0,1);return this},setRotZ:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,-a,0,0,a,c,0,0,0,0,1,0,0,0,0,1);return this},setRotAxis:function(a,c){var d=Math.cos(c),f=Math.sin(c),k=1-d,m=a.x,r=a.y,b=a.z, +n=k*m,p=k*r;this.set(n*m+d,n*r-f*b,n*b+f*r,0,n*r+f*b,p*r+d,p*b-f*m,0,n*b-f*r,p*b+f*m,k*b*b+d,0,0,0,0,1);return this},toString:function(){return"| "+this.n11+" "+this.n12+" "+this.n13+" "+this.n14+" |\n| "+this.n21+" "+this.n22+" "+this.n23+" "+this.n24+" |\n| "+this.n31+" "+this.n32+" "+this.n33+" "+this.n34+" |\n| "+this.n41+" "+this.n42+" "+this.n43+" "+this.n44+" |"}};THREE.Matrix4.translationMatrix=function(a,c,d){var f=new THREE.Matrix4;f.setTranslation(a,c,d);return f}; THREE.Matrix4.scaleMatrix=function(a,c,d){var f=new THREE.Matrix4;f.setScale(a,c,d);return f};THREE.Matrix4.rotationXMatrix=function(a){var c=new THREE.Matrix4;c.setRotX(a);return c};THREE.Matrix4.rotationYMatrix=function(a){var c=new THREE.Matrix4;c.setRotY(a);return c};THREE.Matrix4.rotationZMatrix=function(a){var c=new THREE.Matrix4;c.setRotZ(a);return c};THREE.Matrix4.rotationAxisAngleMatrix=function(a,c){var d=new THREE.Matrix4;d.setRotAxis(a,c);return d}; -THREE.Matrix4.makeInvert=function(a){var c=a.n11,d=a.n12,f=a.n13,i=a.n14,j=a.n21,u=a.n22,b=a.n23,o=a.n24,q=a.n31,y=a.n32,z=a.n33,x=a.n34,s=a.n41,G=a.n42,J=a.n43,I=a.n44,w=new THREE.Matrix4;w.n11=b*x*G-o*z*G+o*y*J-u*x*J-b*y*I+u*z*I;w.n12=i*z*G-f*x*G-i*y*J+d*x*J+f*y*I-d*z*I;w.n13=f*o*G-i*b*G+i*u*J-d*o*J-f*u*I+d*b*I;w.n14=i*b*y-f*o*y-i*u*z+d*o*z+f*u*x-d*b*x;w.n21=o*z*s-b*x*s-o*q*J+j*x*J+b*q*I-j*z*I;w.n22=f*x*s-i*z*s+i*q*J-c*x*J-f*q*I+c*z*I;w.n23=i*b*s-f*o*s-i*j*J+c*o*J+f*j*I-c*b*I;w.n24=f*o*q-i*b*q+ -i*j*z-c*o*z-f*j*x+c*b*x;w.n31=u*x*s-o*y*s+o*q*G-j*x*G-u*q*I+j*y*I;w.n32=i*y*s-d*x*s-i*q*G+c*x*G+d*q*I-c*y*I;w.n33=f*o*s-i*u*s+i*j*G-c*o*G-d*j*I+c*u*I;w.n34=i*u*q-d*o*q-i*j*y+c*o*y+d*j*x-c*u*x;w.n41=b*y*s-u*z*s-b*q*G+j*z*G+u*q*J-j*y*J;w.n42=d*z*s-f*y*s+f*q*G-c*z*G-d*q*J+c*y*J;w.n43=f*u*s-d*b*s-f*j*G+c*b*G+d*j*J-c*u*J;w.n44=d*b*q-f*u*q+f*j*y-c*b*y-d*j*z+c*u*z;w.multiplyScalar(1/a.determinant());return w}; -THREE.Matrix4.makeInvert3x3=function(a){var c=a.m33,d=c.m,f=a.n33*a.n22-a.n32*a.n23,i=-a.n33*a.n21+a.n31*a.n23,j=a.n32*a.n21-a.n31*a.n22,u=-a.n33*a.n12+a.n32*a.n13,b=a.n33*a.n11-a.n31*a.n13,o=-a.n32*a.n11+a.n31*a.n12,q=a.n23*a.n12-a.n22*a.n13,y=-a.n23*a.n11+a.n21*a.n13,z=a.n22*a.n11-a.n21*a.n12;a=a.n11*f+a.n21*u+a.n31*q;if(a==0)throw"matrix not invertible";a=1/a;d[0]=a*f;d[1]=a*i;d[2]=a*j;d[3]=a*u;d[4]=a*b;d[5]=a*o;d[6]=a*q;d[7]=a*y;d[8]=a*z;return c}; -THREE.Matrix4.makeFrustum=function(a,c,d,f,i,j){var u,b,o;u=new THREE.Matrix4;b=2*i/(c-a);o=2*i/(f-d);a=(c+a)/(c-a);d=(f+d)/(f-d);f=-(j+i)/(j-i);i=-2*j*i/(j-i);u.n11=b;u.n12=0;u.n13=a;u.n14=0;u.n21=0;u.n22=o;u.n23=d;u.n24=0;u.n31=0;u.n32=0;u.n33=f;u.n34=i;u.n41=0;u.n42=0;u.n43=-1;u.n44=0;return u};THREE.Matrix4.makePerspective=function(a,c,d,f){var i;a=d*Math.tan(a*Math.PI/360);i=-a;return THREE.Matrix4.makeFrustum(i*c,a*c,i,a,d,f)}; -THREE.Matrix4.makeOrtho=function(a,c,d,f,i,j){var u,b,o,q;u=new THREE.Matrix4;b=c-a;o=d-f;q=j-i;a=(c+a)/b;d=(d+f)/o;i=(j+i)/q;u.n11=2/b;u.n12=0;u.n13=0;u.n14=-a;u.n21=0;u.n22=2/o;u.n23=0;u.n24=-d;u.n31=0;u.n32=0;u.n33=-2/q;u.n34=-i;u.n41=0;u.n42=0;u.n43=0;u.n44=1;return u};THREE.Matrix4.__tmpVec1=new THREE.Vector3;THREE.Matrix4.__tmpVec2=new THREE.Vector3;THREE.Matrix4.__tmpVec3=new THREE.Vector3; +THREE.Matrix4.makeInvert=function(a){var c=a.n11,d=a.n12,f=a.n13,k=a.n14,m=a.n21,r=a.n22,b=a.n23,n=a.n24,p=a.n31,B=a.n32,A=a.n33,x=a.n34,y=a.n41,w=a.n42,I=a.n43,K=a.n44,u=new THREE.Matrix4;u.n11=b*x*w-n*A*w+n*B*I-r*x*I-b*B*K+r*A*K;u.n12=k*A*w-f*x*w-k*B*I+d*x*I+f*B*K-d*A*K;u.n13=f*n*w-k*b*w+k*r*I-d*n*I-f*r*K+d*b*K;u.n14=k*b*B-f*n*B-k*r*A+d*n*A+f*r*x-d*b*x;u.n21=n*A*y-b*x*y-n*p*I+m*x*I+b*p*K-m*A*K;u.n22=f*x*y-k*A*y+k*p*I-c*x*I-f*p*K+c*A*K;u.n23=k*b*y-f*n*y-k*m*I+c*n*I+f*m*K-c*b*K;u.n24=f*n*p-k*b*p+ +k*m*A-c*n*A-f*m*x+c*b*x;u.n31=r*x*y-n*B*y+n*p*w-m*x*w-r*p*K+m*B*K;u.n32=k*B*y-d*x*y-k*p*w+c*x*w+d*p*K-c*B*K;u.n33=f*n*y-k*r*y+k*m*w-c*n*w-d*m*K+c*r*K;u.n34=k*r*p-d*n*p-k*m*B+c*n*B+d*m*x-c*r*x;u.n41=b*B*y-r*A*y-b*p*w+m*A*w+r*p*I-m*B*I;u.n42=d*A*y-f*B*y+f*p*w-c*A*w-d*p*I+c*B*I;u.n43=f*r*y-d*b*y-f*m*w+c*b*w+d*m*I-c*r*I;u.n44=d*b*p-f*r*p+f*m*B-c*b*B-d*m*A+c*r*A;u.multiplyScalar(1/a.determinant());return u}; +THREE.Matrix4.makeInvert3x3=function(a){var c=a.m33,d=c.m,f=a.n33*a.n22-a.n32*a.n23,k=-a.n33*a.n21+a.n31*a.n23,m=a.n32*a.n21-a.n31*a.n22,r=-a.n33*a.n12+a.n32*a.n13,b=a.n33*a.n11-a.n31*a.n13,n=-a.n32*a.n11+a.n31*a.n12,p=a.n23*a.n12-a.n22*a.n13,B=-a.n23*a.n11+a.n21*a.n13,A=a.n22*a.n11-a.n21*a.n12;a=a.n11*f+a.n21*r+a.n31*p;if(a==0)throw"matrix not invertible";a=1/a;d[0]=a*f;d[1]=a*k;d[2]=a*m;d[3]=a*r;d[4]=a*b;d[5]=a*n;d[6]=a*p;d[7]=a*B;d[8]=a*A;return c}; +THREE.Matrix4.makeFrustum=function(a,c,d,f,k,m){var r,b,n;r=new THREE.Matrix4;b=2*k/(c-a);n=2*k/(f-d);a=(c+a)/(c-a);d=(f+d)/(f-d);f=-(m+k)/(m-k);k=-2*m*k/(m-k);r.n11=b;r.n12=0;r.n13=a;r.n14=0;r.n21=0;r.n22=n;r.n23=d;r.n24=0;r.n31=0;r.n32=0;r.n33=f;r.n34=k;r.n41=0;r.n42=0;r.n43=-1;r.n44=0;return r};THREE.Matrix4.makePerspective=function(a,c,d,f){var k;a=d*Math.tan(a*Math.PI/360);k=-a;return THREE.Matrix4.makeFrustum(k*c,a*c,k,a,d,f)}; +THREE.Matrix4.makeOrtho=function(a,c,d,f,k,m){var r,b,n,p;r=new THREE.Matrix4;b=c-a;n=d-f;p=m-k;a=(c+a)/b;d=(d+f)/n;k=(m+k)/p;r.n11=2/b;r.n12=0;r.n13=0;r.n14=-a;r.n21=0;r.n22=2/n;r.n23=0;r.n24=-d;r.n31=0;r.n32=0;r.n33=-2/p;r.n34=-k;r.n41=0;r.n42=0;r.n43=0;r.n44=1;return r};THREE.Matrix4.__tmpVec1=new THREE.Vector3;THREE.Matrix4.__tmpVec2=new THREE.Vector3;THREE.Matrix4.__tmpVec3=new THREE.Vector3; THREE.Vertex=function(a,c){this.position=a||new THREE.Vector3;this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.normal=c||new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.normalScreen=new THREE.Vector3;this.tangent=new THREE.Vector4;this.__visible=true};THREE.Vertex.prototype={toString:function(){return"THREE.Vertex ( position: "+this.position+", normal: "+this.normal+" )"}}; -THREE.Face3=function(a,c,d,f,i){this.a=a;this.b=c;this.c=d;this.centroid=new THREE.Vector3;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.materials=i instanceof Array?i:[i]};THREE.Face3.prototype={toString:function(){return"THREE.Face3 ( "+this.a+", "+this.b+", "+this.c+" )"}}; -THREE.Face4=function(a,c,d,f,i,j){this.a=a;this.b=c;this.c=d;this.d=f;this.centroid=new THREE.Vector3;this.normal=i instanceof THREE.Vector3?i:new THREE.Vector3;this.vertexNormals=i instanceof Array?i:[];this.materials=j instanceof Array?j:[j]};THREE.Face4.prototype={toString:function(){return"THREE.Face4 ( "+this.a+", "+this.b+", "+this.c+" "+this.d+" )"}};THREE.UV=function(a,c){this.u=a||0;this.v=c||0}; +THREE.Face3=function(a,c,d,f,k){this.a=a;this.b=c;this.c=d;this.centroid=new THREE.Vector3;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.materials=k instanceof Array?k:[k]};THREE.Face3.prototype={toString:function(){return"THREE.Face3 ( "+this.a+", "+this.b+", "+this.c+" )"}}; +THREE.Face4=function(a,c,d,f,k,m){this.a=a;this.b=c;this.c=d;this.d=f;this.centroid=new THREE.Vector3;this.normal=k instanceof THREE.Vector3?k:new THREE.Vector3;this.vertexNormals=k instanceof Array?k:[];this.materials=m instanceof Array?m:[m]};THREE.Face4.prototype={toString:function(){return"THREE.Face4 ( "+this.a+", "+this.b+", "+this.c+" "+this.d+" )"}};THREE.UV=function(a,c){this.u=a||0;this.v=c||0}; THREE.UV.prototype={copy:function(a){this.u=a.u;this.v=a.v},toString:function(){return"THREE.UV ("+this.u+", "+this.v+")"}};THREE.Geometry=function(){this.vertices=[];this.faces=[];this.uvs=[];this.uvs2=[];this.colors=[];this.boundingSphere=this.boundingBox=null;this.geometryChunks={};this.hasTangents=false}; THREE.Geometry.prototype={computeCentroids:function(){var a,c,d;a=0;for(c=this.faces.length;a0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y], +c;a++){d=this.faces[a];if(d instanceof THREE.Face3){d.vertexNormals[0].copy(f[d.a]);d.vertexNormals[1].copy(f[d.b]);d.vertexNormals[2].copy(f[d.c])}else if(d instanceof THREE.Face4){d.vertexNormals[0].copy(f[d.a]);d.vertexNormals[1].copy(f[d.b]);d.vertexNormals[2].copy(f[d.c]);d.vertexNormals[3].copy(f[d.d])}}},computeTangents:function(){function a(l,s,z,v,M,J,E){m=l.vertices[s].position;r=l.vertices[z].position;b=l.vertices[v].position;n=k[M];p=k[J];B=k[E];A=r.x-m.x;x=b.x-m.x;y=r.y-m.y;w=b.y-m.y; +I=r.z-m.z;K=b.z-m.z;u=p.u-n.u;R=B.u-n.u;F=p.v-n.v;P=B.v-n.v;e=1/(u*P-R*F);g.set((P*A-F*x)*e,(P*y-F*w)*e,(P*I-F*K)*e);o.set((u*x-R*A)*e,(u*w-R*y)*e,(u*K-R*I)*e);q[s].addSelf(g);q[z].addSelf(g);q[v].addSelf(g);h[s].addSelf(o);h[z].addSelf(o);h[v].addSelf(o)}var c,d,f,k,m,r,b,n,p,B,A,x,y,w,I,K,u,R,F,P,e,q=[],h=[],g=new THREE.Vector3,o=new THREE.Vector3,i=new THREE.Vector3,t=new THREE.Vector3,j=new THREE.Vector3;c=0;for(d=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y], z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,d=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z -this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,c=0,d=this.vertices.length;c65535){q[b].counter+=1;o=q[b].hash+"_"+q[b].counter;if(this.geometryChunks[o]==undefined)this.geometryChunks[o]={faces:[],materials:u,vertices:0}}this.geometryChunks[o].faces.push(f);this.geometryChunks[o].vertices+=j}},toString:function(){return"THREE.Geometry ( vertices: "+ +this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,c=0,d=this.vertices.length;c65535){p[b].counter+=1;n=p[b].hash+"_"+p[b].counter;if(this.geometryChunks[n]==undefined)this.geometryChunks[n]={faces:[],materials:r,vertices:0}}this.geometryChunks[n].faces.push(f);this.geometryChunks[n].vertices+=m}},toString:function(){return"THREE.Geometry ( vertices: "+ this.vertices+", faces: "+this.faces+", uvs: "+this.uvs+" )"}}; -THREE.Camera=function(a,c,d,f){this.fov=a;this.aspect=c;this.near=d;this.far=f;this.position=new THREE.Vector3;this.target={position:new THREE.Vector3};this.autoUpdateMatrix=true;this.projectionMatrix=null;this.matrix=new THREE.Matrix4;this.up=new THREE.Vector3(0,1,0);this.tmpVec=new THREE.Vector3;this.translateX=function(i){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(i);this.tmpVec.crossSelf(this.up);this.position.addSelf(this.tmpVec);this.target.position.addSelf(this.tmpVec)}; -this.translateZ=function(i){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(i);this.position.subSelf(this.tmpVec);this.target.position.subSelf(this.tmpVec)};this.updateMatrix=function(){this.matrix.lookAt(this.position,this.target.position,this.up)};this.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};this.updateProjectionMatrix()}; +THREE.Camera=function(a,c,d,f){this.fov=a;this.aspect=c;this.near=d;this.far=f;this.position=new THREE.Vector3;this.target={position:new THREE.Vector3};this.autoUpdateMatrix=true;this.projectionMatrix=null;this.matrix=new THREE.Matrix4;this.up=new THREE.Vector3(0,1,0);this.tmpVec=new THREE.Vector3;this.translateX=function(k){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(k);this.tmpVec.crossSelf(this.up);this.position.addSelf(this.tmpVec);this.target.position.addSelf(this.tmpVec)}; +this.translateZ=function(k){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(k);this.position.subSelf(this.tmpVec);this.target.position.subSelf(this.tmpVec)};this.updateMatrix=function(){this.matrix.lookAt(this.position,this.target.position,this.up)};this.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};this.updateProjectionMatrix()}; THREE.Camera.prototype={toString:function(){return"THREE.Camera ( "+this.position+", "+this.target.position+" )"}};THREE.Light=function(a){this.color=new THREE.Color(a)};THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=c||1};THREE.DirectionalLight.prototype=new THREE.Light; THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=c||1};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight; THREE.Object3D=function(){this.id=THREE.Object3DCounter.value++;this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.matrix=new THREE.Matrix4;this.rotationMatrix=new THREE.Matrix4;this.tmpMatrix=new THREE.Matrix4;this.screen=new THREE.Vector3;this.visible=this.autoUpdateMatrix=true}; @@ -96,115 +96,115 @@ THREE.MeshShaderMaterial.prototype={toString:function(){return"THREE.MeshShaderM THREE.ParticleBasicMaterial=function(a){this.id=THREE.ParticleBasicMaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.map=null;this.size=1;this.blending=THREE.NormalBlending;this.depth_test=true;this.offset=new THREE.Vector2;this.vertex_colors=false;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.map!==undefined)this.map=a.map;if(a.size!==undefined)this.size=a.size;if(a.blending!==undefined)this.blending=a.blending; if(a.depth_test!==undefined)this.depth_test=a.depth_test;if(a.vertex_colors!==undefined)this.vertex_colors=a.vertex_colors}};THREE.ParticleBasicMaterial.prototype={toString:function(){return"THREE.ParticleBasicMaterial (
id: "+this.id+"
color: "+this.color+"
opacity: "+this.opacity+"
map: "+this.map+"
size: "+this.size+"
blending: "+this.blending+"
depth_test: "+this.depth_test+"
vertex_colors: "+this.vertex_colors+"
)"}};THREE.ParticleBasicMaterialCounter={value:0}; THREE.ParticleCircleMaterial=function(a){this.color=new THREE.Color(16777215);this.opacity=1;this.blending=THREE.NormalBlending;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.blending!==undefined)this.blending=a.blending}};THREE.ParticleCircleMaterial.prototype={toString:function(){return"THREE.ParticleCircleMaterial (
color: "+this.color+"
opacity: "+this.opacity+"
blending: "+this.blending+"
)"}}; -THREE.ParticleDOMMaterial=function(a){this.domElement=a};THREE.ParticleDOMMaterial.prototype={toString:function(){return"THREE.ParticleDOMMaterial ( domElement: "+this.domElement+" )"}};THREE.Texture=function(a,c,d,f,i,j){this.image=a;this.mapping=c!==undefined?c:new THREE.UVMapping;this.wrap_s=d!==undefined?d:THREE.ClampToEdgeWrapping;this.wrap_t=f!==undefined?f:THREE.ClampToEdgeWrapping;this.mag_filter=i!==undefined?i:THREE.LinearFilter;this.min_filter=j!==undefined?j:THREE.LinearMipMapLinearFilter}; +THREE.ParticleDOMMaterial=function(a){this.domElement=a};THREE.ParticleDOMMaterial.prototype={toString:function(){return"THREE.ParticleDOMMaterial ( domElement: "+this.domElement+" )"}};THREE.Texture=function(a,c,d,f,k,m){this.image=a;this.mapping=c!==undefined?c:new THREE.UVMapping;this.wrap_s=d!==undefined?d:THREE.ClampToEdgeWrapping;this.wrap_t=f!==undefined?f:THREE.ClampToEdgeWrapping;this.mag_filter=k!==undefined?k:THREE.LinearFilter;this.min_filter=m!==undefined?m:THREE.LinearMipMapLinearFilter}; THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,this.mapping,this.wrap_s,this.wrap_t,this.mag_filter,this.min_filter)},toString:function(){return"THREE.Texture (
image: "+this.image+"
wrap_s: "+this.wrap_s+"
wrap_t: "+this.wrap_t+"
mag_filter: "+this.mag_filter+"
min_filter: "+this.min_filter+"
)"}};THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2; THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20; THREE.RenderTarget=function(a,c,d){this.width=a;this.height=c;d=d||{};this.wrap_s=d.wrap_s!==undefined?d.wrap_s:THREE.ClampToEdgeWrapping;this.wrap_t=d.wrap_t!==undefined?d.wrap_t:THREE.ClampToEdgeWrapping;this.mag_filter=d.mag_filter!==undefined?d.mag_filter:THREE.LinearFilter;this.min_filter=d.min_filter!==undefined?d.min_filter:THREE.LinearMipMapLinearFilter;this.format=d.format!==undefined?d.format:THREE.RGBFormat;this.type=d.type!==undefined?d.type:THREE.UnsignedByteType}; -var Uniforms={clone:function(a){var c,d,f,i={};for(c in a){i[c]={};for(d in a[c]){f=a[c][d];i[c][d]=f instanceof THREE.Color||f instanceof THREE.Vector3||f instanceof THREE.Texture?f.clone():f}}return i},merge:function(a){var c,d,f,i={};for(c=0;c=0&&n>=0&&r>=0&&v>=0)return true;else if(l<0&&n<0||r<0&&v<0)return false;else{if(l<0)m=Math.max(m,l/(l-n));else if(n<0)t=Math.min(t,l/(l-n));if(r<0)m=Math.max(m,r/(r-v));else if(v<0)t=Math.min(t,r/(r-v));if(tl&&C.z0&&I.z<1){x=G[s]=G[s]||new THREE.RenderableParticle;x.x=I.x/I.w;x.y=I.y/I.w;x.z=I.z;x.rotation=N.rotation.z;x.scale.x=N.scale.x*Math.abs(x.x-(I.x+k.projectionMatrix.n11)/(I.w+k.projectionMatrix.n14)); -x.scale.y=N.scale.y*Math.abs(x.y-(I.y+k.projectionMatrix.n22)/(I.w+k.projectionMatrix.n24));x.materials=N.materials;t.push(x);s++}}}}m&&t.sort(a);return t};this.unprojectVector=function(g,k){var m=THREE.Matrix4.makeInvert(k.matrix);m.multiplySelf(THREE.Matrix4.makeInvert(k.projectionMatrix));m.multiplyVector3(g);return g}}; -THREE.DOMRenderer=function(){THREE.Renderer.call(this);var a=null,c=new THREE.Projector,d,f,i,j;this.domElement=document.createElement("div");this.setSize=function(u,b){d=u;f=b;i=d/2;j=f/2};this.render=function(u,b){var o,q,y,z,x,s,G,J;a=c.projectScene(u,b);o=0;for(q=a.length;o0){H.r+=ga.r*$;H.g+=ga.g*$;H.b+=ga.b*$}}else if($ instanceof THREE.PointLight){Y.sub($.position,V);Y.normalize();$=T.dot(Y)*ia;if($> -0){H.r+=ga.r*$;H.g+=ga.g*$;H.b+=ga.b*$}}}}function Ga(D,V,T){if(T.opacity!=0){a(T.opacity);c(T.blending);var H,P,$,ga,ia,ja;if(T instanceof THREE.ParticleBasicMaterial){if(T.map&&T.map.image.loaded){ga=T.map.image;ia=ga.width>>1;ja=ga.height>>1;P=V.scale.x*b;$=V.scale.y*o;T=P*ia;H=$*ja;B.set(D.x-T,D.y-H,D.x+T,D.y+H);if(S.instersects(B)){q.save();q.translate(D.x,D.y);q.rotate(-V.rotation);q.scale(P,-$);q.translate(-ia,-ja);q.drawImage(ga,0,0);q.restore()}}}else if(T instanceof THREE.ParticleCircleMaterial){if(R){X.r= -ba.r+Z.r+aa.r;X.g=ba.g+Z.g+aa.g;X.b=ba.b+Z.b+aa.b;t.r=T.color.r*X.r;t.g=T.color.g*X.g;t.b=T.color.b*X.b;t.updateStyleString()}else t.__styleString=T.color.__styleString;T=V.scale.x*b;H=V.scale.y*o;B.set(D.x-T,D.y-H,D.x+T,D.y+H);if(S.instersects(B)){P=t.__styleString;if(J!=P)q.fillStyle=J=P;q.save();q.translate(D.x,D.y);q.rotate(-V.rotation);q.scale(T,H);q.beginPath();q.arc(0,0,1,0,ka,true);q.closePath();q.fill();q.restore()}}}}function Ha(D,V,T,H){if(H.opacity!=0){a(H.opacity);c(H.blending);q.beginPath(); -q.moveTo(D.positionScreen.x,D.positionScreen.y);q.lineTo(V.positionScreen.x,V.positionScreen.y);q.closePath();if(H instanceof THREE.LineBasicMaterial){t.__styleString=H.color.__styleString;D=H.linewidth;if(I!=D)q.lineWidth=I=D;D=t.__styleString;if(G!=D)q.strokeStyle=G=D;q.stroke();B.inflate(H.linewidth*2)}}}function ma(D,V,T,H,P,$){if(P.opacity!=0){a(P.opacity);c(P.blending);e=D.positionScreen.x;p=D.positionScreen.y;h=V.positionScreen.x;g=V.positionScreen.y;k=T.positionScreen.x;m=T.positionScreen.y; -q.beginPath();q.moveTo(e,p);q.lineTo(h,g);q.lineTo(k,m);q.lineTo(e,p);q.closePath();if(P instanceof THREE.MeshBasicMaterial)if(P.map)P.map.image.loaded&&P.map.mapping instanceof THREE.UVMapping&&za(e,p,h,g,k,m,P.map.image,H.uvs[0].u,H.uvs[0].v,H.uvs[1].u,H.uvs[1].v,H.uvs[2].u,H.uvs[2].v);else if(P.env_map){if(P.env_map.image.loaded)if(P.env_map.mapping instanceof THREE.SphericalReflectionMapping){D=ca.matrix;Y.copy(H.vertexNormalsWorld[0]);L=(Y.x*D.n11+Y.y*D.n12+Y.z*D.n13)*0.5+0.5;N=-(Y.x*D.n21+Y.y* -D.n22+Y.z*D.n23)*0.5+0.5;Y.copy(H.vertexNormalsWorld[1]);U=(Y.x*D.n11+Y.y*D.n12+Y.z*D.n13)*0.5+0.5;W=-(Y.x*D.n21+Y.y*D.n22+Y.z*D.n23)*0.5+0.5;Y.copy(H.vertexNormalsWorld[2]);M=(Y.x*D.n11+Y.y*D.n12+Y.z*D.n13)*0.5+0.5;E=-(Y.x*D.n21+Y.y*D.n22+Y.z*D.n23)*0.5+0.5;za(e,p,h,g,k,m,P.env_map.image,L,N,U,W,M,E)}}else P.wireframe?Da(P.color.__styleString,P.wireframe_linewidth):Ea(P.color.__styleString);else if(P instanceof THREE.MeshLambertMaterial){if(P.map&&!P.wireframe){P.map.mapping instanceof THREE.UVMapping&& -za(e,p,h,g,k,m,P.map.image,H.uvs[0].u,H.uvs[0].v,H.uvs[1].u,H.uvs[1].v,H.uvs[2].u,H.uvs[2].v);c(THREE.SubtractiveBlending)}if(R)if(!P.wireframe&&P.shading==THREE.SmoothShading&&H.vertexNormalsWorld.length==3){l.r=n.r=r.r=ba.r;l.g=n.g=r.g=ba.g;l.b=n.b=r.b=ba.b;xa($,H.v1.positionWorld,H.vertexNormalsWorld[0],l);xa($,H.v2.positionWorld,H.vertexNormalsWorld[1],n);xa($,H.v3.positionWorld,H.vertexNormalsWorld[2],r);v.r=(n.r+r.r)*0.5;v.g=(n.g+r.g)*0.5;v.b=(n.b+r.b)*0.5;K=Ma(l,n,r,v);za(e,p,h,g,k,m,K,0,0, -1,0,0,1)}else{X.r=ba.r;X.g=ba.g;X.b=ba.b;xa($,H.centroidWorld,H.normalWorld,X);t.r=P.color.r*X.r;t.g=P.color.g*X.g;t.b=P.color.b*X.b;t.updateStyleString();P.wireframe?Da(t.__styleString,P.wireframe_linewidth):Ea(t.__styleString)}else P.wireframe?Da(P.color.__styleString,P.wireframe_linewidth):Ea(P.color.__styleString)}else if(P instanceof THREE.MeshDepthMaterial){A=ca.near;C=ca.far;l.r=l.g=l.b=1-Ia(D.positionScreen.z,A,C);n.r=n.g=n.b=1-Ia(V.positionScreen.z,A,C);r.r=r.g=r.b=1-Ia(T.positionScreen.z, -A,C);v.r=(n.r+r.r)*0.5;v.g=(n.g+r.g)*0.5;v.b=(n.b+r.b)*0.5;K=Ma(l,n,r,v);za(e,p,h,g,k,m,K,0,0,1,0,0,1)}else if(P instanceof THREE.MeshNormalMaterial){t.r=Ja(H.normalWorld.x);t.g=Ja(H.normalWorld.y);t.b=Ja(H.normalWorld.z);t.updateStyleString();P.wireframe?Da(t.__styleString,P.wireframe_linewidth):Ea(t.__styleString)}}}function Da(D,V){if(G!=D)q.strokeStyle=G=D;if(I!=V)q.lineWidth=I=V;q.stroke();B.inflate(V*2)}function Ea(D){if(J!=D)q.fillStyle=J=D;q.fill()}function za(D,V,T,H,P,$,ga,ia,ja,ra,na,sa, -Aa){var pa,ta;pa=ga.width-1;ta=ga.height-1;ia*=pa;ja*=ta;ra*=pa;na*=ta;sa*=pa;Aa*=ta;T-=D;H-=V;P-=D;$-=V;ra-=ia;na-=ja;sa-=ia;Aa-=ja;pa=ra*Aa-sa*na;if(pa!=0){ta=1/pa;pa=(Aa*T-na*P)*ta;na=(Aa*H-na*$)*ta;T=(ra*P-sa*T)*ta;H=(ra*$-sa*H)*ta;D=D-pa*ia-T*ja;V=V-na*ia-H*ja;q.save();q.transform(pa,na,T,H,D,V);q.clip();q.drawImage(ga,0,0);q.restore()}}function Ma(D,V,T,H){var P=~~(D.r*255),$=~~(D.g*255);D=~~(D.b*255);var ga=~~(V.r*255),ia=~~(V.g*255);V=~~(V.b*255);var ja=~~(T.r*255),ra=~~(T.g*255);T=~~(T.b* -255);var na=~~(H.r*255),sa=~~(H.g*255);H=~~(H.b*255);ha[0]=P<0?0:P>255?255:P;ha[1]=$<0?0:$>255?255:$;ha[2]=D<0?0:D>255?255:D;ha[4]=ga<0?0:ga>255?255:ga;ha[5]=ia<0?0:ia>255?255:ia;ha[6]=V<0?0:V>255?255:V;ha[8]=ja<0?0:ja>255?255:ja;ha[9]=ra<0?0:ra>255?255:ra;ha[10]=T<0?0:T>255?255:T;ha[12]=na<0?0:na>255?255:na;ha[13]=sa<0?0:sa>255?255:sa;ha[14]=H<0?0:H>255?255:H;fa.putImageData(wa,0,0);va.drawImage(ua,0,0);return la}function Ia(D,V,T){D=(D-V)/(T-V);return D*D*(3-2*D)}function Ja(D){D=(D+1)*0.5;return D< -0?0:D>1?1:D}function Ka(D,V){var T=V.x-D.x,H=V.y-D.y,P=1/Math.sqrt(T*T+H*H);T*=P;H*=P;V.x+=T;V.y+=H;D.x-=T;D.y-=H}var Fa,Na,ea,qa,ya,La,Oa,Ba;this.autoClear?this.clear():q.setTransform(1,0,0,-1,b,o);d=f.projectScene(da,ca,this.sortElements);(R=da.lights.length>0)&&Ca(da);Fa=0;for(Na=d.length;Fa=0&&j>=0&&l>=0&&s>=0)return true;else if(t<0&&j<0||l<0&&s<0)return false;else{if(t<0)o=Math.max(o,t/(t-j));else if(j<0)i=Math.min(i,t/(t-j));if(l<0)o=Math.max(o,l/(l-s));else if(s<0)i=Math.min(i,l/(l-s));if(it&&v.z0&&K.z<1){x=w[y]=w[y]||new THREE.RenderableParticle;x.x=K.x/K.w;x.y=K.y/K.w;x.z=K.z;x.rotation=E.rotation.z;x.scale.x=E.scale.x*Math.abs(x.x-(K.x+g.projectionMatrix.n11)/(K.w+g.projectionMatrix.n14)); +x.scale.y=E.scale.y*Math.abs(x.y-(K.y+g.projectionMatrix.n22)/(K.w+g.projectionMatrix.n24));x.materials=E.materials;i.push(x);y++}}}}o&&i.sort(a);return i};this.unprojectVector=function(h,g){var o=THREE.Matrix4.makeInvert(g.matrix);o.multiplySelf(THREE.Matrix4.makeInvert(g.projectionMatrix));o.multiplyVector3(h);return h}}; +THREE.DOMRenderer=function(){THREE.Renderer.call(this);var a=null,c=new THREE.Projector,d,f,k,m;this.domElement=document.createElement("div");this.setSize=function(r,b){d=r;f=b;k=d/2;m=f/2};this.render=function(r,b){var n,p,B,A,x,y,w,I;a=c.projectScene(r,b);n=0;for(p=a.length;n0){G.r+=fa.r*$;G.g+=fa.g*$;G.b+=fa.b*$}}else if($ instanceof THREE.PointLight){Z.sub($.position,V);Z.normalize();$=T.dot(Z)*ja;if($> +0){G.r+=fa.r*$;G.g+=fa.g*$;G.b+=fa.b*$}}}}function Ga(D,V,T){if(T.opacity!=0){a(T.opacity);c(T.blending);var G,Q,$,fa,ja,la;if(T instanceof THREE.ParticleBasicMaterial){if(T.map&&T.map.image.loaded){fa=T.map.image;ja=fa.width>>1;la=fa.height>>1;Q=V.scale.x*b;$=V.scale.y*n;T=Q*ja;G=$*la;C.set(D.x-T,D.y-G,D.x+T,D.y+G);if(O.instersects(C)){p.save();p.translate(D.x,D.y);p.rotate(-V.rotation);p.scale(Q,-$);p.translate(-ja,-la);p.drawImage(fa,0,0);p.restore()}}}else if(T instanceof THREE.ParticleCircleMaterial){if(L){W.r= +ga.r+da.r+Y.r;W.g=ga.g+da.g+Y.g;W.b=ga.b+da.b+Y.b;i.r=T.color.r*W.r;i.g=T.color.g*W.g;i.b=T.color.b*W.b;i.updateStyleString()}else i.__styleString=T.color.__styleString;T=V.scale.x*b;G=V.scale.y*n;C.set(D.x-T,D.y-G,D.x+T,D.y+G);if(O.instersects(C)){Q=i.__styleString;if(I!=Q)p.fillStyle=I=Q;p.save();p.translate(D.x,D.y);p.rotate(-V.rotation);p.scale(T,G);p.beginPath();p.arc(0,0,1,0,ba,true);p.closePath();p.fill();p.restore()}}}}function Ha(D,V,T,G){if(G.opacity!=0){a(G.opacity);c(G.blending);p.beginPath(); +p.moveTo(D.positionScreen.x,D.positionScreen.y);p.lineTo(V.positionScreen.x,V.positionScreen.y);p.closePath();if(G instanceof THREE.LineBasicMaterial){i.__styleString=G.color.__styleString;D=G.linewidth;if(K!=D)p.lineWidth=K=D;D=i.__styleString;if(w!=D)p.strokeStyle=w=D;p.stroke();C.inflate(G.linewidth*2)}}}function Da(D,V,T,G,Q,$){if(Q.opacity!=0){a(Q.opacity);c(Q.blending);P=D.positionScreen.x;e=D.positionScreen.y;q=V.positionScreen.x;h=V.positionScreen.y;g=T.positionScreen.x;o=T.positionScreen.y; +p.beginPath();p.moveTo(P,e);p.lineTo(q,h);p.lineTo(g,o);p.lineTo(P,e);p.closePath();if(Q instanceof THREE.MeshBasicMaterial)if(Q.map)Q.map.image.loaded&&Q.map.mapping instanceof THREE.UVMapping&&Aa(P,e,q,h,g,o,Q.map.image,G.uvs[0].u,G.uvs[0].v,G.uvs[1].u,G.uvs[1].v,G.uvs[2].u,G.uvs[2].v);else if(Q.env_map){if(Q.env_map.image.loaded)if(Q.env_map.mapping instanceof THREE.SphericalReflectionMapping){D=na.matrix;Z.copy(G.vertexNormalsWorld[0]);J=(Z.x*D.n11+Z.y*D.n12+Z.z*D.n13)*0.5+0.5;E=-(Z.x*D.n21+Z.y* +D.n22+Z.z*D.n23)*0.5+0.5;Z.copy(G.vertexNormalsWorld[1]);U=(Z.x*D.n11+Z.y*D.n12+Z.z*D.n13)*0.5+0.5;X=-(Z.x*D.n21+Z.y*D.n22+Z.z*D.n23)*0.5+0.5;Z.copy(G.vertexNormalsWorld[2]);N=(Z.x*D.n11+Z.y*D.n12+Z.z*D.n13)*0.5+0.5;H=-(Z.x*D.n21+Z.y*D.n22+Z.z*D.n23)*0.5+0.5;Aa(P,e,q,h,g,o,Q.env_map.image,J,E,U,X,N,H)}}else Q.wireframe?ma(Q.color.__styleString,Q.wireframe_linewidth):Ea(Q.color.__styleString);else if(Q instanceof THREE.MeshLambertMaterial){if(Q.map&&!Q.wireframe){Q.map.mapping instanceof THREE.UVMapping&& +Aa(P,e,q,h,g,o,Q.map.image,G.uvs[0].u,G.uvs[0].v,G.uvs[1].u,G.uvs[1].v,G.uvs[2].u,G.uvs[2].v);c(THREE.SubtractiveBlending)}if(L)if(!Q.wireframe&&Q.shading==THREE.SmoothShading&&G.vertexNormalsWorld.length==3){t.r=j.r=l.r=ga.r;t.g=j.g=l.g=ga.g;t.b=j.b=l.b=ga.b;ya($,G.v1.positionWorld,G.vertexNormalsWorld[0],t);ya($,G.v2.positionWorld,G.vertexNormalsWorld[1],j);ya($,G.v3.positionWorld,G.vertexNormalsWorld[2],l);s.r=(j.r+l.r)*0.5;s.g=(j.g+l.g)*0.5;s.b=(j.b+l.b)*0.5;M=Ma(t,j,l,s);Aa(P,e,q,h,g,o,M,0,0, +1,0,0,1)}else{W.r=ga.r;W.g=ga.g;W.b=ga.b;ya($,G.centroidWorld,G.normalWorld,W);i.r=Q.color.r*W.r;i.g=Q.color.g*W.g;i.b=Q.color.b*W.b;i.updateStyleString();Q.wireframe?ma(i.__styleString,Q.wireframe_linewidth):Ea(i.__styleString)}else Q.wireframe?ma(Q.color.__styleString,Q.wireframe_linewidth):Ea(Q.color.__styleString)}else if(Q instanceof THREE.MeshDepthMaterial){z=na.near;v=na.far;t.r=t.g=t.b=1-Ia(D.positionScreen.z,z,v);j.r=j.g=j.b=1-Ia(V.positionScreen.z,z,v);l.r=l.g=l.b=1-Ia(T.positionScreen.z, +z,v);s.r=(j.r+l.r)*0.5;s.g=(j.g+l.g)*0.5;s.b=(j.b+l.b)*0.5;M=Ma(t,j,l,s);Aa(P,e,q,h,g,o,M,0,0,1,0,0,1)}else if(Q instanceof THREE.MeshNormalMaterial){i.r=Ja(G.normalWorld.x);i.g=Ja(G.normalWorld.y);i.b=Ja(G.normalWorld.z);i.updateStyleString();Q.wireframe?ma(i.__styleString,Q.wireframe_linewidth):Ea(i.__styleString)}}}function ma(D,V){if(w!=D)p.strokeStyle=w=D;if(K!=V)p.lineWidth=K=V;p.stroke();C.inflate(V*2)}function Ea(D){if(I!=D)p.fillStyle=I=D;p.fill()}function Aa(D,V,T,G,Q,$,fa,ja,la,ua,oa,va, +Ba){var ra,wa;ra=fa.width-1;wa=fa.height-1;ja*=ra;la*=wa;ua*=ra;oa*=wa;va*=ra;Ba*=wa;T-=D;G-=V;Q-=D;$-=V;ua-=ja;oa-=la;va-=ja;Ba-=la;ra=ua*Ba-va*oa;if(ra!=0){wa=1/ra;ra=(Ba*T-oa*Q)*wa;oa=(Ba*G-oa*$)*wa;T=(ua*Q-va*T)*wa;G=(ua*$-va*G)*wa;D=D-ra*ja-T*la;V=V-oa*ja-G*la;p.save();p.transform(ra,oa,T,G,D,V);p.clip();p.drawImage(fa,0,0);p.restore()}}function Ma(D,V,T,G){var Q=~~(D.r*255),$=~~(D.g*255);D=~~(D.b*255);var fa=~~(V.r*255),ja=~~(V.g*255);V=~~(V.b*255);var la=~~(T.r*255),ua=~~(T.g*255);T=~~(T.b* +255);var oa=~~(G.r*255),va=~~(G.g*255);G=~~(G.b*255);ia[0]=Q<0?0:Q>255?255:Q;ia[1]=$<0?0:$>255?255:$;ia[2]=D<0?0:D>255?255:D;ia[4]=fa<0?0:fa>255?255:fa;ia[5]=ja<0?0:ja>255?255:ja;ia[6]=V<0?0:V>255?255:V;ia[8]=la<0?0:la>255?255:la;ia[9]=ua<0?0:ua>255?255:ua;ia[10]=T<0?0:T>255?255:T;ia[12]=oa<0?0:oa>255?255:oa;ia[13]=va<0?0:va>255?255:va;ia[14]=G<0?0:G>255?255:G;xa.putImageData(ha,0,0);pa.drawImage(ea,0,0);return ta}function Ia(D,V,T){D=(D-V)/(T-V);return D*D*(3-2*D)}function Ja(D){D=(D+1)*0.5;return D< +0?0:D>1?1:D}function Ka(D,V){var T=V.x-D.x,G=V.y-D.y,Q=1/Math.sqrt(T*T+G*G);T*=Q;G*=Q;V.x+=T;V.y+=G;D.x-=T;D.y-=G}var Fa,Na,ca,sa,za,La,Oa,Ca;this.autoClear?this.clear():p.setTransform(1,0,0,-1,b,n);d=f.projectScene(aa,na,this.sortElements);(L=aa.lights.length>0)&&ka(aa);Fa=0;for(Na=d.length;Fa0){U.r+=E.color.r*S;U.g+=E.color.g*S;U.b+=E.color.b*S}}else if(E instanceof THREE.PointLight){m.sub(E.position,N.centroidWorld);m.normalize();S=N.normalWorld.dot(m)*E.intensity;if(S>0){U.r+=E.color.r*S;U.g+=E.color.g*S;U.b+=E.color.b*S}}}}function c(L,N,U,W,M,E){r=f(v++);r.setAttribute("d","M "+L.positionScreen.x+ -" "+L.positionScreen.y+" L "+N.positionScreen.x+" "+N.positionScreen.y+" L "+U.positionScreen.x+","+U.positionScreen.y+"z");if(M instanceof THREE.MeshBasicMaterial)F.__styleString=M.color.__styleString;else if(M instanceof THREE.MeshLambertMaterial)if(Q){e.r=p.r;e.g=p.g;e.b=p.b;a(E,W,e);F.r=M.color.r*e.r;F.g=M.color.g*e.g;F.b=M.color.b*e.b;F.updateStyleString()}else F.__styleString=M.color.__styleString;else if(M instanceof THREE.MeshDepthMaterial){k=1-M.__2near/(M.__farPlusNear-W.z*M.__farMinusNear); -F.setRGB(k,k,k)}else M instanceof THREE.MeshNormalMaterial&&F.setRGB(i(W.normalWorld.x),i(W.normalWorld.y),i(W.normalWorld.z));M.wireframe?r.setAttribute("style","fill: none; stroke: "+F.__styleString+"; stroke-width: "+M.wireframe_linewidth+"; stroke-opacity: "+M.opacity+"; stroke-linecap: "+M.wireframe_linecap+"; stroke-linejoin: "+M.wireframe_linejoin):r.setAttribute("style","fill: "+F.__styleString+"; fill-opacity: "+M.opacity);b.appendChild(r)}function d(L,N,U,W,M,E,S){r=f(v++);r.setAttribute("d", -"M "+L.positionScreen.x+" "+L.positionScreen.y+" L "+N.positionScreen.x+" "+N.positionScreen.y+" L "+U.positionScreen.x+","+U.positionScreen.y+" L "+W.positionScreen.x+","+W.positionScreen.y+"z");if(E instanceof THREE.MeshBasicMaterial)F.__styleString=E.color.__styleString;else if(E instanceof THREE.MeshLambertMaterial)if(Q){e.r=p.r;e.g=p.g;e.b=p.b;a(S,M,e);F.r=E.color.r*e.r;F.g=E.color.g*e.g;F.b=E.color.b*e.b;F.updateStyleString()}else F.__styleString=E.color.__styleString;else if(E instanceof THREE.MeshDepthMaterial){k= -1-E.__2near/(E.__farPlusNear-M.z*E.__farMinusNear);F.setRGB(k,k,k)}else E instanceof THREE.MeshNormalMaterial&&F.setRGB(i(M.normalWorld.x),i(M.normalWorld.y),i(M.normalWorld.z));E.wireframe?r.setAttribute("style","fill: none; stroke: "+F.__styleString+"; stroke-width: "+E.wireframe_linewidth+"; stroke-opacity: "+E.opacity+"; stroke-linecap: "+E.wireframe_linecap+"; stroke-linejoin: "+E.wireframe_linejoin):r.setAttribute("style","fill: "+F.__styleString+"; fill-opacity: "+E.opacity);b.appendChild(r)} -function f(L){if(t[L]==null){t[L]=document.createElementNS("http://www.w3.org/2000/svg","path");K==0&&t[L].setAttribute("shape-rendering","crispEdges");return t[L]}return t[L]}function i(L){return L<0?Math.min((1+L)*0.5,0.5):0.5+Math.min(L*0.5,0.5)}var j=null,u=new THREE.Projector,b=document.createElementNS("http://www.w3.org/2000/svg","svg"),o,q,y,z,x,s,G,J,I=new THREE.Rectangle,w=new THREE.Rectangle,Q=false,F=new THREE.Color(16777215),e=new THREE.Color(16777215),p=new THREE.Color(0),h=new THREE.Color(0), -g=new THREE.Color(0),k,m=new THREE.Vector3,t=[],l=[],n=[],r,v,A,C,K=1;this.domElement=b;this.sortElements=this.sortObjects=this.autoClear=true;this.setQuality=function(L){switch(L){case "high":K=1;break;case "low":K=0}};this.setSize=function(L,N){o=L;q=N;y=o/2;z=q/2;b.setAttribute("viewBox",-y+" "+-z+" "+o+" "+q);b.setAttribute("width",o);b.setAttribute("height",q);I.set(-y,-z,y,z)};this.clear=function(){for(;b.childNodes.length>0;)b.removeChild(b.childNodes[0])};this.render=function(L,N){var U,W, -M,E,S,O,B,R;this.autoClear&&this.clear();j=u.projectScene(L,N,this.sortElements);C=A=v=0;if(Q=L.lights.length>0){B=L.lights;p.setRGB(0,0,0);h.setRGB(0,0,0);g.setRGB(0,0,0);U=0;for(W=B.length;U0){U.r+=H.color.r*O;U.g+=H.color.g*O;U.b+=H.color.b*O}}else if(H instanceof THREE.PointLight){o.sub(H.position,E.centroidWorld);o.normalize();O=E.normalWorld.dot(o)*H.intensity;if(O>0){U.r+=H.color.r*O;U.g+=H.color.g*O;U.b+=H.color.b*O}}}}function c(J,E,U,X,N,H){l=f(s++);l.setAttribute("d","M "+J.positionScreen.x+ +" "+J.positionScreen.y+" L "+E.positionScreen.x+" "+E.positionScreen.y+" L "+U.positionScreen.x+","+U.positionScreen.y+"z");if(N instanceof THREE.MeshBasicMaterial)F.__styleString=N.color.__styleString;else if(N instanceof THREE.MeshLambertMaterial)if(R){P.r=e.r;P.g=e.g;P.b=e.b;a(H,X,P);F.r=N.color.r*P.r;F.g=N.color.g*P.g;F.b=N.color.b*P.b;F.updateStyleString()}else F.__styleString=N.color.__styleString;else if(N instanceof THREE.MeshDepthMaterial){g=1-N.__2near/(N.__farPlusNear-X.z*N.__farMinusNear); +F.setRGB(g,g,g)}else N instanceof THREE.MeshNormalMaterial&&F.setRGB(k(X.normalWorld.x),k(X.normalWorld.y),k(X.normalWorld.z));N.wireframe?l.setAttribute("style","fill: none; stroke: "+F.__styleString+"; stroke-width: "+N.wireframe_linewidth+"; stroke-opacity: "+N.opacity+"; stroke-linecap: "+N.wireframe_linecap+"; stroke-linejoin: "+N.wireframe_linejoin):l.setAttribute("style","fill: "+F.__styleString+"; fill-opacity: "+N.opacity);b.appendChild(l)}function d(J,E,U,X,N,H,O){l=f(s++);l.setAttribute("d", +"M "+J.positionScreen.x+" "+J.positionScreen.y+" L "+E.positionScreen.x+" "+E.positionScreen.y+" L "+U.positionScreen.x+","+U.positionScreen.y+" L "+X.positionScreen.x+","+X.positionScreen.y+"z");if(H instanceof THREE.MeshBasicMaterial)F.__styleString=H.color.__styleString;else if(H instanceof THREE.MeshLambertMaterial)if(R){P.r=e.r;P.g=e.g;P.b=e.b;a(O,N,P);F.r=H.color.r*P.r;F.g=H.color.g*P.g;F.b=H.color.b*P.b;F.updateStyleString()}else F.__styleString=H.color.__styleString;else if(H instanceof THREE.MeshDepthMaterial){g= +1-H.__2near/(H.__farPlusNear-N.z*H.__farMinusNear);F.setRGB(g,g,g)}else H instanceof THREE.MeshNormalMaterial&&F.setRGB(k(N.normalWorld.x),k(N.normalWorld.y),k(N.normalWorld.z));H.wireframe?l.setAttribute("style","fill: none; stroke: "+F.__styleString+"; stroke-width: "+H.wireframe_linewidth+"; stroke-opacity: "+H.opacity+"; stroke-linecap: "+H.wireframe_linecap+"; stroke-linejoin: "+H.wireframe_linejoin):l.setAttribute("style","fill: "+F.__styleString+"; fill-opacity: "+H.opacity);b.appendChild(l)} +function f(J){if(i[J]==null){i[J]=document.createElementNS("http://www.w3.org/2000/svg","path");M==0&&i[J].setAttribute("shape-rendering","crispEdges");return i[J]}return i[J]}function k(J){return J<0?Math.min((1+J)*0.5,0.5):0.5+Math.min(J*0.5,0.5)}var m=null,r=new THREE.Projector,b=document.createElementNS("http://www.w3.org/2000/svg","svg"),n,p,B,A,x,y,w,I,K=new THREE.Rectangle,u=new THREE.Rectangle,R=false,F=new THREE.Color(16777215),P=new THREE.Color(16777215),e=new THREE.Color(0),q=new THREE.Color(0), +h=new THREE.Color(0),g,o=new THREE.Vector3,i=[],t=[],j=[],l,s,z,v,M=1;this.domElement=b;this.sortElements=this.sortObjects=this.autoClear=true;this.setQuality=function(J){switch(J){case "high":M=1;break;case "low":M=0}};this.setSize=function(J,E){n=J;p=E;B=n/2;A=p/2;b.setAttribute("viewBox",-B+" "+-A+" "+n+" "+p);b.setAttribute("width",n);b.setAttribute("height",p);K.set(-B,-A,B,A)};this.clear=function(){for(;b.childNodes.length>0;)b.removeChild(b.childNodes[0])};this.render=function(J,E){var U,X, +N,H,O,S,C,L;this.autoClear&&this.clear();m=r.projectScene(J,E,this.sortElements);v=z=s=0;if(R=J.lights.length>0){C=J.lights;e.setRGB(0,0,0);q.setRGB(0,0,0);h.setRGB(0,0,0);U=0;for(X=C.length;U0){b.bindBuffer(b.ARRAY_BUFFER,e.__webGLUVBuffer);b.bufferData(b.ARRAY_BUFFER,R,h)}if(la&&U>0){b.bindBuffer(b.ARRAY_BUFFER,e.__webGLUV2Buffer);b.bufferData(b.ARRAY_BUFFER,X,h)}if(ha){b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e.__webGLFaceBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER, -ka,h);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e.__webGLLineBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,Y,h)}};this.setLineBuffers=function(e,p){var h,g,k,m=e.vertices,t=e.colors,l=m.length,n=t.length,r=e.__vertexArray,v=e.__colorArray,A=e.__dirtyColors;if(e.__dirtyVertices){for(h=0;h0?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+m.maxDirLights,"#define MAX_POINT_LIGHTS "+m.maxPointLights,m.map?"#define USE_MAP":"",m.env_map?"#define USE_ENVMAP": -"",m.light_map?"#define USE_LIGHTMAP":"",m.vertex_colors?"#define USE_COLOR":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\n"].join("\n");b.attachShader(h,i("fragment",k+n));b.attachShader(h,i("vertex",m+p));b.linkProgram(h);b.getProgramParameter(h,b.LINK_STATUS)|| -alert("Could not initialise shaders\nVALIDATE_STATUS: "+b.getProgramParameter(h,b.VALIDATE_STATUS)+", gl error ["+b.getError()+"]");h.uniforms={};h.attributes={};e.program=h;h=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition"];for(g in e.uniforms)h.push(g);g=e.program;n=0;for(p=h.length;n=0){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLColorBuffer);b.vertexAttribPointer(e.color,3,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.color)}if(e.normal>=0){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLNormalBuffer);b.vertexAttribPointer(e.normal,3,b.FLOAT, -false,0,0);b.enableVertexAttribArray(e.normal)}if(e.tangent>=0){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLTangentBuffer);b.vertexAttribPointer(e.tangent,4,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.tangent)}if(e.uv>=0)if(k.__webGLUVBuffer){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLUVBuffer);b.vertexAttribPointer(e.uv,2,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.uv)}else b.disableVertexAttribArray(e.uv);if(e.uv2>=0)if(k.__webGLUV2Buffer){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLUV2Buffer);b.vertexAttribPointer(e.uv2, -2,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.uv2)}else b.disableVertexAttribArray(e.uv2);if(m instanceof THREE.Mesh)if(g.wireframe){b.lineWidth(g.wireframe_linewidth);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,k.__webGLLineBuffer);b.drawElements(b.LINES,k.__webGLLineCount,b.UNSIGNED_SHORT,0)}else{b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,k.__webGLFaceBuffer);b.drawElements(b.TRIANGLES,k.__webGLFaceCount,b.UNSIGNED_SHORT,0)}else if(m instanceof THREE.Line){m=m.type==THREE.LineStrip?b.LINE_STRIP:b.LINES;b.lineWidth(g.linewidth); -b.drawArrays(m,0,k.__webGLLineCount)}else m instanceof THREE.ParticleSystem&&b.drawArrays(b.POINTS,0,k.__webGLParticleCount)};this.renderPass=function(e,p,h,g,k,m,t){var l,n,r,v,A;r=0;for(v=g.materials.length;r=0;h--){g=e.__webGLObjects[h].object; -p==g&&e.__webGLObjects.splice(h,1)}};this.setupMatrices=function(e,p){e._modelViewMatrix.multiplyToArray(p.matrix,e.matrix,e._modelViewMatrixArray);e._normalMatrix=THREE.Matrix4.makeInvert3x3(e._modelViewMatrix).transposeIntoArray(e._normalMatrixArray)};this.setDepthTest=function(e){e?b.enable(b.DEPTH_TEST):b.disable(b.DEPTH_TEST)};this.setFaceCulling=function(e,p){if(e){!p||p=="ccw"?b.frontFace(b.CCW):b.frontFace(b.CW);if(e=="back")b.cullFace(b.BACK);else e=="front"?b.cullFace(b.FRONT):b.cullFace(b.FRONT_AND_BACK); -b.enable(b.CULL_FACE)}else b.disable(b.CULL_FACE)};this.supportsVertexTextures=function(){return b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0}}; +case THREE.UnsignedByteType:return b.UNSIGNED_BYTE;case THREE.ShortType:return b.SHORT;case THREE.UnsignedShortType:return b.UNSIGNED_SHORT;case THREE.IntType:return b.INT;case THREE.UnsignedShortType:return b.UNSIGNED_INT;case THREE.FloatType:return b.FLOAT;case THREE.AlphaFormat:return b.ALPHA;case THREE.RGBFormat:return b.RGB;case THREE.RGBAFormat:return b.RGBA;case THREE.LuminanceFormat:return b.LUMINANCE;case THREE.LuminanceAlphaFormat:return b.LUMINANCE_ALPHA}return 0}var r=document.createElement("canvas"), +b,n=null,p=null,B=null,A=null,x=null,y=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],w=new THREE.Matrix4,I=new Float32Array(16),K=new Float32Array(16),u=new THREE.Vector4,R=true,F=new THREE.Color(0),P=0;if(a){if(a.antialias!==undefined)R=a.antialias;a.clearColor!==undefined&&F.setHex(a.clearColor);if(a.clearAlpha!==undefined)P=a.clearAlpha}this.domElement=r;this.autoClear=true;(function(e,q,h){try{b=r.getContext("experimental-webgl", +{antialias:e})}catch(g){console.log(g)}if(!b){alert("WebGL not supported");throw"cannot create webgl context";}b.clearColor(0,0,0,1);b.clearDepth(1);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.enable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.ONE,b.ONE_MINUS_SRC_ALPHA);b.clearColor(q.r,q.g,q.b,h);_cullEnabled=true})(R,F,P);this.context=b;this.lights={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[]}};this.setSize= +function(e,q){r.width=e;r.height=q;b.viewport(0,0,r.width,r.height)};this.setClearColorHex=function(e,q){var h=new THREE.Color(e);b.clearColor(h.r,h.g,h.b,q)};this.setClearColor=function(e,q){b.clearColor(e.r,e.g,e.b,q)};this.clear=function(){b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)};this.setupLights=function(e,q){var h,g,o,i=0,t=0,j=0,l,s,z,v=this.lights,M=v.directional.colors,J=v.directional.positions,E=v.point.colors,U=v.point.positions,X=0,N=0;h=o=o=0;for(g=q.length;h0){b.bindBuffer(b.ARRAY_BUFFER,e.__webGLUVBuffer);b.bufferData(b.ARRAY_BUFFER,W,h)}if(pa&&X>0){b.bindBuffer(b.ARRAY_BUFFER,e.__webGLUV2Buffer); +b.bufferData(b.ARRAY_BUFFER,ga,h)}if(ta){b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e.__webGLFaceBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,Z,h);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e.__webGLLineBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,ea,h)}};this.setLineBuffers=function(e,q){var h,g,o,i=e.vertices,t=e.colors,j=i.length,l=t.length,s=e.__vertexArray,z=e.__colorArray,v=e.__dirtyColors;if(e.__dirtyVertices){for(h=0;h0?"#define VERTEX_TEXTURES": +"","#define MAX_DIR_LIGHTS "+i.maxDirLights,"#define MAX_POINT_LIGHTS "+i.maxPointLights,i.map?"#define USE_MAP":"",i.env_map?"#define USE_ENVMAP":"",i.light_map?"#define USE_LIGHTMAP":"",i.vertex_colors?"#define USE_COLOR":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\n"].join("\n"); +b.attachShader(h,k("fragment",o+l));b.attachShader(h,k("vertex",i+q));b.linkProgram(h);b.getProgramParameter(h,b.LINK_STATUS)||alert("Could not initialise shaders\nVALIDATE_STATUS: "+b.getProgramParameter(h,b.VALIDATE_STATUS)+", gl error ["+b.getError()+"]");h.uniforms={};h.attributes={};e.program=h;h=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition"];for(g in e.uniforms)h.push(g);g=e.program;l=0;for(q=h.length;l=0){b.bindBuffer(b.ARRAY_BUFFER,o.__webGLColorBuffer);b.vertexAttribPointer(e.color,3,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.color)}if(e.normal>= +0){b.bindBuffer(b.ARRAY_BUFFER,o.__webGLNormalBuffer);b.vertexAttribPointer(e.normal,3,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.normal)}if(e.tangent>=0){b.bindBuffer(b.ARRAY_BUFFER,o.__webGLTangentBuffer);b.vertexAttribPointer(e.tangent,4,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.tangent)}if(e.uv>=0)if(o.__webGLUVBuffer){b.bindBuffer(b.ARRAY_BUFFER,o.__webGLUVBuffer);b.vertexAttribPointer(e.uv,2,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.uv)}else b.disableVertexAttribArray(e.uv);if(e.uv2>= +0)if(o.__webGLUV2Buffer){b.bindBuffer(b.ARRAY_BUFFER,o.__webGLUV2Buffer);b.vertexAttribPointer(e.uv2,2,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.uv2)}else b.disableVertexAttribArray(e.uv2);if(i instanceof THREE.Mesh)if(g.wireframe){b.lineWidth(g.wireframe_linewidth);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,o.__webGLLineBuffer);b.drawElements(b.LINES,o.__webGLLineCount,b.UNSIGNED_SHORT,0)}else{b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,o.__webGLFaceBuffer);b.drawElements(b.TRIANGLES,o.__webGLFaceCount,b.UNSIGNED_SHORT, +0)}else if(i instanceof THREE.Line){i=i.type==THREE.LineStrip?b.LINE_STRIP:b.LINES;b.lineWidth(g.linewidth);b.drawArrays(i,0,o.__webGLLineCount)}else i instanceof THREE.ParticleSystem&&b.drawArrays(b.POINTS,0,o.__webGLParticleCount)};this.renderPass=function(e,q,h,g,o,i,t){var j,l,s,z,v;s=0;for(z=g.materials.length;s=0;h--){g=e.__webGLObjects[h].object;q==g&&e.__webGLObjects.splice(h,1)}};this.setupMatrices=function(e,q){e._modelViewMatrix.multiplyToArray(q.matrix,e.matrix,e._modelViewMatrixArray);e._normalMatrix=THREE.Matrix4.makeInvert3x3(e._modelViewMatrix).transposeIntoArray(e._normalMatrixArray)};this.setDepthTest=function(e){e?b.enable(b.DEPTH_TEST):b.disable(b.DEPTH_TEST)};this.setFaceCulling=function(e,q){if(e){!q||q=="ccw"?b.frontFace(b.CCW):b.frontFace(b.CW); +if(e=="back")b.cullFace(b.BACK);else e=="front"?b.cullFace(b.FRONT):b.cullFace(b.FRONT_AND_BACK);b.enable(b.CULL_FACE)}else b.disable(b.CULL_FACE)};this.supportsVertexTextures=function(){return b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0}}; THREE.Snippets={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube env_map;\nuniform int combine;\n#endif", envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( env_map, vec3( -vReflect.x, vReflect.yz ) );\nif ( combine == 1 ) {\ngl_FragColor = vec4( mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity ), opacity );\n} else {\ngl_FragColor = gl_FragColor * cubeColor;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refraction_ratio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refraction_ratio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif", map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\n#endif",map_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\nvarying vec2 vUv2;\nuniform sampler2D light_map;\n#endif", diff --git a/build/ThreeDebug.js b/build/ThreeDebug.js index de8957f0..daee481b 100644 --- a/build/ThreeDebug.js +++ b/build/ThreeDebug.js @@ -1,6 +1,6 @@ // ThreeDebug.js r32 - http://github.com/mrdoob/three.js var THREE=THREE||{};THREE.Color=function(a){this.autoUpdate=true;this.setHex(a)}; -THREE.Color.prototype={setRGB:function(a,c,d){this.r=a;this.g=c;this.b=d;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,c,d){var f,i,j,u,b,o;if(d==0)f=i=j=0;else{u=Math.floor(a*6);b=a*6-u;a=d*(1-c);o=d*(1-c*b);c=d*(1-c*(1-b));switch(u){case 1:f=o;i=d;j=a;break;case 2:f=a;i=d;j=c;break;case 3:f=a;i=o;j=d;break;case 4:f=c;i=a;j=d;break;case 5:f=d;i=a;j=o;break;case 6:case 0:f=d;i=c;j=a}}this.r=f;this.g=i;this.b=j;if(this.autoUpdate){this.updateHex();this.updateStyleString()}}, +THREE.Color.prototype={setRGB:function(a,c,d){this.r=a;this.g=c;this.b=d;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,c,d){var f,k,m,r,b,n;if(d==0)f=k=m=0;else{r=Math.floor(a*6);b=a*6-r;a=d*(1-c);n=d*(1-c*b);c=d*(1-c*(1-b));switch(r){case 1:f=n;k=d;m=a;break;case 2:f=a;k=d;m=c;break;case 3:f=a;k=n;m=d;break;case 4:f=c;k=a;m=d;break;case 5:f=d;k=a;m=n;break;case 6:case 0:f=d;k=c;m=a}}this.r=f;this.g=k;this.b=m;if(this.autoUpdate){this.updateHex();this.updateStyleString()}}, setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGBA();this.updateStyleString()}},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGBA:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)},toString:function(){return"THREE.Color ( r: "+ this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,c){this.x=a||0;this.y=c||0}; THREE.Vector2.prototype={set:function(a,c){this.x=a;this.y=c;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},add:function(a,c){this.x=a.x+c.x;this.y=a.y+c.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},sub:function(a,c){this.x=a.x-c.x;this.y=a.y-c.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},unit:function(){this.multiplyScalar(1/this.length());return this},length:function(){return Math.sqrt(this.x* @@ -13,52 +13,52 @@ THREE.Vector4=function(a,c,d,f){this.x=a||0;this.y=c||0;this.z=d||0;this.w=f||1} THREE.Vector4.prototype={set:function(a,c,d,f){this.x=a;this.y=c;this.z=d;this.w=f;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w||1;return this},add:function(a,c){this.x=a.x+c.x;this.y=a.y+c.y;this.z=a.z+c.z;this.w=a.w+c.w;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub:function(a,c){this.x=a.x-c.x;this.y=a.y-c.y;this.z=a.z-c.z;this.w=a.w-c.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w; return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){this.x/=a;this.y/=a;this.z/=a;this.w/=a;return this},lerpSelf:function(a,c){this.x+=(a.x-this.x)*c;this.y+=(a.y-this.y)*c;this.z+=(a.z-this.z)*c;this.w+=(a.w-this.w)*c},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}}; THREE.Ray=function(a,c){this.origin=a||new THREE.Vector3;this.direction=c||new THREE.Vector3}; -THREE.Ray.prototype={intersectScene:function(a){var c,d,f=a.objects,i=[];a=0;for(c=f.length;a0&&I>0&&p+I<1}var d,f,i,j,u,b,o,q,y,z, -x,s=a.geometry,G=s.vertices,J=[];d=0;for(f=s.faces.length;do?f:o;i=i>q? -i:q}a()};this.add3Points=function(o,q,y,z,x,s){if(b){b=false;c=oy?o>x?o:x:y>x?y:x;i=q>z?q>s?q:s:z>s?z:s}else{c=oy?o>x?o>f?o:f:x>f?x:f:y>x?y>f?y:f:x>f?x:f;i=q>z?q>s?q>i?q:i:s>i?s:i:z>s?z>i?z:i:s>i?s:i}a()};this.addRectangle=function(o){if(b){b=false;c=o.getLeft();d=o.getTop();f=o.getRight();i=o.getBottom()}else{c=co.getRight()?f:o.getRight();i=i>o.getBottom()?i:o.getBottom()}a()};this.inflate=function(o){c-=o;d-=o;f+=o;i+=o;a()};this.minSelf=function(o){c=c>o.getLeft()?c:o.getLeft();d=d>o.getTop()?d:o.getTop();f=f=0&&Math.min(i,o.getBottom())-Math.max(d,o.getTop())>=0};this.empty=function(){b=true;i=f=d=c=0;a()};this.isEmpty=function(){return b};this.toString= -function(){return"THREE.Rectangle ( left: "+c+", right: "+f+", top: "+d+", bottom: "+i+", width: "+j+", height: "+u+" )"}};THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={transpose:function(){var a,c=this.m;a=c[1];c[1]=c[3];c[3]=a;a=c[2];c[2]=c[6];c[6]=a;a=c[5];c[5]=c[7];c[7]=a;return this},transposeIntoArray:function(a){var c=this.m;a[0]=c[0];a[1]=c[3];a[2]=c[6];a[3]=c[1];a[4]=c[4];a[5]=c[7];a[6]=c[2];a[7]=c[5];a[8]=c[8];return this}}; -THREE.Matrix4=function(a,c,d,f,i,j,u,b,o,q,y,z,x,s,G,J){this.n11=a||1;this.n12=c||0;this.n13=d||0;this.n14=f||0;this.n21=i||0;this.n22=j||1;this.n23=u||0;this.n24=b||0;this.n31=o||0;this.n32=q||0;this.n33=y||1;this.n34=z||0;this.n41=x||0;this.n42=s||0;this.n43=G||0;this.n44=J||1;this.flat=Array(16);this.m33=new THREE.Matrix3}; -THREE.Matrix4.prototype={identity:function(){this.n11=1;this.n21=this.n14=this.n13=this.n12=0;this.n22=1;this.n32=this.n31=this.n24=this.n23=0;this.n33=1;this.n43=this.n42=this.n41=this.n34=0;this.n44=1;return this},set:function(a,c,d,f,i,j,u,b,o,q,y,z,x,s,G,J){this.n11=a;this.n12=c;this.n13=d;this.n14=f;this.n21=i;this.n22=j;this.n23=u;this.n24=b;this.n31=o;this.n32=q;this.n33=y;this.n34=z;this.n41=x;this.n42=s;this.n43=G;this.n44=J;return this},copy:function(a){this.n11=a.n11;this.n12=a.n12;this.n13= -a.n13;this.n14=a.n14;this.n21=a.n21;this.n22=a.n22;this.n23=a.n23;this.n24=a.n24;this.n31=a.n31;this.n32=a.n32;this.n33=a.n33;this.n34=a.n34;this.n41=a.n41;this.n42=a.n42;this.n43=a.n43;this.n44=a.n44;return this},lookAt:function(a,c,d){var f=THREE.Matrix4.__tmpVec1,i=THREE.Matrix4.__tmpVec2,j=THREE.Matrix4.__tmpVec3;j.sub(a,c).normalize();f.cross(d,j).normalize();i.cross(j,f).normalize();this.n11=f.x;this.n12=f.y;this.n13=f.z;this.n14=-f.dot(a);this.n21=i.x;this.n22=i.y;this.n23=i.z;this.n24=-i.dot(a); -this.n31=j.x;this.n32=j.y;this.n33=j.z;this.n34=-j.dot(a);this.n43=this.n42=this.n41=0;this.n44=1;return this},multiplyVector3:function(a){var c=a.x,d=a.y,f=a.z,i=1/(this.n41*c+this.n42*d+this.n43*f+this.n44);a.x=(this.n11*c+this.n12*d+this.n13*f+this.n14)*i;a.y=(this.n21*c+this.n22*d+this.n23*f+this.n24)*i;a.z=(this.n31*c+this.n32*d+this.n33*f+this.n34)*i;return a},multiplyVector4:function(a){var c=a.x,d=a.y,f=a.z,i=a.w;a.x=this.n11*c+this.n12*d+this.n13*f+this.n14*i;a.y=this.n21*c+this.n22*d+this.n23* -f+this.n24*i;a.z=this.n31*c+this.n32*d+this.n33*f+this.n34*i;a.w=this.n41*c+this.n42*d+this.n43*f+this.n44*i;return a},crossVector:function(a){var c=new THREE.Vector4;c.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;c.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;c.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;c.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return c},multiply:function(a,c){var d=a.n11,f=a.n12,i=a.n13,j=a.n14,u=a.n21,b=a.n22,o=a.n23,q=a.n24,y=a.n31, -z=a.n32,x=a.n33,s=a.n34,G=a.n41,J=a.n42,I=a.n43,w=a.n44,R=c.n11,F=c.n12,e=c.n13,p=c.n14,h=c.n21,g=c.n22,k=c.n23,m=c.n24,t=c.n31,l=c.n32,n=c.n33,r=c.n34,v=c.n41,A=c.n42,D=c.n43,K=c.n44;this.n11=d*R+f*h+i*t+j*v;this.n12=d*F+f*g+i*l+j*A;this.n13=d*e+f*k+i*n+j*D;this.n14=d*p+f*m+i*r+j*K;this.n21=u*R+b*h+o*t+q*v;this.n22=u*F+b*g+o*l+q*A;this.n23=u*e+b*k+o*n+q*D;this.n24=u*p+b*m+o*r+q*K;this.n31=y*R+z*h+x*t+s*v;this.n32=y*F+z*g+x*l+s*A;this.n33=y*e+z*k+x*n+s*D;this.n34=y*p+z*m+x*r+s*K;this.n41=G*R+J*h+ -I*t+w*v;this.n42=G*F+J*g+I*l+w*A;this.n43=G*e+J*k+I*n+w*D;this.n44=G*p+J*m+I*r+w*K;return this},multiplyToArray:function(a,c,d){var f=a.n11,i=a.n12,j=a.n13,u=a.n14,b=a.n21,o=a.n22,q=a.n23,y=a.n24,z=a.n31,x=a.n32,s=a.n33,G=a.n34,J=a.n41,I=a.n42,w=a.n43;a=a.n44;var R=c.n11,F=c.n12,e=c.n13,p=c.n14,h=c.n21,g=c.n22,k=c.n23,m=c.n24,t=c.n31,l=c.n32,n=c.n33,r=c.n34,v=c.n41,A=c.n42,D=c.n43;c=c.n44;this.n11=f*R+i*h+j*t+u*v;this.n12=f*F+i*g+j*l+u*A;this.n13=f*e+i*k+j*n+u*D;this.n14=f*p+i*m+j*r+u*c;this.n21= -b*R+o*h+q*t+y*v;this.n22=b*F+o*g+q*l+y*A;this.n23=b*e+o*k+q*n+y*D;this.n24=b*p+o*m+q*r+y*c;this.n31=z*R+x*h+s*t+G*v;this.n32=z*F+x*g+s*l+G*A;this.n33=z*e+x*k+s*n+G*D;this.n34=z*p+x*m+s*r+G*c;this.n41=J*R+I*h+w*t+a*v;this.n42=J*F+I*g+w*l+a*A;this.n43=J*e+I*k+w*n+a*D;this.n44=J*p+I*m+w*r+a*c;d[0]=this.n11;d[1]=this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34; -d[15]=this.n44;return this},multiplySelf:function(a){var c=this.n11,d=this.n12,f=this.n13,i=this.n14,j=this.n21,u=this.n22,b=this.n23,o=this.n24,q=this.n31,y=this.n32,z=this.n33,x=this.n34,s=this.n41,G=this.n42,J=this.n43,I=this.n44,w=a.n11,R=a.n21,F=a.n31,e=a.n41,p=a.n12,h=a.n22,g=a.n32,k=a.n42,m=a.n13,t=a.n23,l=a.n33,n=a.n43,r=a.n14,v=a.n24,A=a.n34;a=a.n44;this.n11=c*w+d*R+f*F+i*e;this.n12=c*p+d*h+f*g+i*k;this.n13=c*m+d*t+f*l+i*n;this.n14=c*r+d*v+f*A+i*a;this.n21=j*w+u*R+b*F+o*e;this.n22=j*p+u* -h+b*g+o*k;this.n23=j*m+u*t+b*l+o*n;this.n24=j*r+u*v+b*A+o*a;this.n31=q*w+y*R+z*F+x*e;this.n32=q*p+y*h+z*g+x*k;this.n33=q*m+y*t+z*l+x*n;this.n34=q*r+y*v+z*A+x*a;this.n41=s*w+G*R+J*F+I*e;this.n42=s*p+G*h+J*g+I*k;this.n43=s*m+G*t+J*l+I*n;this.n44=s*r+G*v+J*A+I*a;return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this}, -determinant:function(){var a=this.n11,c=this.n12,d=this.n13,f=this.n14,i=this.n21,j=this.n22,u=this.n23,b=this.n24,o=this.n31,q=this.n32,y=this.n33,z=this.n34,x=this.n41,s=this.n42,G=this.n43,J=this.n44;return f*u*q*x-d*b*q*x-f*j*y*x+c*b*y*x+d*j*z*x-c*u*z*x-f*u*o*s+d*b*o*s+f*i*y*s-a*b*y*s-d*i*z*s+a*u*z*s+f*j*o*G-c*b*o*G-f*i*q*G+a*b*q*G+c*i*z*G-a*j*z*G-d*j*o*J+c*u*o*J+d*i*q*J-a*u*q*J-c*i*y*J+a*j*y*J},transpose:function(){function a(c,d,f){var i=c[d];c[d]=c[f];c[f]=i}a(this,"n21","n12");a(this,"n31", +THREE.Ray.prototype={intersectScene:function(a){var c,d,f=a.objects,k=[];a=0;for(c=f.length;a0&&K>0&&e+K<1}var d,f,k,m,r,b,n,o,B,A, +x,y=a.geometry,w=y.vertices,I=[];d=0;for(f=y.faces.length;dn?f:n;k=k>o? +k:o}a()};this.add3Points=function(n,o,B,A,x,y){if(b){b=false;c=nB?n>x?n:x:B>x?B:x;k=o>A?o>y?o:y:A>y?A:y}else{c=nB?n>x?n>f?n:f:x>f?x:f:B>x?B>f?B:f:x>f?x:f;k=o>A?o>y?o>k?o:k:y>k?y:k:A>y?A>k?A:k:y>k?y:k}a()};this.addRectangle=function(n){if(b){b=false;c=n.getLeft();d=n.getTop();f=n.getRight();k=n.getBottom()}else{c=cn.getRight()?f:n.getRight();k=k>n.getBottom()?k:n.getBottom()}a()};this.inflate=function(n){c-=n;d-=n;f+=n;k+=n;a()};this.minSelf=function(n){c=c>n.getLeft()?c:n.getLeft();d=d>n.getTop()?d:n.getTop();f=f=0&&Math.min(k,n.getBottom())-Math.max(d,n.getTop())>=0};this.empty=function(){b=true;k=f=d=c=0;a()};this.isEmpty=function(){return b};this.toString= +function(){return"THREE.Rectangle ( left: "+c+", right: "+f+", top: "+d+", bottom: "+k+", width: "+m+", height: "+r+" )"}};THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={transpose:function(){var a,c=this.m;a=c[1];c[1]=c[3];c[3]=a;a=c[2];c[2]=c[6];c[6]=a;a=c[5];c[5]=c[7];c[7]=a;return this},transposeIntoArray:function(a){var c=this.m;a[0]=c[0];a[1]=c[3];a[2]=c[6];a[3]=c[1];a[4]=c[4];a[5]=c[7];a[6]=c[2];a[7]=c[5];a[8]=c[8];return this}}; +THREE.Matrix4=function(a,c,d,f,k,m,r,b,n,o,B,A,x,y,w,I){this.n11=a||1;this.n12=c||0;this.n13=d||0;this.n14=f||0;this.n21=k||0;this.n22=m||1;this.n23=r||0;this.n24=b||0;this.n31=n||0;this.n32=o||0;this.n33=B||1;this.n34=A||0;this.n41=x||0;this.n42=y||0;this.n43=w||0;this.n44=I||1;this.flat=Array(16);this.m33=new THREE.Matrix3}; +THREE.Matrix4.prototype={identity:function(){this.n11=1;this.n21=this.n14=this.n13=this.n12=0;this.n22=1;this.n32=this.n31=this.n24=this.n23=0;this.n33=1;this.n43=this.n42=this.n41=this.n34=0;this.n44=1;return this},set:function(a,c,d,f,k,m,r,b,n,o,B,A,x,y,w,I){this.n11=a;this.n12=c;this.n13=d;this.n14=f;this.n21=k;this.n22=m;this.n23=r;this.n24=b;this.n31=n;this.n32=o;this.n33=B;this.n34=A;this.n41=x;this.n42=y;this.n43=w;this.n44=I;return this},copy:function(a){this.n11=a.n11;this.n12=a.n12;this.n13= +a.n13;this.n14=a.n14;this.n21=a.n21;this.n22=a.n22;this.n23=a.n23;this.n24=a.n24;this.n31=a.n31;this.n32=a.n32;this.n33=a.n33;this.n34=a.n34;this.n41=a.n41;this.n42=a.n42;this.n43=a.n43;this.n44=a.n44;return this},lookAt:function(a,c,d){var f=THREE.Matrix4.__tmpVec1,k=THREE.Matrix4.__tmpVec2,m=THREE.Matrix4.__tmpVec3;m.sub(a,c).normalize();f.cross(d,m).normalize();k.cross(m,f).normalize();this.n11=f.x;this.n12=f.y;this.n13=f.z;this.n14=-f.dot(a);this.n21=k.x;this.n22=k.y;this.n23=k.z;this.n24=-k.dot(a); +this.n31=m.x;this.n32=m.y;this.n33=m.z;this.n34=-m.dot(a);this.n43=this.n42=this.n41=0;this.n44=1;return this},multiplyVector3:function(a){var c=a.x,d=a.y,f=a.z,k=1/(this.n41*c+this.n42*d+this.n43*f+this.n44);a.x=(this.n11*c+this.n12*d+this.n13*f+this.n14)*k;a.y=(this.n21*c+this.n22*d+this.n23*f+this.n24)*k;a.z=(this.n31*c+this.n32*d+this.n33*f+this.n34)*k;return a},multiplyVector4:function(a){var c=a.x,d=a.y,f=a.z,k=a.w;a.x=this.n11*c+this.n12*d+this.n13*f+this.n14*k;a.y=this.n21*c+this.n22*d+this.n23* +f+this.n24*k;a.z=this.n31*c+this.n32*d+this.n33*f+this.n34*k;a.w=this.n41*c+this.n42*d+this.n43*f+this.n44*k;return a},crossVector:function(a){var c=new THREE.Vector4;c.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;c.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;c.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;c.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return c},multiply:function(a,c){var d=a.n11,f=a.n12,k=a.n13,m=a.n14,r=a.n21,b=a.n22,n=a.n23,o=a.n24,B=a.n31, +A=a.n32,x=a.n33,y=a.n34,w=a.n41,I=a.n42,K=a.n43,u=a.n44,S=c.n11,F=c.n12,P=c.n13,e=c.n14,q=c.n21,h=c.n22,g=c.n23,p=c.n24,i=c.n31,t=c.n32,j=c.n33,l=c.n34,s=c.n41,z=c.n42,v=c.n43,N=c.n44;this.n11=d*S+f*q+k*i+m*s;this.n12=d*F+f*h+k*t+m*z;this.n13=d*P+f*g+k*j+m*v;this.n14=d*e+f*p+k*l+m*N;this.n21=r*S+b*q+n*i+o*s;this.n22=r*F+b*h+n*t+o*z;this.n23=r*P+b*g+n*j+o*v;this.n24=r*e+b*p+n*l+o*N;this.n31=B*S+A*q+x*i+y*s;this.n32=B*F+A*h+x*t+y*z;this.n33=B*P+A*g+x*j+y*v;this.n34=B*e+A*p+x*l+y*N;this.n41=w*S+I*q+ +K*i+u*s;this.n42=w*F+I*h+K*t+u*z;this.n43=w*P+I*g+K*j+u*v;this.n44=w*e+I*p+K*l+u*N;return this},multiplyToArray:function(a,c,d){var f=a.n11,k=a.n12,m=a.n13,r=a.n14,b=a.n21,n=a.n22,o=a.n23,B=a.n24,A=a.n31,x=a.n32,y=a.n33,w=a.n34,I=a.n41,K=a.n42,u=a.n43;a=a.n44;var S=c.n11,F=c.n12,P=c.n13,e=c.n14,q=c.n21,h=c.n22,g=c.n23,p=c.n24,i=c.n31,t=c.n32,j=c.n33,l=c.n34,s=c.n41,z=c.n42,v=c.n43;c=c.n44;this.n11=f*S+k*q+m*i+r*s;this.n12=f*F+k*h+m*t+r*z;this.n13=f*P+k*g+m*j+r*v;this.n14=f*e+k*p+m*l+r*c;this.n21= +b*S+n*q+o*i+B*s;this.n22=b*F+n*h+o*t+B*z;this.n23=b*P+n*g+o*j+B*v;this.n24=b*e+n*p+o*l+B*c;this.n31=A*S+x*q+y*i+w*s;this.n32=A*F+x*h+y*t+w*z;this.n33=A*P+x*g+y*j+w*v;this.n34=A*e+x*p+y*l+w*c;this.n41=I*S+K*q+u*i+a*s;this.n42=I*F+K*h+u*t+a*z;this.n43=I*P+K*g+u*j+a*v;this.n44=I*e+K*p+u*l+a*c;d[0]=this.n11;d[1]=this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34; +d[15]=this.n44;return this},multiplySelf:function(a){var c=this.n11,d=this.n12,f=this.n13,k=this.n14,m=this.n21,r=this.n22,b=this.n23,n=this.n24,o=this.n31,B=this.n32,A=this.n33,x=this.n34,y=this.n41,w=this.n42,I=this.n43,K=this.n44,u=a.n11,S=a.n21,F=a.n31,P=a.n41,e=a.n12,q=a.n22,h=a.n32,g=a.n42,p=a.n13,i=a.n23,t=a.n33,j=a.n43,l=a.n14,s=a.n24,z=a.n34;a=a.n44;this.n11=c*u+d*S+f*F+k*P;this.n12=c*e+d*q+f*h+k*g;this.n13=c*p+d*i+f*t+k*j;this.n14=c*l+d*s+f*z+k*a;this.n21=m*u+r*S+b*F+n*P;this.n22=m*e+r* +q+b*h+n*g;this.n23=m*p+r*i+b*t+n*j;this.n24=m*l+r*s+b*z+n*a;this.n31=o*u+B*S+A*F+x*P;this.n32=o*e+B*q+A*h+x*g;this.n33=o*p+B*i+A*t+x*j;this.n34=o*l+B*s+A*z+x*a;this.n41=y*u+w*S+I*F+K*P;this.n42=y*e+w*q+I*h+K*g;this.n43=y*p+w*i+I*t+K*j;this.n44=y*l+w*s+I*z+K*a;return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this}, +determinant:function(){var a=this.n11,c=this.n12,d=this.n13,f=this.n14,k=this.n21,m=this.n22,r=this.n23,b=this.n24,n=this.n31,o=this.n32,B=this.n33,A=this.n34,x=this.n41,y=this.n42,w=this.n43,I=this.n44;return f*r*o*x-d*b*o*x-f*m*B*x+c*b*B*x+d*m*A*x-c*r*A*x-f*r*n*y+d*b*n*y+f*k*B*y-a*b*B*y-d*k*A*y+a*r*A*y+f*m*n*w-c*b*n*w-f*k*o*w+a*b*o*w+c*k*A*w-a*m*A*w-d*m*n*I+c*r*n*I+d*k*o*I-a*r*o*I-c*k*B*I+a*m*B*I},transpose:function(){function a(c,d,f){var k=c[d];c[d]=c[f];c[f]=k}a(this,"n21","n12");a(this,"n31", "n13");a(this,"n32","n23");a(this,"n41","n14");a(this,"n42","n24");a(this,"n43","n34");return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){var a=this.flat;a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]= this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArray:function(a){a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},setTranslation:function(a,c,d){this.set(1,0,0,a,0,1,0,c,0,0,1,d,0,0,0, -1);return this},setScale:function(a,c,d){this.set(a,0,0,0,0,c,0,0,0,0,d,0,0,0,0,1);return this},setRotX:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,c,-a,0,0,a,c,0,0,0,0,1);return this},setRotY:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,0,a,0,0,1,0,0,-a,0,c,0,0,0,0,1);return this},setRotZ:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,-a,0,0,a,c,0,0,0,0,1,0,0,0,0,1);return this},setRotAxis:function(a,c){var d=Math.cos(c),f=Math.sin(c),i=1-d,j=a.x,u=a.y,b=a.z, -o=i*j,q=i*u;this.set(o*j+d,o*u-f*b,o*b+f*u,0,o*u+f*b,q*u+d,q*b-f*j,0,o*b-f*u,q*b+f*j,i*b*b+d,0,0,0,0,1);return this},toString:function(){return"| "+this.n11+" "+this.n12+" "+this.n13+" "+this.n14+" |\n| "+this.n21+" "+this.n22+" "+this.n23+" "+this.n24+" |\n| "+this.n31+" "+this.n32+" "+this.n33+" "+this.n34+" |\n| "+this.n41+" "+this.n42+" "+this.n43+" "+this.n44+" |"}};THREE.Matrix4.translationMatrix=function(a,c,d){var f=new THREE.Matrix4;f.setTranslation(a,c,d);return f}; +1);return this},setScale:function(a,c,d){this.set(a,0,0,0,0,c,0,0,0,0,d,0,0,0,0,1);return this},setRotX:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,c,-a,0,0,a,c,0,0,0,0,1);return this},setRotY:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,0,a,0,0,1,0,0,-a,0,c,0,0,0,0,1);return this},setRotZ:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,-a,0,0,a,c,0,0,0,0,1,0,0,0,0,1);return this},setRotAxis:function(a,c){var d=Math.cos(c),f=Math.sin(c),k=1-d,m=a.x,r=a.y,b=a.z, +n=k*m,o=k*r;this.set(n*m+d,n*r-f*b,n*b+f*r,0,n*r+f*b,o*r+d,o*b-f*m,0,n*b-f*r,o*b+f*m,k*b*b+d,0,0,0,0,1);return this},toString:function(){return"| "+this.n11+" "+this.n12+" "+this.n13+" "+this.n14+" |\n| "+this.n21+" "+this.n22+" "+this.n23+" "+this.n24+" |\n| "+this.n31+" "+this.n32+" "+this.n33+" "+this.n34+" |\n| "+this.n41+" "+this.n42+" "+this.n43+" "+this.n44+" |"}};THREE.Matrix4.translationMatrix=function(a,c,d){var f=new THREE.Matrix4;f.setTranslation(a,c,d);return f}; THREE.Matrix4.scaleMatrix=function(a,c,d){var f=new THREE.Matrix4;f.setScale(a,c,d);return f};THREE.Matrix4.rotationXMatrix=function(a){var c=new THREE.Matrix4;c.setRotX(a);return c};THREE.Matrix4.rotationYMatrix=function(a){var c=new THREE.Matrix4;c.setRotY(a);return c};THREE.Matrix4.rotationZMatrix=function(a){var c=new THREE.Matrix4;c.setRotZ(a);return c};THREE.Matrix4.rotationAxisAngleMatrix=function(a,c){var d=new THREE.Matrix4;d.setRotAxis(a,c);return d}; -THREE.Matrix4.makeInvert=function(a){var c=a.n11,d=a.n12,f=a.n13,i=a.n14,j=a.n21,u=a.n22,b=a.n23,o=a.n24,q=a.n31,y=a.n32,z=a.n33,x=a.n34,s=a.n41,G=a.n42,J=a.n43,I=a.n44,w=new THREE.Matrix4;w.n11=b*x*G-o*z*G+o*y*J-u*x*J-b*y*I+u*z*I;w.n12=i*z*G-f*x*G-i*y*J+d*x*J+f*y*I-d*z*I;w.n13=f*o*G-i*b*G+i*u*J-d*o*J-f*u*I+d*b*I;w.n14=i*b*y-f*o*y-i*u*z+d*o*z+f*u*x-d*b*x;w.n21=o*z*s-b*x*s-o*q*J+j*x*J+b*q*I-j*z*I;w.n22=f*x*s-i*z*s+i*q*J-c*x*J-f*q*I+c*z*I;w.n23=i*b*s-f*o*s-i*j*J+c*o*J+f*j*I-c*b*I;w.n24=f*o*q-i*b*q+ -i*j*z-c*o*z-f*j*x+c*b*x;w.n31=u*x*s-o*y*s+o*q*G-j*x*G-u*q*I+j*y*I;w.n32=i*y*s-d*x*s-i*q*G+c*x*G+d*q*I-c*y*I;w.n33=f*o*s-i*u*s+i*j*G-c*o*G-d*j*I+c*u*I;w.n34=i*u*q-d*o*q-i*j*y+c*o*y+d*j*x-c*u*x;w.n41=b*y*s-u*z*s-b*q*G+j*z*G+u*q*J-j*y*J;w.n42=d*z*s-f*y*s+f*q*G-c*z*G-d*q*J+c*y*J;w.n43=f*u*s-d*b*s-f*j*G+c*b*G+d*j*J-c*u*J;w.n44=d*b*q-f*u*q+f*j*y-c*b*y-d*j*z+c*u*z;w.multiplyScalar(1/a.determinant());return w}; -THREE.Matrix4.makeInvert3x3=function(a){var c=a.m33,d=c.m,f=a.n33*a.n22-a.n32*a.n23,i=-a.n33*a.n21+a.n31*a.n23,j=a.n32*a.n21-a.n31*a.n22,u=-a.n33*a.n12+a.n32*a.n13,b=a.n33*a.n11-a.n31*a.n13,o=-a.n32*a.n11+a.n31*a.n12,q=a.n23*a.n12-a.n22*a.n13,y=-a.n23*a.n11+a.n21*a.n13,z=a.n22*a.n11-a.n21*a.n12;a=a.n11*f+a.n21*u+a.n31*q;if(a==0)throw"matrix not invertible";a=1/a;d[0]=a*f;d[1]=a*i;d[2]=a*j;d[3]=a*u;d[4]=a*b;d[5]=a*o;d[6]=a*q;d[7]=a*y;d[8]=a*z;return c}; -THREE.Matrix4.makeFrustum=function(a,c,d,f,i,j){var u,b,o;u=new THREE.Matrix4;b=2*i/(c-a);o=2*i/(f-d);a=(c+a)/(c-a);d=(f+d)/(f-d);f=-(j+i)/(j-i);i=-2*j*i/(j-i);u.n11=b;u.n12=0;u.n13=a;u.n14=0;u.n21=0;u.n22=o;u.n23=d;u.n24=0;u.n31=0;u.n32=0;u.n33=f;u.n34=i;u.n41=0;u.n42=0;u.n43=-1;u.n44=0;return u};THREE.Matrix4.makePerspective=function(a,c,d,f){var i;a=d*Math.tan(a*Math.PI/360);i=-a;return THREE.Matrix4.makeFrustum(i*c,a*c,i,a,d,f)}; -THREE.Matrix4.makeOrtho=function(a,c,d,f,i,j){var u,b,o,q;u=new THREE.Matrix4;b=c-a;o=d-f;q=j-i;a=(c+a)/b;d=(d+f)/o;i=(j+i)/q;u.n11=2/b;u.n12=0;u.n13=0;u.n14=-a;u.n21=0;u.n22=2/o;u.n23=0;u.n24=-d;u.n31=0;u.n32=0;u.n33=-2/q;u.n34=-i;u.n41=0;u.n42=0;u.n43=0;u.n44=1;return u};THREE.Matrix4.__tmpVec1=new THREE.Vector3;THREE.Matrix4.__tmpVec2=new THREE.Vector3;THREE.Matrix4.__tmpVec3=new THREE.Vector3; +THREE.Matrix4.makeInvert=function(a){var c=a.n11,d=a.n12,f=a.n13,k=a.n14,m=a.n21,r=a.n22,b=a.n23,n=a.n24,o=a.n31,B=a.n32,A=a.n33,x=a.n34,y=a.n41,w=a.n42,I=a.n43,K=a.n44,u=new THREE.Matrix4;u.n11=b*x*w-n*A*w+n*B*I-r*x*I-b*B*K+r*A*K;u.n12=k*A*w-f*x*w-k*B*I+d*x*I+f*B*K-d*A*K;u.n13=f*n*w-k*b*w+k*r*I-d*n*I-f*r*K+d*b*K;u.n14=k*b*B-f*n*B-k*r*A+d*n*A+f*r*x-d*b*x;u.n21=n*A*y-b*x*y-n*o*I+m*x*I+b*o*K-m*A*K;u.n22=f*x*y-k*A*y+k*o*I-c*x*I-f*o*K+c*A*K;u.n23=k*b*y-f*n*y-k*m*I+c*n*I+f*m*K-c*b*K;u.n24=f*n*o-k*b*o+ +k*m*A-c*n*A-f*m*x+c*b*x;u.n31=r*x*y-n*B*y+n*o*w-m*x*w-r*o*K+m*B*K;u.n32=k*B*y-d*x*y-k*o*w+c*x*w+d*o*K-c*B*K;u.n33=f*n*y-k*r*y+k*m*w-c*n*w-d*m*K+c*r*K;u.n34=k*r*o-d*n*o-k*m*B+c*n*B+d*m*x-c*r*x;u.n41=b*B*y-r*A*y-b*o*w+m*A*w+r*o*I-m*B*I;u.n42=d*A*y-f*B*y+f*o*w-c*A*w-d*o*I+c*B*I;u.n43=f*r*y-d*b*y-f*m*w+c*b*w+d*m*I-c*r*I;u.n44=d*b*o-f*r*o+f*m*B-c*b*B-d*m*A+c*r*A;u.multiplyScalar(1/a.determinant());return u}; +THREE.Matrix4.makeInvert3x3=function(a){var c=a.m33,d=c.m,f=a.n33*a.n22-a.n32*a.n23,k=-a.n33*a.n21+a.n31*a.n23,m=a.n32*a.n21-a.n31*a.n22,r=-a.n33*a.n12+a.n32*a.n13,b=a.n33*a.n11-a.n31*a.n13,n=-a.n32*a.n11+a.n31*a.n12,o=a.n23*a.n12-a.n22*a.n13,B=-a.n23*a.n11+a.n21*a.n13,A=a.n22*a.n11-a.n21*a.n12;a=a.n11*f+a.n21*r+a.n31*o;if(a==0)throw"matrix not invertible";a=1/a;d[0]=a*f;d[1]=a*k;d[2]=a*m;d[3]=a*r;d[4]=a*b;d[5]=a*n;d[6]=a*o;d[7]=a*B;d[8]=a*A;return c}; +THREE.Matrix4.makeFrustum=function(a,c,d,f,k,m){var r,b,n;r=new THREE.Matrix4;b=2*k/(c-a);n=2*k/(f-d);a=(c+a)/(c-a);d=(f+d)/(f-d);f=-(m+k)/(m-k);k=-2*m*k/(m-k);r.n11=b;r.n12=0;r.n13=a;r.n14=0;r.n21=0;r.n22=n;r.n23=d;r.n24=0;r.n31=0;r.n32=0;r.n33=f;r.n34=k;r.n41=0;r.n42=0;r.n43=-1;r.n44=0;return r};THREE.Matrix4.makePerspective=function(a,c,d,f){var k;a=d*Math.tan(a*Math.PI/360);k=-a;return THREE.Matrix4.makeFrustum(k*c,a*c,k,a,d,f)}; +THREE.Matrix4.makeOrtho=function(a,c,d,f,k,m){var r,b,n,o;r=new THREE.Matrix4;b=c-a;n=d-f;o=m-k;a=(c+a)/b;d=(d+f)/n;k=(m+k)/o;r.n11=2/b;r.n12=0;r.n13=0;r.n14=-a;r.n21=0;r.n22=2/n;r.n23=0;r.n24=-d;r.n31=0;r.n32=0;r.n33=-2/o;r.n34=-k;r.n41=0;r.n42=0;r.n43=0;r.n44=1;return r};THREE.Matrix4.__tmpVec1=new THREE.Vector3;THREE.Matrix4.__tmpVec2=new THREE.Vector3;THREE.Matrix4.__tmpVec3=new THREE.Vector3; THREE.Vertex=function(a,c){this.position=a||new THREE.Vector3;this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.normal=c||new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.normalScreen=new THREE.Vector3;this.tangent=new THREE.Vector4;this.__visible=true};THREE.Vertex.prototype={toString:function(){return"THREE.Vertex ( position: "+this.position+", normal: "+this.normal+" )"}}; -THREE.Face3=function(a,c,d,f,i){this.a=a;this.b=c;this.c=d;this.centroid=new THREE.Vector3;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.materials=i instanceof Array?i:[i]};THREE.Face3.prototype={toString:function(){return"THREE.Face3 ( "+this.a+", "+this.b+", "+this.c+" )"}}; -THREE.Face4=function(a,c,d,f,i,j){this.a=a;this.b=c;this.c=d;this.d=f;this.centroid=new THREE.Vector3;this.normal=i instanceof THREE.Vector3?i:new THREE.Vector3;this.vertexNormals=i instanceof Array?i:[];this.materials=j instanceof Array?j:[j]};THREE.Face4.prototype={toString:function(){return"THREE.Face4 ( "+this.a+", "+this.b+", "+this.c+" "+this.d+" )"}};THREE.UV=function(a,c){this.u=a||0;this.v=c||0}; +THREE.Face3=function(a,c,d,f,k){this.a=a;this.b=c;this.c=d;this.centroid=new THREE.Vector3;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.materials=k instanceof Array?k:[k]};THREE.Face3.prototype={toString:function(){return"THREE.Face3 ( "+this.a+", "+this.b+", "+this.c+" )"}}; +THREE.Face4=function(a,c,d,f,k,m){this.a=a;this.b=c;this.c=d;this.d=f;this.centroid=new THREE.Vector3;this.normal=k instanceof THREE.Vector3?k:new THREE.Vector3;this.vertexNormals=k instanceof Array?k:[];this.materials=m instanceof Array?m:[m]};THREE.Face4.prototype={toString:function(){return"THREE.Face4 ( "+this.a+", "+this.b+", "+this.c+" "+this.d+" )"}};THREE.UV=function(a,c){this.u=a||0;this.v=c||0}; THREE.UV.prototype={copy:function(a){this.u=a.u;this.v=a.v},toString:function(){return"THREE.UV ("+this.u+", "+this.v+")"}};THREE.Geometry=function(){this.vertices=[];this.faces=[];this.uvs=[];this.uvs2=[];this.colors=[];this.boundingSphere=this.boundingBox=null;this.geometryChunks={};this.hasTangents=false}; THREE.Geometry.prototype={computeCentroids:function(){var a,c,d;a=0;for(c=this.faces.length;a0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y], +c;a++){d=this.faces[a];if(d instanceof THREE.Face3){d.vertexNormals[0].copy(f[d.a]);d.vertexNormals[1].copy(f[d.b]);d.vertexNormals[2].copy(f[d.c])}else if(d instanceof THREE.Face4){d.vertexNormals[0].copy(f[d.a]);d.vertexNormals[1].copy(f[d.b]);d.vertexNormals[2].copy(f[d.c]);d.vertexNormals[3].copy(f[d.d])}}},computeTangents:function(){function a(l,s,z,v,N,J,E){m=l.vertices[s].position;r=l.vertices[z].position;b=l.vertices[v].position;n=k[N];o=k[J];B=k[E];A=r.x-m.x;x=b.x-m.x;y=r.y-m.y;w=b.y-m.y; +I=r.z-m.z;K=b.z-m.z;u=o.u-n.u;S=B.u-n.u;F=o.v-n.v;P=B.v-n.v;e=1/(u*P-S*F);g.set((P*A-F*x)*e,(P*y-F*w)*e,(P*I-F*K)*e);p.set((u*x-S*A)*e,(u*w-S*y)*e,(u*K-S*I)*e);q[s].addSelf(g);q[z].addSelf(g);q[v].addSelf(g);h[s].addSelf(p);h[z].addSelf(p);h[v].addSelf(p)}var c,d,f,k,m,r,b,n,o,B,A,x,y,w,I,K,u,S,F,P,e,q=[],h=[],g=new THREE.Vector3,p=new THREE.Vector3,i=new THREE.Vector3,t=new THREE.Vector3,j=new THREE.Vector3;c=0;for(d=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y], z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,d=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z -this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,c=0,d=this.vertices.length;c65535){q[b].counter+=1;o=q[b].hash+"_"+q[b].counter;if(this.geometryChunks[o]==undefined)this.geometryChunks[o]={faces:[],materials:u,vertices:0}}this.geometryChunks[o].faces.push(f);this.geometryChunks[o].vertices+=j}},toString:function(){return"THREE.Geometry ( vertices: "+ +this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,c=0,d=this.vertices.length;c65535){o[b].counter+=1;n=o[b].hash+"_"+o[b].counter;if(this.geometryChunks[n]==undefined)this.geometryChunks[n]={faces:[],materials:r,vertices:0}}this.geometryChunks[n].faces.push(f);this.geometryChunks[n].vertices+=m}},toString:function(){return"THREE.Geometry ( vertices: "+ this.vertices+", faces: "+this.faces+", uvs: "+this.uvs+" )"}}; -THREE.Camera=function(a,c,d,f){this.fov=a;this.aspect=c;this.near=d;this.far=f;this.position=new THREE.Vector3;this.target={position:new THREE.Vector3};this.autoUpdateMatrix=true;this.projectionMatrix=null;this.matrix=new THREE.Matrix4;this.up=new THREE.Vector3(0,1,0);this.tmpVec=new THREE.Vector3;this.translateX=function(i){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(i);this.tmpVec.crossSelf(this.up);this.position.addSelf(this.tmpVec);this.target.position.addSelf(this.tmpVec)}; -this.translateZ=function(i){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(i);this.position.subSelf(this.tmpVec);this.target.position.subSelf(this.tmpVec)};this.updateMatrix=function(){this.matrix.lookAt(this.position,this.target.position,this.up)};this.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};this.updateProjectionMatrix()}; +THREE.Camera=function(a,c,d,f){this.fov=a;this.aspect=c;this.near=d;this.far=f;this.position=new THREE.Vector3;this.target={position:new THREE.Vector3};this.autoUpdateMatrix=true;this.projectionMatrix=null;this.matrix=new THREE.Matrix4;this.up=new THREE.Vector3(0,1,0);this.tmpVec=new THREE.Vector3;this.translateX=function(k){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(k);this.tmpVec.crossSelf(this.up);this.position.addSelf(this.tmpVec);this.target.position.addSelf(this.tmpVec)}; +this.translateZ=function(k){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(k);this.position.subSelf(this.tmpVec);this.target.position.subSelf(this.tmpVec)};this.updateMatrix=function(){this.matrix.lookAt(this.position,this.target.position,this.up)};this.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};this.updateProjectionMatrix()}; THREE.Camera.prototype={toString:function(){return"THREE.Camera ( "+this.position+", "+this.target.position+" )"}};THREE.Light=function(a){this.color=new THREE.Color(a)};THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=c||1};THREE.DirectionalLight.prototype=new THREE.Light; THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=c||1};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight; THREE.Object3D=function(){this.id=THREE.Object3DCounter.value++;this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.matrix=new THREE.Matrix4;this.rotationMatrix=new THREE.Matrix4;this.tmpMatrix=new THREE.Matrix4;this.screen=new THREE.Vector3;this.visible=this.autoUpdateMatrix=true}; @@ -96,115 +96,115 @@ THREE.MeshShaderMaterial.prototype={toString:function(){return"THREE.MeshShaderM THREE.ParticleBasicMaterial=function(a){this.id=THREE.ParticleBasicMaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.map=null;this.size=1;this.blending=THREE.NormalBlending;this.depth_test=true;this.offset=new THREE.Vector2;this.vertex_colors=false;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.map!==undefined)this.map=a.map;if(a.size!==undefined)this.size=a.size;if(a.blending!==undefined)this.blending=a.blending; if(a.depth_test!==undefined)this.depth_test=a.depth_test;if(a.vertex_colors!==undefined)this.vertex_colors=a.vertex_colors}};THREE.ParticleBasicMaterial.prototype={toString:function(){return"THREE.ParticleBasicMaterial (
id: "+this.id+"
color: "+this.color+"
opacity: "+this.opacity+"
map: "+this.map+"
size: "+this.size+"
blending: "+this.blending+"
depth_test: "+this.depth_test+"
vertex_colors: "+this.vertex_colors+"
)"}};THREE.ParticleBasicMaterialCounter={value:0}; THREE.ParticleCircleMaterial=function(a){this.color=new THREE.Color(16777215);this.opacity=1;this.blending=THREE.NormalBlending;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.blending!==undefined)this.blending=a.blending}};THREE.ParticleCircleMaterial.prototype={toString:function(){return"THREE.ParticleCircleMaterial (
color: "+this.color+"
opacity: "+this.opacity+"
blending: "+this.blending+"
)"}}; -THREE.ParticleDOMMaterial=function(a){this.domElement=a};THREE.ParticleDOMMaterial.prototype={toString:function(){return"THREE.ParticleDOMMaterial ( domElement: "+this.domElement+" )"}};THREE.Texture=function(a,c,d,f,i,j){this.image=a;this.mapping=c!==undefined?c:new THREE.UVMapping;this.wrap_s=d!==undefined?d:THREE.ClampToEdgeWrapping;this.wrap_t=f!==undefined?f:THREE.ClampToEdgeWrapping;this.mag_filter=i!==undefined?i:THREE.LinearFilter;this.min_filter=j!==undefined?j:THREE.LinearMipMapLinearFilter}; +THREE.ParticleDOMMaterial=function(a){this.domElement=a};THREE.ParticleDOMMaterial.prototype={toString:function(){return"THREE.ParticleDOMMaterial ( domElement: "+this.domElement+" )"}};THREE.Texture=function(a,c,d,f,k,m){this.image=a;this.mapping=c!==undefined?c:new THREE.UVMapping;this.wrap_s=d!==undefined?d:THREE.ClampToEdgeWrapping;this.wrap_t=f!==undefined?f:THREE.ClampToEdgeWrapping;this.mag_filter=k!==undefined?k:THREE.LinearFilter;this.min_filter=m!==undefined?m:THREE.LinearMipMapLinearFilter}; THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,this.mapping,this.wrap_s,this.wrap_t,this.mag_filter,this.min_filter)},toString:function(){return"THREE.Texture (
image: "+this.image+"
wrap_s: "+this.wrap_s+"
wrap_t: "+this.wrap_t+"
mag_filter: "+this.mag_filter+"
min_filter: "+this.min_filter+"
)"}};THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2; THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20; THREE.RenderTarget=function(a,c,d){this.width=a;this.height=c;d=d||{};this.wrap_s=d.wrap_s!==undefined?d.wrap_s:THREE.ClampToEdgeWrapping;this.wrap_t=d.wrap_t!==undefined?d.wrap_t:THREE.ClampToEdgeWrapping;this.mag_filter=d.mag_filter!==undefined?d.mag_filter:THREE.LinearFilter;this.min_filter=d.min_filter!==undefined?d.min_filter:THREE.LinearMipMapLinearFilter;this.format=d.format!==undefined?d.format:THREE.RGBFormat;this.type=d.type!==undefined?d.type:THREE.UnsignedByteType}; -var Uniforms={clone:function(a){var c,d,f,i={};for(c in a){i[c]={};for(d in a[c]){f=a[c][d];i[c][d]=f instanceof THREE.Color||f instanceof THREE.Vector3||f instanceof THREE.Texture?f.clone():f}}return i},merge:function(a){var c,d,f,i={};for(c=0;c=0&&n>=0&&r>=0&&v>=0)return true;else if(l<0&&n<0||r<0&&v<0)return false;else{if(l<0)m=Math.max(m,l/(l-n));else if(n<0)t=Math.min(t,l/(l-n));if(r<0)m=Math.max(m,r/(r-v));else if(v<0)t=Math.min(t,r/(r-v));if(tl&&D.z0&&I.z<1){x=G[s]=G[s]||new THREE.RenderableParticle;x.x=I.x/I.w;x.y=I.y/I.w;x.z=I.z;x.rotation=N.rotation.z;x.scale.x=N.scale.x*Math.abs(x.x-(I.x+k.projectionMatrix.n11)/(I.w+k.projectionMatrix.n14)); -x.scale.y=N.scale.y*Math.abs(x.y-(I.y+k.projectionMatrix.n22)/(I.w+k.projectionMatrix.n24));x.materials=N.materials;t.push(x);s++}}}}m&&t.sort(a);return t};this.unprojectVector=function(g,k){var m=THREE.Matrix4.makeInvert(k.matrix);m.multiplySelf(THREE.Matrix4.makeInvert(k.projectionMatrix));m.multiplyVector3(g);return g}}; -THREE.DOMRenderer=function(){THREE.Renderer.call(this);var a=null,c=new THREE.Projector,d,f,i,j;this.domElement=document.createElement("div");this.setSize=function(u,b){d=u;f=b;i=d/2;j=f/2};this.render=function(u,b){var o,q,y,z,x,s,G,J;a=c.projectScene(u,b);o=0;for(q=a.length;o0){H.r+=ga.r*$;H.g+=ga.g*$;H.b+=ga.b*$}}else if($ instanceof THREE.PointLight){Y.sub($.position,V);Y.normalize();$=T.dot(Y)*ia;if($> -0){H.r+=ga.r*$;H.g+=ga.g*$;H.b+=ga.b*$}}}}function Ga(C,V,T){if(T.opacity!=0){a(T.opacity);c(T.blending);var H,Q,$,ga,ia,ja;if(T instanceof THREE.ParticleBasicMaterial){if(T.map&&T.map.image.loaded){ga=T.map.image;ia=ga.width>>1;ja=ga.height>>1;Q=V.scale.x*b;$=V.scale.y*o;T=Q*ia;H=$*ja;B.set(C.x-T,C.y-H,C.x+T,C.y+H);if(!P.instersects(B))return;q.save();q.translate(C.x,C.y);q.rotate(-V.rotation);q.scale(Q,-$);q.translate(-ia,-ja);q.drawImage(ga,0,0);q.restore()}q.beginPath();q.moveTo(C.x-10,C.y);q.lineTo(C.x+ -10,C.y);q.moveTo(C.x,C.y-10);q.lineTo(C.x,C.y+10);q.closePath();q.strokeStyle="rgb(255,255,0)";q.stroke()}else if(T instanceof THREE.ParticleCircleMaterial){if(S){X.r=ba.r+Z.r+aa.r;X.g=ba.g+Z.g+aa.g;X.b=ba.b+Z.b+aa.b;t.r=T.color.r*X.r;t.g=T.color.g*X.g;t.b=T.color.b*X.b;t.updateStyleString()}else t.__styleString=T.color.__styleString;T=V.scale.x*b;H=V.scale.y*o;B.set(C.x-T,C.y-H,C.x+T,C.y+H);if(P.instersects(B)){Q=t.__styleString;if(J!=Q)q.fillStyle=J=Q;q.save();q.translate(C.x,C.y);q.rotate(-V.rotation); -q.scale(T,H);q.beginPath();q.arc(0,0,1,0,ka,true);q.closePath();q.fill();q.restore()}}}}function Ha(C,V,T,H){if(H.opacity!=0){a(H.opacity);c(H.blending);q.beginPath();q.moveTo(C.positionScreen.x,C.positionScreen.y);q.lineTo(V.positionScreen.x,V.positionScreen.y);q.closePath();if(H instanceof THREE.LineBasicMaterial){t.__styleString=H.color.__styleString;C=H.linewidth;if(I!=C)q.lineWidth=I=C;C=t.__styleString;if(G!=C)q.strokeStyle=G=C;q.stroke();B.inflate(H.linewidth*2)}}}function ma(C,V,T,H,Q,$){if(Q.opacity!= -0){a(Q.opacity);c(Q.blending);e=C.positionScreen.x;p=C.positionScreen.y;h=V.positionScreen.x;g=V.positionScreen.y;k=T.positionScreen.x;m=T.positionScreen.y;q.beginPath();q.moveTo(e,p);q.lineTo(h,g);q.lineTo(k,m);q.lineTo(e,p);q.closePath();if(Q instanceof THREE.MeshBasicMaterial)if(Q.map)Q.map.image.loaded&&Q.map.mapping instanceof THREE.UVMapping&&za(e,p,h,g,k,m,Q.map.image,H.uvs[0].u,H.uvs[0].v,H.uvs[1].u,H.uvs[1].v,H.uvs[2].u,H.uvs[2].v);else if(Q.env_map){if(Q.env_map.image.loaded)if(Q.env_map.mapping instanceof -THREE.SphericalReflectionMapping){C=ca.matrix;Y.copy(H.vertexNormalsWorld[0]);L=(Y.x*C.n11+Y.y*C.n12+Y.z*C.n13)*0.5+0.5;N=-(Y.x*C.n21+Y.y*C.n22+Y.z*C.n23)*0.5+0.5;Y.copy(H.vertexNormalsWorld[1]);U=(Y.x*C.n11+Y.y*C.n12+Y.z*C.n13)*0.5+0.5;W=-(Y.x*C.n21+Y.y*C.n22+Y.z*C.n23)*0.5+0.5;Y.copy(H.vertexNormalsWorld[2]);M=(Y.x*C.n11+Y.y*C.n12+Y.z*C.n13)*0.5+0.5;E=-(Y.x*C.n21+Y.y*C.n22+Y.z*C.n23)*0.5+0.5;za(e,p,h,g,k,m,Q.env_map.image,L,N,U,W,M,E)}}else Q.wireframe?Da(Q.color.__styleString,Q.wireframe_linewidth): -Ea(Q.color.__styleString);else if(Q instanceof THREE.MeshLambertMaterial){if(Q.map&&!Q.wireframe){Q.map.mapping instanceof THREE.UVMapping&&za(e,p,h,g,k,m,Q.map.image,H.uvs[0].u,H.uvs[0].v,H.uvs[1].u,H.uvs[1].v,H.uvs[2].u,H.uvs[2].v);c(THREE.SubtractiveBlending)}if(S)if(!Q.wireframe&&Q.shading==THREE.SmoothShading&&H.vertexNormalsWorld.length==3){l.r=n.r=r.r=ba.r;l.g=n.g=r.g=ba.g;l.b=n.b=r.b=ba.b;xa($,H.v1.positionWorld,H.vertexNormalsWorld[0],l);xa($,H.v2.positionWorld,H.vertexNormalsWorld[1],n); -xa($,H.v3.positionWorld,H.vertexNormalsWorld[2],r);v.r=(n.r+r.r)*0.5;v.g=(n.g+r.g)*0.5;v.b=(n.b+r.b)*0.5;K=Ma(l,n,r,v);za(e,p,h,g,k,m,K,0,0,1,0,0,1)}else{X.r=ba.r;X.g=ba.g;X.b=ba.b;xa($,H.centroidWorld,H.normalWorld,X);t.r=Q.color.r*X.r;t.g=Q.color.g*X.g;t.b=Q.color.b*X.b;t.updateStyleString();Q.wireframe?Da(t.__styleString,Q.wireframe_linewidth):Ea(t.__styleString)}else Q.wireframe?Da(Q.color.__styleString,Q.wireframe_linewidth):Ea(Q.color.__styleString)}else if(Q instanceof THREE.MeshDepthMaterial){A= -ca.near;D=ca.far;l.r=l.g=l.b=1-Ia(C.positionScreen.z,A,D);n.r=n.g=n.b=1-Ia(V.positionScreen.z,A,D);r.r=r.g=r.b=1-Ia(T.positionScreen.z,A,D);v.r=(n.r+r.r)*0.5;v.g=(n.g+r.g)*0.5;v.b=(n.b+r.b)*0.5;K=Ma(l,n,r,v);za(e,p,h,g,k,m,K,0,0,1,0,0,1)}else if(Q instanceof THREE.MeshNormalMaterial){t.r=Ja(H.normalWorld.x);t.g=Ja(H.normalWorld.y);t.b=Ja(H.normalWorld.z);t.updateStyleString();Q.wireframe?Da(t.__styleString,Q.wireframe_linewidth):Ea(t.__styleString)}}}function Da(C,V){if(G!=C)q.strokeStyle=G=C;if(I!= -V)q.lineWidth=I=V;q.stroke();B.inflate(V*2)}function Ea(C){if(J!=C)q.fillStyle=J=C;q.fill()}function za(C,V,T,H,Q,$,ga,ia,ja,ra,na,sa,Aa){var pa,ta;pa=ga.width-1;ta=ga.height-1;ia*=pa;ja*=ta;ra*=pa;na*=ta;sa*=pa;Aa*=ta;T-=C;H-=V;Q-=C;$-=V;ra-=ia;na-=ja;sa-=ia;Aa-=ja;pa=ra*Aa-sa*na;if(pa!=0){ta=1/pa;pa=(Aa*T-na*Q)*ta;na=(Aa*H-na*$)*ta;T=(ra*Q-sa*T)*ta;H=(ra*$-sa*H)*ta;C=C-pa*ia-T*ja;V=V-na*ia-H*ja;q.save();q.transform(pa,na,T,H,C,V);q.clip();q.drawImage(ga,0,0);q.restore()}}function Ma(C,V,T,H){var Q= -~~(C.r*255),$=~~(C.g*255);C=~~(C.b*255);var ga=~~(V.r*255),ia=~~(V.g*255);V=~~(V.b*255);var ja=~~(T.r*255),ra=~~(T.g*255);T=~~(T.b*255);var na=~~(H.r*255),sa=~~(H.g*255);H=~~(H.b*255);ha[0]=Q<0?0:Q>255?255:Q;ha[1]=$<0?0:$>255?255:$;ha[2]=C<0?0:C>255?255:C;ha[4]=ga<0?0:ga>255?255:ga;ha[5]=ia<0?0:ia>255?255:ia;ha[6]=V<0?0:V>255?255:V;ha[8]=ja<0?0:ja>255?255:ja;ha[9]=ra<0?0:ra>255?255:ra;ha[10]=T<0?0:T>255?255:T;ha[12]=na<0?0:na>255?255:na;ha[13]=sa<0?0:sa>255?255:sa;ha[14]=H<0?0:H>255?255:H;fa.putImageData(wa, -0,0);va.drawImage(ua,0,0);return la}function Ia(C,V,T){C=(C-V)/(T-V);return C*C*(3-2*C)}function Ja(C){C=(C+1)*0.5;return C<0?0:C>1?1:C}function Ka(C,V){var T=V.x-C.x,H=V.y-C.y,Q=1/Math.sqrt(T*T+H*H);T*=Q;H*=Q;V.x+=T;V.y+=H;C.x-=T;C.y-=H}var Fa,Na,ea,qa,ya,La,Oa,Ba;this.autoClear?this.clear():q.setTransform(1,0,0,-1,b,o);d=f.projectScene(da,ca,this.sortElements);q.fillStyle="rgba( 0, 255, 255, 0.5 )";q.fillRect(P.getX(),P.getY(),P.getWidth(),P.getHeight());(S=da.lights.length>0)&&Ca(da);Fa=0;for(Na= -d.length;Fa0){U.r+=E.color.r*P;U.g+=E.color.g*P;U.b+=E.color.b*P}}else if(E instanceof THREE.PointLight){m.sub(E.position,N.centroidWorld);m.normalize();P=N.normalWorld.dot(m)*E.intensity;if(P>0){U.r+=E.color.r*P;U.g+=E.color.g*P;U.b+=E.color.b*P}}}}function c(L,N,U,W,M,E){r=f(v++);r.setAttribute("d","M "+L.positionScreen.x+ -" "+L.positionScreen.y+" L "+N.positionScreen.x+" "+N.positionScreen.y+" L "+U.positionScreen.x+","+U.positionScreen.y+"z");if(M instanceof THREE.MeshBasicMaterial)F.__styleString=M.color.__styleString;else if(M instanceof THREE.MeshLambertMaterial)if(R){e.r=p.r;e.g=p.g;e.b=p.b;a(E,W,e);F.r=M.color.r*e.r;F.g=M.color.g*e.g;F.b=M.color.b*e.b;F.updateStyleString()}else F.__styleString=M.color.__styleString;else if(M instanceof THREE.MeshDepthMaterial){k=1-M.__2near/(M.__farPlusNear-W.z*M.__farMinusNear); -F.setRGB(k,k,k)}else M instanceof THREE.MeshNormalMaterial&&F.setRGB(i(W.normalWorld.x),i(W.normalWorld.y),i(W.normalWorld.z));M.wireframe?r.setAttribute("style","fill: none; stroke: "+F.__styleString+"; stroke-width: "+M.wireframe_linewidth+"; stroke-opacity: "+M.opacity+"; stroke-linecap: "+M.wireframe_linecap+"; stroke-linejoin: "+M.wireframe_linejoin):r.setAttribute("style","fill: "+F.__styleString+"; fill-opacity: "+M.opacity);b.appendChild(r)}function d(L,N,U,W,M,E,P){r=f(v++);r.setAttribute("d", -"M "+L.positionScreen.x+" "+L.positionScreen.y+" L "+N.positionScreen.x+" "+N.positionScreen.y+" L "+U.positionScreen.x+","+U.positionScreen.y+" L "+W.positionScreen.x+","+W.positionScreen.y+"z");if(E instanceof THREE.MeshBasicMaterial)F.__styleString=E.color.__styleString;else if(E instanceof THREE.MeshLambertMaterial)if(R){e.r=p.r;e.g=p.g;e.b=p.b;a(P,M,e);F.r=E.color.r*e.r;F.g=E.color.g*e.g;F.b=E.color.b*e.b;F.updateStyleString()}else F.__styleString=E.color.__styleString;else if(E instanceof THREE.MeshDepthMaterial){k= -1-E.__2near/(E.__farPlusNear-M.z*E.__farMinusNear);F.setRGB(k,k,k)}else E instanceof THREE.MeshNormalMaterial&&F.setRGB(i(M.normalWorld.x),i(M.normalWorld.y),i(M.normalWorld.z));E.wireframe?r.setAttribute("style","fill: none; stroke: "+F.__styleString+"; stroke-width: "+E.wireframe_linewidth+"; stroke-opacity: "+E.opacity+"; stroke-linecap: "+E.wireframe_linecap+"; stroke-linejoin: "+E.wireframe_linejoin):r.setAttribute("style","fill: "+F.__styleString+"; fill-opacity: "+E.opacity);b.appendChild(r)} -function f(L){if(t[L]==null){t[L]=document.createElementNS("http://www.w3.org/2000/svg","path");K==0&&t[L].setAttribute("shape-rendering","crispEdges");return t[L]}return t[L]}function i(L){return L<0?Math.min((1+L)*0.5,0.5):0.5+Math.min(L*0.5,0.5)}var j=null,u=new THREE.Projector,b=document.createElementNS("http://www.w3.org/2000/svg","svg"),o,q,y,z,x,s,G,J,I=new THREE.Rectangle,w=new THREE.Rectangle,R=false,F=new THREE.Color(16777215),e=new THREE.Color(16777215),p=new THREE.Color(0),h=new THREE.Color(0), -g=new THREE.Color(0),k,m=new THREE.Vector3,t=[],l=[],n=[],r,v,A,D,K=1;this.domElement=b;this.sortElements=this.sortObjects=this.autoClear=true;this.setQuality=function(L){switch(L){case "high":K=1;break;case "low":K=0}};this.setSize=function(L,N){o=L;q=N;y=o/2;z=q/2;b.setAttribute("viewBox",-y+" "+-z+" "+o+" "+q);b.setAttribute("width",o);b.setAttribute("height",q);I.set(-y,-z,y,z)};this.clear=function(){for(;b.childNodes.length>0;)b.removeChild(b.childNodes[0])};this.render=function(L,N){var U,W, -M,E,P,O,B,S;this.autoClear&&this.clear();j=u.projectScene(L,N,this.sortElements);D=A=v=0;if(R=L.lights.length>0){B=L.lights;p.setRGB(0,0,0);h.setRGB(0,0,0);g.setRGB(0,0,0);U=0;for(W=B.length;U=0&&j>=0&&l>=0&&s>=0)return true;else if(t<0&&j<0||l<0&&s<0)return false;else{if(t<0)p=Math.max(p,t/(t-j));else if(j<0)i=Math.min(i,t/(t-j));if(l<0)p=Math.max(p,l/(l-s));else if(s<0)i=Math.min(i,l/(l-s));if(it&&v.z0&&K.z<1){x=w[y]=w[y]||new THREE.RenderableParticle;x.x=K.x/K.w;x.y=K.y/K.w;x.z=K.z;x.rotation=E.rotation.z;x.scale.x=E.scale.x*Math.abs(x.x-(K.x+g.projectionMatrix.n11)/(K.w+g.projectionMatrix.n14)); +x.scale.y=E.scale.y*Math.abs(x.y-(K.y+g.projectionMatrix.n22)/(K.w+g.projectionMatrix.n24));x.materials=E.materials;i.push(x);y++}}}}p&&i.sort(a);return i};this.unprojectVector=function(h,g){var p=THREE.Matrix4.makeInvert(g.matrix);p.multiplySelf(THREE.Matrix4.makeInvert(g.projectionMatrix));p.multiplyVector3(h);return h}}; +THREE.DOMRenderer=function(){THREE.Renderer.call(this);var a=null,c=new THREE.Projector,d,f,k,m;this.domElement=document.createElement("div");this.setSize=function(r,b){d=r;f=b;k=d/2;m=f/2};this.render=function(r,b){var n,o,B,A,x,y,w,I;a=c.projectScene(r,b);n=0;for(o=a.length;n0){G.r+=fa.r*$;G.g+=fa.g*$;G.b+=fa.b*$}}else if($ instanceof THREE.PointLight){Z.sub($.position,V);Z.normalize();$=T.dot(Z)*ja;if($> +0){G.r+=fa.r*$;G.g+=fa.g*$;G.b+=fa.b*$}}}}function Ga(D,V,T){if(T.opacity!=0){a(T.opacity);c(T.blending);var G,R,$,fa,ja,la;if(T instanceof THREE.ParticleBasicMaterial){if(T.map&&T.map.image.loaded){fa=T.map.image;ja=fa.width>>1;la=fa.height>>1;R=V.scale.x*b;$=V.scale.y*n;T=R*ja;G=$*la;C.set(D.x-T,D.y-G,D.x+T,D.y+G);if(!L.instersects(C))return;o.save();o.translate(D.x,D.y);o.rotate(-V.rotation);o.scale(R,-$);o.translate(-ja,-la);o.drawImage(fa,0,0);o.restore()}o.beginPath();o.moveTo(D.x-10,D.y);o.lineTo(D.x+ +10,D.y);o.moveTo(D.x,D.y-10);o.lineTo(D.x,D.y+10);o.closePath();o.strokeStyle="rgb(255,255,0)";o.stroke()}else if(T instanceof THREE.ParticleCircleMaterial){if(M){W.r=ga.r+da.r+Y.r;W.g=ga.g+da.g+Y.g;W.b=ga.b+da.b+Y.b;i.r=T.color.r*W.r;i.g=T.color.g*W.g;i.b=T.color.b*W.b;i.updateStyleString()}else i.__styleString=T.color.__styleString;T=V.scale.x*b;G=V.scale.y*n;C.set(D.x-T,D.y-G,D.x+T,D.y+G);if(L.instersects(C)){R=i.__styleString;if(I!=R)o.fillStyle=I=R;o.save();o.translate(D.x,D.y);o.rotate(-V.rotation); +o.scale(T,G);o.beginPath();o.arc(0,0,1,0,ba,true);o.closePath();o.fill();o.restore()}}}}function Ha(D,V,T,G){if(G.opacity!=0){a(G.opacity);c(G.blending);o.beginPath();o.moveTo(D.positionScreen.x,D.positionScreen.y);o.lineTo(V.positionScreen.x,V.positionScreen.y);o.closePath();if(G instanceof THREE.LineBasicMaterial){i.__styleString=G.color.__styleString;D=G.linewidth;if(K!=D)o.lineWidth=K=D;D=i.__styleString;if(w!=D)o.strokeStyle=w=D;o.stroke();C.inflate(G.linewidth*2)}}}function Da(D,V,T,G,R,$){if(R.opacity!= +0){a(R.opacity);c(R.blending);P=D.positionScreen.x;e=D.positionScreen.y;q=V.positionScreen.x;h=V.positionScreen.y;g=T.positionScreen.x;p=T.positionScreen.y;o.beginPath();o.moveTo(P,e);o.lineTo(q,h);o.lineTo(g,p);o.lineTo(P,e);o.closePath();if(R instanceof THREE.MeshBasicMaterial)if(R.map)R.map.image.loaded&&R.map.mapping instanceof THREE.UVMapping&&Aa(P,e,q,h,g,p,R.map.image,G.uvs[0].u,G.uvs[0].v,G.uvs[1].u,G.uvs[1].v,G.uvs[2].u,G.uvs[2].v);else if(R.env_map){if(R.env_map.image.loaded)if(R.env_map.mapping instanceof +THREE.SphericalReflectionMapping){D=na.matrix;Z.copy(G.vertexNormalsWorld[0]);J=(Z.x*D.n11+Z.y*D.n12+Z.z*D.n13)*0.5+0.5;E=-(Z.x*D.n21+Z.y*D.n22+Z.z*D.n23)*0.5+0.5;Z.copy(G.vertexNormalsWorld[1]);U=(Z.x*D.n11+Z.y*D.n12+Z.z*D.n13)*0.5+0.5;X=-(Z.x*D.n21+Z.y*D.n22+Z.z*D.n23)*0.5+0.5;Z.copy(G.vertexNormalsWorld[2]);O=(Z.x*D.n11+Z.y*D.n12+Z.z*D.n13)*0.5+0.5;H=-(Z.x*D.n21+Z.y*D.n22+Z.z*D.n23)*0.5+0.5;Aa(P,e,q,h,g,p,R.env_map.image,J,E,U,X,O,H)}}else R.wireframe?ma(R.color.__styleString,R.wireframe_linewidth): +Ea(R.color.__styleString);else if(R instanceof THREE.MeshLambertMaterial){if(R.map&&!R.wireframe){R.map.mapping instanceof THREE.UVMapping&&Aa(P,e,q,h,g,p,R.map.image,G.uvs[0].u,G.uvs[0].v,G.uvs[1].u,G.uvs[1].v,G.uvs[2].u,G.uvs[2].v);c(THREE.SubtractiveBlending)}if(M)if(!R.wireframe&&R.shading==THREE.SmoothShading&&G.vertexNormalsWorld.length==3){t.r=j.r=l.r=ga.r;t.g=j.g=l.g=ga.g;t.b=j.b=l.b=ga.b;ya($,G.v1.positionWorld,G.vertexNormalsWorld[0],t);ya($,G.v2.positionWorld,G.vertexNormalsWorld[1],j); +ya($,G.v3.positionWorld,G.vertexNormalsWorld[2],l);s.r=(j.r+l.r)*0.5;s.g=(j.g+l.g)*0.5;s.b=(j.b+l.b)*0.5;N=Ma(t,j,l,s);Aa(P,e,q,h,g,p,N,0,0,1,0,0,1)}else{W.r=ga.r;W.g=ga.g;W.b=ga.b;ya($,G.centroidWorld,G.normalWorld,W);i.r=R.color.r*W.r;i.g=R.color.g*W.g;i.b=R.color.b*W.b;i.updateStyleString();R.wireframe?ma(i.__styleString,R.wireframe_linewidth):Ea(i.__styleString)}else R.wireframe?ma(R.color.__styleString,R.wireframe_linewidth):Ea(R.color.__styleString)}else if(R instanceof THREE.MeshDepthMaterial){z= +na.near;v=na.far;t.r=t.g=t.b=1-Ia(D.positionScreen.z,z,v);j.r=j.g=j.b=1-Ia(V.positionScreen.z,z,v);l.r=l.g=l.b=1-Ia(T.positionScreen.z,z,v);s.r=(j.r+l.r)*0.5;s.g=(j.g+l.g)*0.5;s.b=(j.b+l.b)*0.5;N=Ma(t,j,l,s);Aa(P,e,q,h,g,p,N,0,0,1,0,0,1)}else if(R instanceof THREE.MeshNormalMaterial){i.r=Ja(G.normalWorld.x);i.g=Ja(G.normalWorld.y);i.b=Ja(G.normalWorld.z);i.updateStyleString();R.wireframe?ma(i.__styleString,R.wireframe_linewidth):Ea(i.__styleString)}}}function ma(D,V){if(w!=D)o.strokeStyle=w=D;if(K!= +V)o.lineWidth=K=V;o.stroke();C.inflate(V*2)}function Ea(D){if(I!=D)o.fillStyle=I=D;o.fill()}function Aa(D,V,T,G,R,$,fa,ja,la,ua,oa,va,Ba){var ra,wa;ra=fa.width-1;wa=fa.height-1;ja*=ra;la*=wa;ua*=ra;oa*=wa;va*=ra;Ba*=wa;T-=D;G-=V;R-=D;$-=V;ua-=ja;oa-=la;va-=ja;Ba-=la;ra=ua*Ba-va*oa;if(ra!=0){wa=1/ra;ra=(Ba*T-oa*R)*wa;oa=(Ba*G-oa*$)*wa;T=(ua*R-va*T)*wa;G=(ua*$-va*G)*wa;D=D-ra*ja-T*la;V=V-oa*ja-G*la;o.save();o.transform(ra,oa,T,G,D,V);o.clip();o.drawImage(fa,0,0);o.restore()}}function Ma(D,V,T,G){var R= +~~(D.r*255),$=~~(D.g*255);D=~~(D.b*255);var fa=~~(V.r*255),ja=~~(V.g*255);V=~~(V.b*255);var la=~~(T.r*255),ua=~~(T.g*255);T=~~(T.b*255);var oa=~~(G.r*255),va=~~(G.g*255);G=~~(G.b*255);ia[0]=R<0?0:R>255?255:R;ia[1]=$<0?0:$>255?255:$;ia[2]=D<0?0:D>255?255:D;ia[4]=fa<0?0:fa>255?255:fa;ia[5]=ja<0?0:ja>255?255:ja;ia[6]=V<0?0:V>255?255:V;ia[8]=la<0?0:la>255?255:la;ia[9]=ua<0?0:ua>255?255:ua;ia[10]=T<0?0:T>255?255:T;ia[12]=oa<0?0:oa>255?255:oa;ia[13]=va<0?0:va>255?255:va;ia[14]=G<0?0:G>255?255:G;xa.putImageData(ha, +0,0);pa.drawImage(ea,0,0);return ta}function Ia(D,V,T){D=(D-V)/(T-V);return D*D*(3-2*D)}function Ja(D){D=(D+1)*0.5;return D<0?0:D>1?1:D}function Ka(D,V){var T=V.x-D.x,G=V.y-D.y,R=1/Math.sqrt(T*T+G*G);T*=R;G*=R;V.x+=T;V.y+=G;D.x-=T;D.y-=G}var Fa,Na,ca,sa,za,La,Oa,Ca;this.autoClear?this.clear():o.setTransform(1,0,0,-1,b,n);d=f.projectScene(aa,na,this.sortElements);o.fillStyle="rgba( 0, 255, 255, 0.5 )";o.fillRect(L.getX(),L.getY(),L.getWidth(),L.getHeight());(M=aa.lights.length>0)&&ka(aa);Fa=0;for(Na= +d.length;Fa0){U.r+=H.color.r*L;U.g+=H.color.g*L;U.b+=H.color.b*L}}else if(H instanceof THREE.PointLight){p.sub(H.position,E.centroidWorld);p.normalize();L=E.normalWorld.dot(p)*H.intensity;if(L>0){U.r+=H.color.r*L;U.g+=H.color.g*L;U.b+=H.color.b*L}}}}function c(J,E,U,X,O,H){l=f(s++);l.setAttribute("d","M "+J.positionScreen.x+ +" "+J.positionScreen.y+" L "+E.positionScreen.x+" "+E.positionScreen.y+" L "+U.positionScreen.x+","+U.positionScreen.y+"z");if(O instanceof THREE.MeshBasicMaterial)F.__styleString=O.color.__styleString;else if(O instanceof THREE.MeshLambertMaterial)if(S){P.r=e.r;P.g=e.g;P.b=e.b;a(H,X,P);F.r=O.color.r*P.r;F.g=O.color.g*P.g;F.b=O.color.b*P.b;F.updateStyleString()}else F.__styleString=O.color.__styleString;else if(O instanceof THREE.MeshDepthMaterial){g=1-O.__2near/(O.__farPlusNear-X.z*O.__farMinusNear); +F.setRGB(g,g,g)}else O instanceof THREE.MeshNormalMaterial&&F.setRGB(k(X.normalWorld.x),k(X.normalWorld.y),k(X.normalWorld.z));O.wireframe?l.setAttribute("style","fill: none; stroke: "+F.__styleString+"; stroke-width: "+O.wireframe_linewidth+"; stroke-opacity: "+O.opacity+"; stroke-linecap: "+O.wireframe_linecap+"; stroke-linejoin: "+O.wireframe_linejoin):l.setAttribute("style","fill: "+F.__styleString+"; fill-opacity: "+O.opacity);b.appendChild(l)}function d(J,E,U,X,O,H,L){l=f(s++);l.setAttribute("d", +"M "+J.positionScreen.x+" "+J.positionScreen.y+" L "+E.positionScreen.x+" "+E.positionScreen.y+" L "+U.positionScreen.x+","+U.positionScreen.y+" L "+X.positionScreen.x+","+X.positionScreen.y+"z");if(H instanceof THREE.MeshBasicMaterial)F.__styleString=H.color.__styleString;else if(H instanceof THREE.MeshLambertMaterial)if(S){P.r=e.r;P.g=e.g;P.b=e.b;a(L,O,P);F.r=H.color.r*P.r;F.g=H.color.g*P.g;F.b=H.color.b*P.b;F.updateStyleString()}else F.__styleString=H.color.__styleString;else if(H instanceof THREE.MeshDepthMaterial){g= +1-H.__2near/(H.__farPlusNear-O.z*H.__farMinusNear);F.setRGB(g,g,g)}else H instanceof THREE.MeshNormalMaterial&&F.setRGB(k(O.normalWorld.x),k(O.normalWorld.y),k(O.normalWorld.z));H.wireframe?l.setAttribute("style","fill: none; stroke: "+F.__styleString+"; stroke-width: "+H.wireframe_linewidth+"; stroke-opacity: "+H.opacity+"; stroke-linecap: "+H.wireframe_linecap+"; stroke-linejoin: "+H.wireframe_linejoin):l.setAttribute("style","fill: "+F.__styleString+"; fill-opacity: "+H.opacity);b.appendChild(l)} +function f(J){if(i[J]==null){i[J]=document.createElementNS("http://www.w3.org/2000/svg","path");N==0&&i[J].setAttribute("shape-rendering","crispEdges");return i[J]}return i[J]}function k(J){return J<0?Math.min((1+J)*0.5,0.5):0.5+Math.min(J*0.5,0.5)}var m=null,r=new THREE.Projector,b=document.createElementNS("http://www.w3.org/2000/svg","svg"),n,o,B,A,x,y,w,I,K=new THREE.Rectangle,u=new THREE.Rectangle,S=false,F=new THREE.Color(16777215),P=new THREE.Color(16777215),e=new THREE.Color(0),q=new THREE.Color(0), +h=new THREE.Color(0),g,p=new THREE.Vector3,i=[],t=[],j=[],l,s,z,v,N=1;this.domElement=b;this.sortElements=this.sortObjects=this.autoClear=true;this.setQuality=function(J){switch(J){case "high":N=1;break;case "low":N=0}};this.setSize=function(J,E){n=J;o=E;B=n/2;A=o/2;b.setAttribute("viewBox",-B+" "+-A+" "+n+" "+o);b.setAttribute("width",n);b.setAttribute("height",o);K.set(-B,-A,B,A)};this.clear=function(){for(;b.childNodes.length>0;)b.removeChild(b.childNodes[0])};this.render=function(J,E){var U,X, +O,H,L,Q,C,M;this.autoClear&&this.clear();m=r.projectScene(J,E,this.sortElements);v=z=s=0;if(S=J.lights.length>0){C=J.lights;e.setRGB(0,0,0);q.setRGB(0,0,0);h.setRGB(0,0,0);U=0;for(X=C.length;U0){b.bindBuffer(b.ARRAY_BUFFER,e.__webGLUVBuffer);b.bufferData(b.ARRAY_BUFFER,S,h)}if(la&&U>0){b.bindBuffer(b.ARRAY_BUFFER,e.__webGLUV2Buffer);b.bufferData(b.ARRAY_BUFFER,X,h)}if(ha){b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e.__webGLFaceBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER, -ka,h);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e.__webGLLineBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,Y,h)}};this.setLineBuffers=function(e,p){var h,g,k,m=e.vertices,t=e.colors,l=m.length,n=t.length,r=e.__vertexArray,v=e.__colorArray,A=e.__dirtyColors;if(e.__dirtyVertices){for(h=0;h0?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+m.maxDirLights,"#define MAX_POINT_LIGHTS "+m.maxPointLights,m.map?"#define USE_MAP":"",m.env_map?"#define USE_ENVMAP": -"",m.light_map?"#define USE_LIGHTMAP":"",m.vertex_colors?"#define USE_COLOR":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\n"].join("\n");b.attachShader(h,i("fragment",k+n));b.attachShader(h,i("vertex",m+p));b.linkProgram(h);b.getProgramParameter(h,b.LINK_STATUS)|| -alert("Could not initialise shaders\nVALIDATE_STATUS: "+b.getProgramParameter(h,b.VALIDATE_STATUS)+", gl error ["+b.getError()+"]");h.uniforms={};h.attributes={};e.program=h;h=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition"];for(g in e.uniforms)h.push(g);g=e.program;n=0;for(p=h.length;n=0){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLColorBuffer);b.vertexAttribPointer(e.color,3,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.color)}if(e.normal>=0){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLNormalBuffer);b.vertexAttribPointer(e.normal,3,b.FLOAT, -false,0,0);b.enableVertexAttribArray(e.normal)}if(e.tangent>=0){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLTangentBuffer);b.vertexAttribPointer(e.tangent,4,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.tangent)}if(e.uv>=0)if(k.__webGLUVBuffer){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLUVBuffer);b.vertexAttribPointer(e.uv,2,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.uv)}else b.disableVertexAttribArray(e.uv);if(e.uv2>=0)if(k.__webGLUV2Buffer){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLUV2Buffer);b.vertexAttribPointer(e.uv2, -2,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.uv2)}else b.disableVertexAttribArray(e.uv2);if(m instanceof THREE.Mesh)if(g.wireframe){b.lineWidth(g.wireframe_linewidth);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,k.__webGLLineBuffer);b.drawElements(b.LINES,k.__webGLLineCount,b.UNSIGNED_SHORT,0)}else{b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,k.__webGLFaceBuffer);b.drawElements(b.TRIANGLES,k.__webGLFaceCount,b.UNSIGNED_SHORT,0)}else if(m instanceof THREE.Line){m=m.type==THREE.LineStrip?b.LINE_STRIP:b.LINES;b.lineWidth(g.linewidth); -b.drawArrays(m,0,k.__webGLLineCount)}else m instanceof THREE.ParticleSystem&&b.drawArrays(b.POINTS,0,k.__webGLParticleCount)};this.renderPass=function(e,p,h,g,k,m,t){var l,n,r,v,A;r=0;for(v=g.materials.length;r=0;h--){g=e.__webGLObjects[h].object; -p==g&&e.__webGLObjects.splice(h,1)}};this.setupMatrices=function(e,p){e._modelViewMatrix.multiplyToArray(p.matrix,e.matrix,e._modelViewMatrixArray);e._normalMatrix=THREE.Matrix4.makeInvert3x3(e._modelViewMatrix).transposeIntoArray(e._normalMatrixArray)};this.setDepthTest=function(e){e?b.enable(b.DEPTH_TEST):b.disable(b.DEPTH_TEST)};this.setFaceCulling=function(e,p){if(e){!p||p=="ccw"?b.frontFace(b.CCW):b.frontFace(b.CW);if(e=="back")b.cullFace(b.BACK);else e=="front"?b.cullFace(b.FRONT):b.cullFace(b.FRONT_AND_BACK); -b.enable(b.CULL_FACE)}else b.disable(b.CULL_FACE)};this.supportsVertexTextures=function(){return b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0}}; +case THREE.UnsignedByteType:return b.UNSIGNED_BYTE;case THREE.ShortType:return b.SHORT;case THREE.UnsignedShortType:return b.UNSIGNED_SHORT;case THREE.IntType:return b.INT;case THREE.UnsignedShortType:return b.UNSIGNED_INT;case THREE.FloatType:return b.FLOAT;case THREE.AlphaFormat:return b.ALPHA;case THREE.RGBFormat:return b.RGB;case THREE.RGBAFormat:return b.RGBA;case THREE.LuminanceFormat:return b.LUMINANCE;case THREE.LuminanceAlphaFormat:return b.LUMINANCE_ALPHA}return 0}var r=document.createElement("canvas"), +b,n=null,o=null,B=null,A=null,x=null,y=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],w=new THREE.Matrix4,I=new Float32Array(16),K=new Float32Array(16),u=new THREE.Vector4,S=true,F=new THREE.Color(0),P=0;if(a){if(a.antialias!==undefined)S=a.antialias;a.clearColor!==undefined&&F.setHex(a.clearColor);if(a.clearAlpha!==undefined)P=a.clearAlpha}this.domElement=r;this.autoClear=true;(function(e,q,h){try{b=r.getContext("experimental-webgl", +{antialias:e})}catch(g){console.log(g)}if(!b){alert("WebGL not supported");throw"cannot create webgl context";}b.clearColor(0,0,0,1);b.clearDepth(1);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.enable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.ONE,b.ONE_MINUS_SRC_ALPHA);b.clearColor(q.r,q.g,q.b,h);_cullEnabled=true})(S,F,P);this.context=b;this.lights={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[]}};this.setSize= +function(e,q){r.width=e;r.height=q;b.viewport(0,0,r.width,r.height)};this.setClearColorHex=function(e,q){var h=new THREE.Color(e);b.clearColor(h.r,h.g,h.b,q)};this.setClearColor=function(e,q){b.clearColor(e.r,e.g,e.b,q)};this.clear=function(){b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)};this.setupLights=function(e,q){var h,g,p,i=0,t=0,j=0,l,s,z,v=this.lights,N=v.directional.colors,J=v.directional.positions,E=v.point.colors,U=v.point.positions,X=0,O=0;h=p=p=0;for(g=q.length;h0){b.bindBuffer(b.ARRAY_BUFFER,e.__webGLUVBuffer);b.bufferData(b.ARRAY_BUFFER,W,h)}if(pa&&X>0){b.bindBuffer(b.ARRAY_BUFFER,e.__webGLUV2Buffer); +b.bufferData(b.ARRAY_BUFFER,ga,h)}if(ta){b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e.__webGLFaceBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,Z,h);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e.__webGLLineBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,ea,h)}};this.setLineBuffers=function(e,q){var h,g,p,i=e.vertices,t=e.colors,j=i.length,l=t.length,s=e.__vertexArray,z=e.__colorArray,v=e.__dirtyColors;if(e.__dirtyVertices){for(h=0;h0?"#define VERTEX_TEXTURES": +"","#define MAX_DIR_LIGHTS "+i.maxDirLights,"#define MAX_POINT_LIGHTS "+i.maxPointLights,i.map?"#define USE_MAP":"",i.env_map?"#define USE_ENVMAP":"",i.light_map?"#define USE_LIGHTMAP":"",i.vertex_colors?"#define USE_COLOR":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\n"].join("\n"); +b.attachShader(h,k("fragment",p+l));b.attachShader(h,k("vertex",i+q));b.linkProgram(h);b.getProgramParameter(h,b.LINK_STATUS)||alert("Could not initialise shaders\nVALIDATE_STATUS: "+b.getProgramParameter(h,b.VALIDATE_STATUS)+", gl error ["+b.getError()+"]");h.uniforms={};h.attributes={};e.program=h;h=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition"];for(g in e.uniforms)h.push(g);g=e.program;l=0;for(q=h.length;l=0){b.bindBuffer(b.ARRAY_BUFFER,p.__webGLColorBuffer);b.vertexAttribPointer(e.color,3,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.color)}if(e.normal>= +0){b.bindBuffer(b.ARRAY_BUFFER,p.__webGLNormalBuffer);b.vertexAttribPointer(e.normal,3,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.normal)}if(e.tangent>=0){b.bindBuffer(b.ARRAY_BUFFER,p.__webGLTangentBuffer);b.vertexAttribPointer(e.tangent,4,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.tangent)}if(e.uv>=0)if(p.__webGLUVBuffer){b.bindBuffer(b.ARRAY_BUFFER,p.__webGLUVBuffer);b.vertexAttribPointer(e.uv,2,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.uv)}else b.disableVertexAttribArray(e.uv);if(e.uv2>= +0)if(p.__webGLUV2Buffer){b.bindBuffer(b.ARRAY_BUFFER,p.__webGLUV2Buffer);b.vertexAttribPointer(e.uv2,2,b.FLOAT,false,0,0);b.enableVertexAttribArray(e.uv2)}else b.disableVertexAttribArray(e.uv2);if(i instanceof THREE.Mesh)if(g.wireframe){b.lineWidth(g.wireframe_linewidth);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,p.__webGLLineBuffer);b.drawElements(b.LINES,p.__webGLLineCount,b.UNSIGNED_SHORT,0)}else{b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,p.__webGLFaceBuffer);b.drawElements(b.TRIANGLES,p.__webGLFaceCount,b.UNSIGNED_SHORT, +0)}else if(i instanceof THREE.Line){i=i.type==THREE.LineStrip?b.LINE_STRIP:b.LINES;b.lineWidth(g.linewidth);b.drawArrays(i,0,p.__webGLLineCount)}else i instanceof THREE.ParticleSystem&&b.drawArrays(b.POINTS,0,p.__webGLParticleCount)};this.renderPass=function(e,q,h,g,p,i,t){var j,l,s,z,v;s=0;for(z=g.materials.length;s=0;h--){g=e.__webGLObjects[h].object;q==g&&e.__webGLObjects.splice(h,1)}};this.setupMatrices=function(e,q){e._modelViewMatrix.multiplyToArray(q.matrix,e.matrix,e._modelViewMatrixArray);e._normalMatrix=THREE.Matrix4.makeInvert3x3(e._modelViewMatrix).transposeIntoArray(e._normalMatrixArray)};this.setDepthTest=function(e){e?b.enable(b.DEPTH_TEST):b.disable(b.DEPTH_TEST)};this.setFaceCulling=function(e,q){if(e){!q||q=="ccw"?b.frontFace(b.CCW):b.frontFace(b.CW); +if(e=="back")b.cullFace(b.BACK);else e=="front"?b.cullFace(b.FRONT):b.cullFace(b.FRONT_AND_BACK);b.enable(b.CULL_FACE)}else b.disable(b.CULL_FACE)};this.supportsVertexTextures=function(){return b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0}}; THREE.Snippets={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube env_map;\nuniform int combine;\n#endif", envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( env_map, vec3( -vReflect.x, vReflect.yz ) );\nif ( combine == 1 ) {\ngl_FragColor = vec4( mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity ), opacity );\n} else {\ngl_FragColor = gl_FragColor * cubeColor;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refraction_ratio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refraction_ratio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif", map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\n#endif",map_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\nvarying vec2 vUv2;\nuniform sampler2D light_map;\n#endif", diff --git a/build/ThreeExtras.js b/build/ThreeExtras.js index 18795d3b..bd84957e 100644 --- a/build/ThreeExtras.js +++ b/build/ThreeExtras.js @@ -13,32 +13,32 @@ THREE.Vector4=function(a,c,d,e){this.x=a||0;this.y=c||0;this.z=d||0;this.w=e||1} THREE.Vector4.prototype={set:function(a,c,d,e){this.x=a;this.y=c;this.z=d;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w||1;return this},add:function(a,c){this.x=a.x+c.x;this.y=a.y+c.y;this.z=a.z+c.z;this.w=a.w+c.w;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub:function(a,c){this.x=a.x-c.x;this.y=a.y-c.y;this.z=a.z-c.z;this.w=a.w-c.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w; return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){this.x/=a;this.y/=a;this.z/=a;this.w/=a;return this},lerpSelf:function(a,c){this.x+=(a.x-this.x)*c;this.y+=(a.y-this.y)*c;this.z+=(a.z-this.z)*c;this.w+=(a.w-this.w)*c},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}}; THREE.Ray=function(a,c){this.origin=a||new THREE.Vector3;this.direction=c||new THREE.Vector3}; -THREE.Ray.prototype={intersectScene:function(a){var c,d,e=a.objects,g=[];a=0;for(c=e.length;a0&&H>0&&w+H<1}var d,e,g,f,h,b,j,l,p,A, -q,m=a.geometry,B=m.vertices,E=[];d=0;for(e=m.faces.length;dj?e:j;g=g>l? -g:l}a()};this.add3Points=function(j,l,p,A,q,m){if(b){b=false;c=jp?j>q?j:q:p>q?p:q;g=l>A?l>m?l:m:A>m?A:m}else{c=jp?j>q?j>e?j:e:q>e?q:e:p>q?p>e?p:e:q>e?q:e;g=l>A?l>m?l>g?l:g:m>g?m:g:A>m?A>g?A:g:m>g?m:g}a()};this.addRectangle=function(j){if(b){b=false;c=j.getLeft();d=j.getTop();e=j.getRight();g=j.getBottom()}else{c=c0&&H>0&&k+H<1}var d,e,g,f,h,b,j,l,t,A, +w,o=a.geometry,p=o.vertices,C=[];d=0;for(e=o.faces.length;dj?e:j;g=g>l? +g:l}a()};this.add3Points=function(j,l,t,A,w,o){if(b){b=false;c=jt?j>w?j:w:t>w?t:w;g=l>A?l>o?l:o:A>o?A:o}else{c=jt?j>w?j>e?j:e:w>e?w:e:t>w?t>e?t:e:w>e?w:e;g=l>A?l>o?l>g?l:g:o>g?o:g:A>o?A>g?A:g:o>g?o:g}a()};this.addRectangle=function(j){if(b){b=false;c=j.getLeft();d=j.getTop();e=j.getRight();g=j.getBottom()}else{c=cj.getRight()?e:j.getRight();g=g>j.getBottom()?g:j.getBottom()}a()};this.inflate=function(j){c-=j;d-=j;e+=j;g+=j;a()};this.minSelf=function(j){c=c>j.getLeft()?c:j.getLeft();d=d>j.getTop()?d:j.getTop();e=e=0&&Math.min(g,j.getBottom())-Math.max(d,j.getTop())>=0};this.empty=function(){b=true;g=e=d=c=0;a()};this.isEmpty=function(){return b};this.toString= function(){return"THREE.Rectangle ( left: "+c+", right: "+e+", top: "+d+", bottom: "+g+", width: "+f+", height: "+h+" )"}};THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={transpose:function(){var a,c=this.m;a=c[1];c[1]=c[3];c[3]=a;a=c[2];c[2]=c[6];c[6]=a;a=c[5];c[5]=c[7];c[7]=a;return this},transposeIntoArray:function(a){var c=this.m;a[0]=c[0];a[1]=c[3];a[2]=c[6];a[3]=c[1];a[4]=c[4];a[5]=c[7];a[6]=c[2];a[7]=c[5];a[8]=c[8];return this}}; -THREE.Matrix4=function(a,c,d,e,g,f,h,b,j,l,p,A,q,m,B,E){this.n11=a||1;this.n12=c||0;this.n13=d||0;this.n14=e||0;this.n21=g||0;this.n22=f||1;this.n23=h||0;this.n24=b||0;this.n31=j||0;this.n32=l||0;this.n33=p||1;this.n34=A||0;this.n41=q||0;this.n42=m||0;this.n43=B||0;this.n44=E||1;this.flat=Array(16);this.m33=new THREE.Matrix3}; -THREE.Matrix4.prototype={identity:function(){this.n11=1;this.n21=this.n14=this.n13=this.n12=0;this.n22=1;this.n32=this.n31=this.n24=this.n23=0;this.n33=1;this.n43=this.n42=this.n41=this.n34=0;this.n44=1;return this},set:function(a,c,d,e,g,f,h,b,j,l,p,A,q,m,B,E){this.n11=a;this.n12=c;this.n13=d;this.n14=e;this.n21=g;this.n22=f;this.n23=h;this.n24=b;this.n31=j;this.n32=l;this.n33=p;this.n34=A;this.n41=q;this.n42=m;this.n43=B;this.n44=E;return this},copy:function(a){this.n11=a.n11;this.n12=a.n12;this.n13= +THREE.Matrix4=function(a,c,d,e,g,f,h,b,j,l,t,A,w,o,p,C){this.n11=a||1;this.n12=c||0;this.n13=d||0;this.n14=e||0;this.n21=g||0;this.n22=f||1;this.n23=h||0;this.n24=b||0;this.n31=j||0;this.n32=l||0;this.n33=t||1;this.n34=A||0;this.n41=w||0;this.n42=o||0;this.n43=p||0;this.n44=C||1;this.flat=Array(16);this.m33=new THREE.Matrix3}; +THREE.Matrix4.prototype={identity:function(){this.n11=1;this.n21=this.n14=this.n13=this.n12=0;this.n22=1;this.n32=this.n31=this.n24=this.n23=0;this.n33=1;this.n43=this.n42=this.n41=this.n34=0;this.n44=1;return this},set:function(a,c,d,e,g,f,h,b,j,l,t,A,w,o,p,C){this.n11=a;this.n12=c;this.n13=d;this.n14=e;this.n21=g;this.n22=f;this.n23=h;this.n24=b;this.n31=j;this.n32=l;this.n33=t;this.n34=A;this.n41=w;this.n42=o;this.n43=p;this.n44=C;return this},copy:function(a){this.n11=a.n11;this.n12=a.n12;this.n13= a.n13;this.n14=a.n14;this.n21=a.n21;this.n22=a.n22;this.n23=a.n23;this.n24=a.n24;this.n31=a.n31;this.n32=a.n32;this.n33=a.n33;this.n34=a.n34;this.n41=a.n41;this.n42=a.n42;this.n43=a.n43;this.n44=a.n44;return this},lookAt:function(a,c,d){var e=THREE.Matrix4.__tmpVec1,g=THREE.Matrix4.__tmpVec2,f=THREE.Matrix4.__tmpVec3;f.sub(a,c).normalize();e.cross(d,f).normalize();g.cross(f,e).normalize();this.n11=e.x;this.n12=e.y;this.n13=e.z;this.n14=-e.dot(a);this.n21=g.x;this.n22=g.y;this.n23=g.z;this.n24=-g.dot(a); this.n31=f.x;this.n32=f.y;this.n33=f.z;this.n34=-f.dot(a);this.n43=this.n42=this.n41=0;this.n44=1;return this},multiplyVector3:function(a){var c=a.x,d=a.y,e=a.z,g=1/(this.n41*c+this.n42*d+this.n43*e+this.n44);a.x=(this.n11*c+this.n12*d+this.n13*e+this.n14)*g;a.y=(this.n21*c+this.n22*d+this.n23*e+this.n24)*g;a.z=(this.n31*c+this.n32*d+this.n33*e+this.n34)*g;return a},multiplyVector4:function(a){var c=a.x,d=a.y,e=a.z,g=a.w;a.x=this.n11*c+this.n12*d+this.n13*e+this.n14*g;a.y=this.n21*c+this.n22*d+this.n23* -e+this.n24*g;a.z=this.n31*c+this.n32*d+this.n33*e+this.n34*g;a.w=this.n41*c+this.n42*d+this.n43*e+this.n44*g;return a},crossVector:function(a){var c=new THREE.Vector4;c.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;c.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;c.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;c.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return c},multiply:function(a,c){var d=a.n11,e=a.n12,g=a.n13,f=a.n14,h=a.n21,b=a.n22,j=a.n23,l=a.n24,p=a.n31, -A=a.n32,q=a.n33,m=a.n34,B=a.n41,E=a.n42,H=a.n43,x=a.n44,I=c.n11,t=c.n12,k=c.n13,w=c.n14,u=c.n21,n=c.n22,o=c.n23,v=c.n24,D=c.n31,y=c.n32,C=c.n33,z=c.n34,F=c.n41,J=c.n42,M=c.n43,Q=c.n44;this.n11=d*I+e*u+g*D+f*F;this.n12=d*t+e*n+g*y+f*J;this.n13=d*k+e*o+g*C+f*M;this.n14=d*w+e*v+g*z+f*Q;this.n21=h*I+b*u+j*D+l*F;this.n22=h*t+b*n+j*y+l*J;this.n23=h*k+b*o+j*C+l*M;this.n24=h*w+b*v+j*z+l*Q;this.n31=p*I+A*u+q*D+m*F;this.n32=p*t+A*n+q*y+m*J;this.n33=p*k+A*o+q*C+m*M;this.n34=p*w+A*v+q*z+m*Q;this.n41=B*I+E*u+ -H*D+x*F;this.n42=B*t+E*n+H*y+x*J;this.n43=B*k+E*o+H*C+x*M;this.n44=B*w+E*v+H*z+x*Q;return this},multiplyToArray:function(a,c,d){var e=a.n11,g=a.n12,f=a.n13,h=a.n14,b=a.n21,j=a.n22,l=a.n23,p=a.n24,A=a.n31,q=a.n32,m=a.n33,B=a.n34,E=a.n41,H=a.n42,x=a.n43;a=a.n44;var I=c.n11,t=c.n12,k=c.n13,w=c.n14,u=c.n21,n=c.n22,o=c.n23,v=c.n24,D=c.n31,y=c.n32,C=c.n33,z=c.n34,F=c.n41,J=c.n42,M=c.n43;c=c.n44;this.n11=e*I+g*u+f*D+h*F;this.n12=e*t+g*n+f*y+h*J;this.n13=e*k+g*o+f*C+h*M;this.n14=e*w+g*v+f*z+h*c;this.n21= -b*I+j*u+l*D+p*F;this.n22=b*t+j*n+l*y+p*J;this.n23=b*k+j*o+l*C+p*M;this.n24=b*w+j*v+l*z+p*c;this.n31=A*I+q*u+m*D+B*F;this.n32=A*t+q*n+m*y+B*J;this.n33=A*k+q*o+m*C+B*M;this.n34=A*w+q*v+m*z+B*c;this.n41=E*I+H*u+x*D+a*F;this.n42=E*t+H*n+x*y+a*J;this.n43=E*k+H*o+x*C+a*M;this.n44=E*w+H*v+x*z+a*c;d[0]=this.n11;d[1]=this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34; -d[15]=this.n44;return this},multiplySelf:function(a){var c=this.n11,d=this.n12,e=this.n13,g=this.n14,f=this.n21,h=this.n22,b=this.n23,j=this.n24,l=this.n31,p=this.n32,A=this.n33,q=this.n34,m=this.n41,B=this.n42,E=this.n43,H=this.n44,x=a.n11,I=a.n21,t=a.n31,k=a.n41,w=a.n12,u=a.n22,n=a.n32,o=a.n42,v=a.n13,D=a.n23,y=a.n33,C=a.n43,z=a.n14,F=a.n24,J=a.n34;a=a.n44;this.n11=c*x+d*I+e*t+g*k;this.n12=c*w+d*u+e*n+g*o;this.n13=c*v+d*D+e*y+g*C;this.n14=c*z+d*F+e*J+g*a;this.n21=f*x+h*I+b*t+j*k;this.n22=f*w+h* -u+b*n+j*o;this.n23=f*v+h*D+b*y+j*C;this.n24=f*z+h*F+b*J+j*a;this.n31=l*x+p*I+A*t+q*k;this.n32=l*w+p*u+A*n+q*o;this.n33=l*v+p*D+A*y+q*C;this.n34=l*z+p*F+A*J+q*a;this.n41=m*x+B*I+E*t+H*k;this.n42=m*w+B*u+E*n+H*o;this.n43=m*v+B*D+E*y+H*C;this.n44=m*z+B*F+E*J+H*a;return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this}, -determinant:function(){var a=this.n11,c=this.n12,d=this.n13,e=this.n14,g=this.n21,f=this.n22,h=this.n23,b=this.n24,j=this.n31,l=this.n32,p=this.n33,A=this.n34,q=this.n41,m=this.n42,B=this.n43,E=this.n44;return e*h*l*q-d*b*l*q-e*f*p*q+c*b*p*q+d*f*A*q-c*h*A*q-e*h*j*m+d*b*j*m+e*g*p*m-a*b*p*m-d*g*A*m+a*h*A*m+e*f*j*B-c*b*j*B-e*g*l*B+a*b*l*B+c*g*A*B-a*f*A*B-d*f*j*E+c*h*j*E+d*g*l*E-a*h*l*E-c*g*p*E+a*f*p*E},transpose:function(){function a(c,d,e){var g=c[d];c[d]=c[e];c[e]=g}a(this,"n21","n12");a(this,"n31", +e+this.n24*g;a.z=this.n31*c+this.n32*d+this.n33*e+this.n34*g;a.w=this.n41*c+this.n42*d+this.n43*e+this.n44*g;return a},crossVector:function(a){var c=new THREE.Vector4;c.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;c.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;c.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;c.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return c},multiply:function(a,c){var d=a.n11,e=a.n12,g=a.n13,f=a.n14,h=a.n21,b=a.n22,j=a.n23,l=a.n24,t=a.n31, +A=a.n32,w=a.n33,o=a.n34,p=a.n41,C=a.n42,H=a.n43,y=a.n44,I=c.n11,v=c.n12,L=c.n13,k=c.n14,B=c.n21,n=c.n22,m=c.n23,z=c.n24,q=c.n31,D=c.n32,x=c.n33,u=c.n34,F=c.n41,J=c.n42,G=c.n43,T=c.n44;this.n11=d*I+e*B+g*q+f*F;this.n12=d*v+e*n+g*D+f*J;this.n13=d*L+e*m+g*x+f*G;this.n14=d*k+e*z+g*u+f*T;this.n21=h*I+b*B+j*q+l*F;this.n22=h*v+b*n+j*D+l*J;this.n23=h*L+b*m+j*x+l*G;this.n24=h*k+b*z+j*u+l*T;this.n31=t*I+A*B+w*q+o*F;this.n32=t*v+A*n+w*D+o*J;this.n33=t*L+A*m+w*x+o*G;this.n34=t*k+A*z+w*u+o*T;this.n41=p*I+C*B+ +H*q+y*F;this.n42=p*v+C*n+H*D+y*J;this.n43=p*L+C*m+H*x+y*G;this.n44=p*k+C*z+H*u+y*T;return this},multiplyToArray:function(a,c,d){var e=a.n11,g=a.n12,f=a.n13,h=a.n14,b=a.n21,j=a.n22,l=a.n23,t=a.n24,A=a.n31,w=a.n32,o=a.n33,p=a.n34,C=a.n41,H=a.n42,y=a.n43;a=a.n44;var I=c.n11,v=c.n12,L=c.n13,k=c.n14,B=c.n21,n=c.n22,m=c.n23,z=c.n24,q=c.n31,D=c.n32,x=c.n33,u=c.n34,F=c.n41,J=c.n42,G=c.n43;c=c.n44;this.n11=e*I+g*B+f*q+h*F;this.n12=e*v+g*n+f*D+h*J;this.n13=e*L+g*m+f*x+h*G;this.n14=e*k+g*z+f*u+h*c;this.n21= +b*I+j*B+l*q+t*F;this.n22=b*v+j*n+l*D+t*J;this.n23=b*L+j*m+l*x+t*G;this.n24=b*k+j*z+l*u+t*c;this.n31=A*I+w*B+o*q+p*F;this.n32=A*v+w*n+o*D+p*J;this.n33=A*L+w*m+o*x+p*G;this.n34=A*k+w*z+o*u+p*c;this.n41=C*I+H*B+y*q+a*F;this.n42=C*v+H*n+y*D+a*J;this.n43=C*L+H*m+y*x+a*G;this.n44=C*k+H*z+y*u+a*c;d[0]=this.n11;d[1]=this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34; +d[15]=this.n44;return this},multiplySelf:function(a){var c=this.n11,d=this.n12,e=this.n13,g=this.n14,f=this.n21,h=this.n22,b=this.n23,j=this.n24,l=this.n31,t=this.n32,A=this.n33,w=this.n34,o=this.n41,p=this.n42,C=this.n43,H=this.n44,y=a.n11,I=a.n21,v=a.n31,L=a.n41,k=a.n12,B=a.n22,n=a.n32,m=a.n42,z=a.n13,q=a.n23,D=a.n33,x=a.n43,u=a.n14,F=a.n24,J=a.n34;a=a.n44;this.n11=c*y+d*I+e*v+g*L;this.n12=c*k+d*B+e*n+g*m;this.n13=c*z+d*q+e*D+g*x;this.n14=c*u+d*F+e*J+g*a;this.n21=f*y+h*I+b*v+j*L;this.n22=f*k+h* +B+b*n+j*m;this.n23=f*z+h*q+b*D+j*x;this.n24=f*u+h*F+b*J+j*a;this.n31=l*y+t*I+A*v+w*L;this.n32=l*k+t*B+A*n+w*m;this.n33=l*z+t*q+A*D+w*x;this.n34=l*u+t*F+A*J+w*a;this.n41=o*y+p*I+C*v+H*L;this.n42=o*k+p*B+C*n+H*m;this.n43=o*z+p*q+C*D+H*x;this.n44=o*u+p*F+C*J+H*a;return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this}, +determinant:function(){var a=this.n11,c=this.n12,d=this.n13,e=this.n14,g=this.n21,f=this.n22,h=this.n23,b=this.n24,j=this.n31,l=this.n32,t=this.n33,A=this.n34,w=this.n41,o=this.n42,p=this.n43,C=this.n44;return e*h*l*w-d*b*l*w-e*f*t*w+c*b*t*w+d*f*A*w-c*h*A*w-e*h*j*o+d*b*j*o+e*g*t*o-a*b*t*o-d*g*A*o+a*h*A*o+e*f*j*p-c*b*j*p-e*g*l*p+a*b*l*p+c*g*A*p-a*f*A*p-d*f*j*C+c*h*j*C+d*g*l*C-a*h*l*C-c*g*t*C+a*f*t*C},transpose:function(){function a(c,d,e){var g=c[d];c[d]=c[e];c[e]=g}a(this,"n21","n12");a(this,"n31", "n13");a(this,"n32","n23");a(this,"n41","n14");a(this,"n42","n24");a(this,"n43","n34");return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){var a=this.flat;a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]= this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArray:function(a){a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},setTranslation:function(a,c,d){this.set(1,0,0,a,0,1,0,c,0,0,1,d,0,0,0, 1);return this},setScale:function(a,c,d){this.set(a,0,0,0,0,c,0,0,0,0,d,0,0,0,0,1);return this},setRotX:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,c,-a,0,0,a,c,0,0,0,0,1);return this},setRotY:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,0,a,0,0,1,0,0,-a,0,c,0,0,0,0,1);return this},setRotZ:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,-a,0,0,a,c,0,0,0,0,1,0,0,0,0,1);return this},setRotAxis:function(a,c){var d=Math.cos(c),e=Math.sin(c),g=1-d,f=a.x,h=a.y,b=a.z, j=g*f,l=g*h;this.set(j*f+d,j*h-e*b,j*b+e*h,0,j*h+e*b,l*h+d,l*b-e*f,0,j*b-e*h,l*b+e*f,g*b*b+d,0,0,0,0,1);return this},toString:function(){return"| "+this.n11+" "+this.n12+" "+this.n13+" "+this.n14+" |\n| "+this.n21+" "+this.n22+" "+this.n23+" "+this.n24+" |\n| "+this.n31+" "+this.n32+" "+this.n33+" "+this.n34+" |\n| "+this.n41+" "+this.n42+" "+this.n43+" "+this.n44+" |"}};THREE.Matrix4.translationMatrix=function(a,c,d){var e=new THREE.Matrix4;e.setTranslation(a,c,d);return e}; THREE.Matrix4.scaleMatrix=function(a,c,d){var e=new THREE.Matrix4;e.setScale(a,c,d);return e};THREE.Matrix4.rotationXMatrix=function(a){var c=new THREE.Matrix4;c.setRotX(a);return c};THREE.Matrix4.rotationYMatrix=function(a){var c=new THREE.Matrix4;c.setRotY(a);return c};THREE.Matrix4.rotationZMatrix=function(a){var c=new THREE.Matrix4;c.setRotZ(a);return c};THREE.Matrix4.rotationAxisAngleMatrix=function(a,c){var d=new THREE.Matrix4;d.setRotAxis(a,c);return d}; -THREE.Matrix4.makeInvert=function(a){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,b=a.n23,j=a.n24,l=a.n31,p=a.n32,A=a.n33,q=a.n34,m=a.n41,B=a.n42,E=a.n43,H=a.n44,x=new THREE.Matrix4;x.n11=b*q*B-j*A*B+j*p*E-h*q*E-b*p*H+h*A*H;x.n12=g*A*B-e*q*B-g*p*E+d*q*E+e*p*H-d*A*H;x.n13=e*j*B-g*b*B+g*h*E-d*j*E-e*h*H+d*b*H;x.n14=g*b*p-e*j*p-g*h*A+d*j*A+e*h*q-d*b*q;x.n21=j*A*m-b*q*m-j*l*E+f*q*E+b*l*H-f*A*H;x.n22=e*q*m-g*A*m+g*l*E-c*q*E-e*l*H+c*A*H;x.n23=g*b*m-e*j*m-g*f*E+c*j*E+e*f*H-c*b*H;x.n24=e*j*l-g*b*l+ -g*f*A-c*j*A-e*f*q+c*b*q;x.n31=h*q*m-j*p*m+j*l*B-f*q*B-h*l*H+f*p*H;x.n32=g*p*m-d*q*m-g*l*B+c*q*B+d*l*H-c*p*H;x.n33=e*j*m-g*h*m+g*f*B-c*j*B-d*f*H+c*h*H;x.n34=g*h*l-d*j*l-g*f*p+c*j*p+d*f*q-c*h*q;x.n41=b*p*m-h*A*m-b*l*B+f*A*B+h*l*E-f*p*E;x.n42=d*A*m-e*p*m+e*l*B-c*A*B-d*l*E+c*p*E;x.n43=e*h*m-d*b*m-e*f*B+c*b*B+d*f*E-c*h*E;x.n44=d*b*l-e*h*l+e*f*p-c*b*p-d*f*A+c*h*A;x.multiplyScalar(1/a.determinant());return x}; -THREE.Matrix4.makeInvert3x3=function(a){var c=a.m33,d=c.m,e=a.n33*a.n22-a.n32*a.n23,g=-a.n33*a.n21+a.n31*a.n23,f=a.n32*a.n21-a.n31*a.n22,h=-a.n33*a.n12+a.n32*a.n13,b=a.n33*a.n11-a.n31*a.n13,j=-a.n32*a.n11+a.n31*a.n12,l=a.n23*a.n12-a.n22*a.n13,p=-a.n23*a.n11+a.n21*a.n13,A=a.n22*a.n11-a.n21*a.n12;a=a.n11*e+a.n21*h+a.n31*l;if(a==0)throw"matrix not invertible";a=1/a;d[0]=a*e;d[1]=a*g;d[2]=a*f;d[3]=a*h;d[4]=a*b;d[5]=a*j;d[6]=a*l;d[7]=a*p;d[8]=a*A;return c}; +THREE.Matrix4.makeInvert=function(a){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,b=a.n23,j=a.n24,l=a.n31,t=a.n32,A=a.n33,w=a.n34,o=a.n41,p=a.n42,C=a.n43,H=a.n44,y=new THREE.Matrix4;y.n11=b*w*p-j*A*p+j*t*C-h*w*C-b*t*H+h*A*H;y.n12=g*A*p-e*w*p-g*t*C+d*w*C+e*t*H-d*A*H;y.n13=e*j*p-g*b*p+g*h*C-d*j*C-e*h*H+d*b*H;y.n14=g*b*t-e*j*t-g*h*A+d*j*A+e*h*w-d*b*w;y.n21=j*A*o-b*w*o-j*l*C+f*w*C+b*l*H-f*A*H;y.n22=e*w*o-g*A*o+g*l*C-c*w*C-e*l*H+c*A*H;y.n23=g*b*o-e*j*o-g*f*C+c*j*C+e*f*H-c*b*H;y.n24=e*j*l-g*b*l+ +g*f*A-c*j*A-e*f*w+c*b*w;y.n31=h*w*o-j*t*o+j*l*p-f*w*p-h*l*H+f*t*H;y.n32=g*t*o-d*w*o-g*l*p+c*w*p+d*l*H-c*t*H;y.n33=e*j*o-g*h*o+g*f*p-c*j*p-d*f*H+c*h*H;y.n34=g*h*l-d*j*l-g*f*t+c*j*t+d*f*w-c*h*w;y.n41=b*t*o-h*A*o-b*l*p+f*A*p+h*l*C-f*t*C;y.n42=d*A*o-e*t*o+e*l*p-c*A*p-d*l*C+c*t*C;y.n43=e*h*o-d*b*o-e*f*p+c*b*p+d*f*C-c*h*C;y.n44=d*b*l-e*h*l+e*f*t-c*b*t-d*f*A+c*h*A;y.multiplyScalar(1/a.determinant());return y}; +THREE.Matrix4.makeInvert3x3=function(a){var c=a.m33,d=c.m,e=a.n33*a.n22-a.n32*a.n23,g=-a.n33*a.n21+a.n31*a.n23,f=a.n32*a.n21-a.n31*a.n22,h=-a.n33*a.n12+a.n32*a.n13,b=a.n33*a.n11-a.n31*a.n13,j=-a.n32*a.n11+a.n31*a.n12,l=a.n23*a.n12-a.n22*a.n13,t=-a.n23*a.n11+a.n21*a.n13,A=a.n22*a.n11-a.n21*a.n12;a=a.n11*e+a.n21*h+a.n31*l;if(a==0)throw"matrix not invertible";a=1/a;d[0]=a*e;d[1]=a*g;d[2]=a*f;d[3]=a*h;d[4]=a*b;d[5]=a*j;d[6]=a*l;d[7]=a*t;d[8]=a*A;return c}; THREE.Matrix4.makeFrustum=function(a,c,d,e,g,f){var h,b,j;h=new THREE.Matrix4;b=2*g/(c-a);j=2*g/(e-d);a=(c+a)/(c-a);d=(e+d)/(e-d);e=-(f+g)/(f-g);g=-2*f*g/(f-g);h.n11=b;h.n12=0;h.n13=a;h.n14=0;h.n21=0;h.n22=j;h.n23=d;h.n24=0;h.n31=0;h.n32=0;h.n33=e;h.n34=g;h.n41=0;h.n42=0;h.n43=-1;h.n44=0;return h};THREE.Matrix4.makePerspective=function(a,c,d,e){var g;a=d*Math.tan(a*Math.PI/360);g=-a;return THREE.Matrix4.makeFrustum(g*c,a*c,g,a,d,e)}; THREE.Matrix4.makeOrtho=function(a,c,d,e,g,f){var h,b,j,l;h=new THREE.Matrix4;b=c-a;j=d-e;l=f-g;a=(c+a)/b;d=(d+e)/j;g=(f+g)/l;h.n11=2/b;h.n12=0;h.n13=0;h.n14=-a;h.n21=0;h.n22=2/j;h.n23=0;h.n24=-d;h.n31=0;h.n32=0;h.n33=-2/l;h.n34=-g;h.n41=0;h.n42=0;h.n43=0;h.n44=1;return h};THREE.Matrix4.__tmpVec1=new THREE.Vector3;THREE.Matrix4.__tmpVec2=new THREE.Vector3;THREE.Matrix4.__tmpVec3=new THREE.Vector3; THREE.Vertex=function(a,c){this.position=a||new THREE.Vector3;this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.normal=c||new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.normalScreen=new THREE.Vector3;this.tangent=new THREE.Vector4;this.__visible=true};THREE.Vertex.prototype={toString:function(){return"THREE.Vertex ( position: "+this.position+", normal: "+this.normal+" )"}}; @@ -49,12 +49,12 @@ THREE.Geometry.prototype={computeCentroids:function(){var a,c,d;a=0;for(c=this.f d.centroid.addSelf(this.vertices[d.d].position);d.centroid.divideScalar(4)}}},computeFaceNormals:function(a){var c,d,e,g,f,h,b=new THREE.Vector3,j=new THREE.Vector3;e=0;for(g=this.vertices.length;e0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y], +this.vertices[e.d].normal.copy(e.vertexNormals[3])}}c=0;for(d=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y], z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,d=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z -this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,c=0,d=this.vertices.length;c65535){l[b].counter+=1;j=l[b].hash+"_"+l[b].counter;if(this.geometryChunks[j]==undefined)this.geometryChunks[j]={faces:[],materials:h,vertices:0}}this.geometryChunks[j].faces.push(e);this.geometryChunks[j].vertices+=f}},toString:function(){return"THREE.Geometry ( vertices: "+ this.vertices+", faces: "+this.faces+", uvs: "+this.uvs+" )"}}; THREE.Camera=function(a,c,d,e){this.fov=a;this.aspect=c;this.near=d;this.far=e;this.position=new THREE.Vector3;this.target={position:new THREE.Vector3};this.autoUpdateMatrix=true;this.projectionMatrix=null;this.matrix=new THREE.Matrix4;this.up=new THREE.Vector3(0,1,0);this.tmpVec=new THREE.Vector3;this.translateX=function(g){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(g);this.tmpVec.crossSelf(this.up);this.position.addSelf(this.tmpVec);this.target.position.addSelf(this.tmpVec)}; @@ -104,106 +104,106 @@ var Uniforms={clone:function(a){var c,d,e,g={};for(c in a){g[c]={};for(d in a[c] THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){}; THREE.Scene=function(){this.objects=[];this.lights=[];this.fog=null;this.addObject=function(a){this.objects.indexOf(a)===-1&&this.objects.push(a)};this.removeObject=function(a){a=this.objects.indexOf(a);a!==-1&&this.objects.splice(a,1)};this.addLight=function(a){this.lights.indexOf(a)===-1&&this.lights.push(a)};this.removeLight=function(a){a=this.lights.indexOf(a);a!==-1&&this.lights.splice(a,1)};this.toString=function(){return"THREE.Scene ( "+this.objects+" )"}}; THREE.Fog=function(a,c,d){this.color=new THREE.Color(a);this.near=c||1;this.far=d||1E3};THREE.FogExp2=function(a,c){this.color=new THREE.Color(a);this.density=c||2.5E-4}; -THREE.Projector=function(){function a(n,o){return o.z-n.z}function c(n,o){var v=0,D=1,y=n.z+n.w,C=o.z+o.w,z=-n.z+n.w,F=-o.z+o.w;if(y>=0&&C>=0&&z>=0&&F>=0)return true;else if(y<0&&C<0||z<0&&F<0)return false;else{if(y<0)v=Math.max(v,y/(y-C));else if(C<0)D=Math.min(D,y/(y-C));if(z<0)v=Math.max(v,z/(z-F));else if(F<0)D=Math.min(D,z/(z-F));if(Dy&&M.z0&&H.z<1){q=B[m]=B[m]||new THREE.RenderableParticle;q.x=H.x/H.w;q.y=H.y/H.w;q.z=H.z;q.rotation=U.rotation.z;q.scale.x=U.scale.x*Math.abs(q.x-(H.x+o.projectionMatrix.n11)/ -(H.w+o.projectionMatrix.n14));q.scale.y=U.scale.y*Math.abs(q.y-(H.y+o.projectionMatrix.n22)/(H.w+o.projectionMatrix.n24));q.materials=U.materials;D.push(q);m++}}}}v&&D.sort(a);return D};this.unprojectVector=function(n,o){var v=THREE.Matrix4.makeInvert(o.matrix);v.multiplySelf(THREE.Matrix4.makeInvert(o.projectionMatrix));v.multiplyVector3(n);return n}}; -THREE.DOMRenderer=function(){THREE.Renderer.call(this);var a=null,c=new THREE.Projector,d,e,g,f;this.domElement=document.createElement("div");this.setSize=function(h,b){d=h;e=b;g=d/2;f=e/2};this.render=function(h,b){var j,l,p,A,q,m,B,E;a=c.projectScene(h,b);j=0;for(l=a.length;j0){R.r+=na.r*ga;R.g+=na.g*ga;R.b+=na.b*ga}}else if(ga instanceof THREE.PointLight){L.sub(ga.position,fa);L.normalize(); -ga=aa.dot(L)*oa;if(ga>0){R.r+=na.r*ga;R.g+=na.g*ga;R.b+=na.b*ga}}}}function Ja(P,fa,aa){if(aa.opacity!=0){a(aa.opacity);c(aa.blending);var R,Y,ga,na,oa,pa;if(aa instanceof THREE.ParticleBasicMaterial){if(aa.map&&aa.map.image.loaded){na=aa.map.image;oa=na.width>>1;pa=na.height>>1;Y=fa.scale.x*b;ga=fa.scale.y*j;aa=Y*oa;R=ga*pa;K.set(P.x-aa,P.y-R,P.x+aa,P.y+R);if(Z.instersects(K)){l.save();l.translate(P.x,P.y);l.rotate(-fa.rotation);l.scale(Y,-ga);l.translate(-oa,-pa);l.drawImage(na,0,0);l.restore()}}}else if(aa instanceof -THREE.ParticleCircleMaterial){if(W){ba.r=ha.r+ea.r+G.r;ba.g=ha.g+ea.g+G.g;ba.b=ha.b+ea.b+G.b;D.r=aa.color.r*ba.r;D.g=aa.color.g*ba.g;D.b=aa.color.b*ba.b;D.updateStyleString()}else D.__styleString=aa.color.__styleString;aa=fa.scale.x*b;R=fa.scale.y*j;K.set(P.x-aa,P.y-R,P.x+aa,P.y+R);if(Z.instersects(K)){Y=D.__styleString;if(E!=Y)l.fillStyle=E=Y;l.save();l.translate(P.x,P.y);l.rotate(-fa.rotation);l.scale(aa,R);l.beginPath();l.arc(0,0,1,0,N,true);l.closePath();l.fill();l.restore()}}}}function Ka(P, -fa,aa,R){if(R.opacity!=0){a(R.opacity);c(R.blending);l.beginPath();l.moveTo(P.positionScreen.x,P.positionScreen.y);l.lineTo(fa.positionScreen.x,fa.positionScreen.y);l.closePath();if(R instanceof THREE.LineBasicMaterial){D.__styleString=R.color.__styleString;P=R.linewidth;if(H!=P)l.lineWidth=H=P;P=D.__styleString;if(B!=P)l.strokeStyle=B=P;l.stroke();K.inflate(R.linewidth*2)}}}function ra(P,fa,aa,R,Y,ga){if(Y.opacity!=0){a(Y.opacity);c(Y.blending);k=P.positionScreen.x;w=P.positionScreen.y;u=fa.positionScreen.x; -n=fa.positionScreen.y;o=aa.positionScreen.x;v=aa.positionScreen.y;l.beginPath();l.moveTo(k,w);l.lineTo(u,n);l.lineTo(o,v);l.lineTo(k,w);l.closePath();if(Y instanceof THREE.MeshBasicMaterial)if(Y.map)Y.map.image.loaded&&Y.map.mapping instanceof THREE.UVMapping&&Ca(k,w,u,n,o,v,Y.map.image,R.uvs[0].u,R.uvs[0].v,R.uvs[1].u,R.uvs[1].v,R.uvs[2].u,R.uvs[2].v);else if(Y.env_map){if(Y.env_map.image.loaded)if(Y.env_map.mapping instanceof THREE.SphericalReflectionMapping){P=ja.matrix;L.copy(R.vertexNormalsWorld[0]); -S=(L.x*P.n11+L.y*P.n12+L.z*P.n13)*0.5+0.5;U=-(L.x*P.n21+L.y*P.n22+L.z*P.n23)*0.5+0.5;L.copy(R.vertexNormalsWorld[1]);ca=(L.x*P.n11+L.y*P.n12+L.z*P.n13)*0.5+0.5;da=-(L.x*P.n21+L.y*P.n22+L.z*P.n23)*0.5+0.5;L.copy(R.vertexNormalsWorld[2]);T=(L.x*P.n11+L.y*P.n12+L.z*P.n13)*0.5+0.5;O=-(L.x*P.n21+L.y*P.n22+L.z*P.n23)*0.5+0.5;Ca(k,w,u,n,o,v,Y.env_map.image,S,U,ca,da,T,O)}}else Y.wireframe?Ga(Y.color.__styleString,Y.wireframe_linewidth):Ha(Y.color.__styleString);else if(Y instanceof THREE.MeshLambertMaterial){if(Y.map&& -!Y.wireframe){Y.map.mapping instanceof THREE.UVMapping&&Ca(k,w,u,n,o,v,Y.map.image,R.uvs[0].u,R.uvs[0].v,R.uvs[1].u,R.uvs[1].v,R.uvs[2].u,R.uvs[2].v);c(THREE.SubtractiveBlending)}if(W)if(!Y.wireframe&&Y.shading==THREE.SmoothShading&&R.vertexNormalsWorld.length==3){y.r=C.r=z.r=ha.r;y.g=C.g=z.g=ha.g;y.b=C.b=z.b=ha.b;Aa(ga,R.v1.positionWorld,R.vertexNormalsWorld[0],y);Aa(ga,R.v2.positionWorld,R.vertexNormalsWorld[1],C);Aa(ga,R.v3.positionWorld,R.vertexNormalsWorld[2],z);F.r=(C.r+z.r)*0.5;F.g=(C.g+z.g)* -0.5;F.b=(C.b+z.b)*0.5;Q=Pa(y,C,z,F);Ca(k,w,u,n,o,v,Q,0,0,1,0,0,1)}else{ba.r=ha.r;ba.g=ha.g;ba.b=ha.b;Aa(ga,R.centroidWorld,R.normalWorld,ba);D.r=Y.color.r*ba.r;D.g=Y.color.g*ba.g;D.b=Y.color.b*ba.b;D.updateStyleString();Y.wireframe?Ga(D.__styleString,Y.wireframe_linewidth):Ha(D.__styleString)}else Y.wireframe?Ga(Y.color.__styleString,Y.wireframe_linewidth):Ha(Y.color.__styleString)}else if(Y instanceof THREE.MeshDepthMaterial){J=ja.near;M=ja.far;y.r=y.g=y.b=1-La(P.positionScreen.z,J,M);C.r=C.g=C.b= -1-La(fa.positionScreen.z,J,M);z.r=z.g=z.b=1-La(aa.positionScreen.z,J,M);F.r=(C.r+z.r)*0.5;F.g=(C.g+z.g)*0.5;F.b=(C.b+z.b)*0.5;Q=Pa(y,C,z,F);Ca(k,w,u,n,o,v,Q,0,0,1,0,0,1)}else if(Y instanceof THREE.MeshNormalMaterial){D.r=Ma(R.normalWorld.x);D.g=Ma(R.normalWorld.y);D.b=Ma(R.normalWorld.z);D.updateStyleString();Y.wireframe?Ga(D.__styleString,Y.wireframe_linewidth):Ha(D.__styleString)}}}function Ga(P,fa){if(B!=P)l.strokeStyle=B=P;if(H!=fa)l.lineWidth=H=fa;l.stroke();K.inflate(fa*2)}function Ha(P){if(E!= -P)l.fillStyle=E=P;l.fill()}function Ca(P,fa,aa,R,Y,ga,na,oa,pa,xa,sa,ya,Da){var va,za;va=na.width-1;za=na.height-1;oa*=va;pa*=za;xa*=va;sa*=za;ya*=va;Da*=za;aa-=P;R-=fa;Y-=P;ga-=fa;xa-=oa;sa-=pa;ya-=oa;Da-=pa;va=xa*Da-ya*sa;if(va!=0){za=1/va;va=(Da*aa-sa*Y)*za;sa=(Da*R-sa*ga)*za;aa=(xa*Y-ya*aa)*za;R=(xa*ga-ya*R)*za;P=P-va*oa-aa*pa;fa=fa-sa*oa-R*pa;l.save();l.transform(va,sa,aa,R,P,fa);l.clip();l.drawImage(na,0,0);l.restore()}}function Pa(P,fa,aa,R){var Y=~~(P.r*255),ga=~~(P.g*255);P=~~(P.b*255);var na= -~~(fa.r*255),oa=~~(fa.g*255);fa=~~(fa.b*255);var pa=~~(aa.r*255),xa=~~(aa.g*255);aa=~~(aa.b*255);var sa=~~(R.r*255),ya=~~(R.g*255);R=~~(R.b*255);ia[0]=Y<0?0:Y>255?255:Y;ia[1]=ga<0?0:ga>255?255:ga;ia[2]=P<0?0:P>255?255:P;ia[4]=na<0?0:na>255?255:na;ia[5]=oa<0?0:oa>255?255:oa;ia[6]=fa<0?0:fa>255?255:fa;ia[8]=pa<0?0:pa>255?255:pa;ia[9]=xa<0?0:xa>255?255:xa;ia[10]=aa<0?0:aa>255?255:aa;ia[12]=sa<0?0:sa>255?255:sa;ia[13]=ya<0?0:ya>255?255:ya;ia[14]=R<0?0:R>255?255:R;$.putImageData(ma,0,0);ta.drawImage(X, -0,0);return qa}function La(P,fa,aa){P=(P-fa)/(aa-fa);return P*P*(3-2*P)}function Ma(P){P=(P+1)*0.5;return P<0?0:P>1?1:P}function Na(P,fa){var aa=fa.x-P.x,R=fa.y-P.y,Y=1/Math.sqrt(aa*aa+R*R);aa*=Y;R*=Y;fa.x+=aa;fa.y+=R;P.x-=aa;P.y-=R}var Ia,Qa,la,wa,Ba,Oa,Ra,Ea;this.autoClear?this.clear():l.setTransform(1,0,0,-1,b,j);d=e.projectScene(ka,ja,this.sortElements);(W=ka.lights.length>0)&&Fa(ka);Ia=0;for(Qa=d.length;Ia0){ca.r+=O.color.r*Z;ca.g+=O.color.g*Z;ca.b+=O.color.b*Z}}else if(O instanceof THREE.PointLight){v.sub(O.position,U.centroidWorld);v.normalize();Z=U.normalWorld.dot(v)*O.intensity;if(Z>0){ca.r+=O.color.r*Z;ca.g+=O.color.g*Z;ca.b+=O.color.b*Z}}}}function c(S,U,ca,da,T,O){z=e(F++);z.setAttribute("d", -"M "+S.positionScreen.x+" "+S.positionScreen.y+" L "+U.positionScreen.x+" "+U.positionScreen.y+" L "+ca.positionScreen.x+","+ca.positionScreen.y+"z");if(T instanceof THREE.MeshBasicMaterial)t.__styleString=T.color.__styleString;else if(T instanceof THREE.MeshLambertMaterial)if(I){k.r=w.r;k.g=w.g;k.b=w.b;a(O,da,k);t.r=T.color.r*k.r;t.g=T.color.g*k.g;t.b=T.color.b*k.b;t.updateStyleString()}else t.__styleString=T.color.__styleString;else if(T instanceof THREE.MeshDepthMaterial){o=1-T.__2near/(T.__farPlusNear- -da.z*T.__farMinusNear);t.setRGB(o,o,o)}else T instanceof THREE.MeshNormalMaterial&&t.setRGB(g(da.normalWorld.x),g(da.normalWorld.y),g(da.normalWorld.z));T.wireframe?z.setAttribute("style","fill: none; stroke: "+t.__styleString+"; stroke-width: "+T.wireframe_linewidth+"; stroke-opacity: "+T.opacity+"; stroke-linecap: "+T.wireframe_linecap+"; stroke-linejoin: "+T.wireframe_linejoin):z.setAttribute("style","fill: "+t.__styleString+"; fill-opacity: "+T.opacity);b.appendChild(z)}function d(S,U,ca,da,T, -O,Z){z=e(F++);z.setAttribute("d","M "+S.positionScreen.x+" "+S.positionScreen.y+" L "+U.positionScreen.x+" "+U.positionScreen.y+" L "+ca.positionScreen.x+","+ca.positionScreen.y+" L "+da.positionScreen.x+","+da.positionScreen.y+"z");if(O instanceof THREE.MeshBasicMaterial)t.__styleString=O.color.__styleString;else if(O instanceof THREE.MeshLambertMaterial)if(I){k.r=w.r;k.g=w.g;k.b=w.b;a(Z,T,k);t.r=O.color.r*k.r;t.g=O.color.g*k.g;t.b=O.color.b*k.b;t.updateStyleString()}else t.__styleString=O.color.__styleString; -else if(O instanceof THREE.MeshDepthMaterial){o=1-O.__2near/(O.__farPlusNear-T.z*O.__farMinusNear);t.setRGB(o,o,o)}else O instanceof THREE.MeshNormalMaterial&&t.setRGB(g(T.normalWorld.x),g(T.normalWorld.y),g(T.normalWorld.z));O.wireframe?z.setAttribute("style","fill: none; stroke: "+t.__styleString+"; stroke-width: "+O.wireframe_linewidth+"; stroke-opacity: "+O.opacity+"; stroke-linecap: "+O.wireframe_linecap+"; stroke-linejoin: "+O.wireframe_linejoin):z.setAttribute("style","fill: "+t.__styleString+ -"; fill-opacity: "+O.opacity);b.appendChild(z)}function e(S){if(D[S]==null){D[S]=document.createElementNS("http://www.w3.org/2000/svg","path");Q==0&&D[S].setAttribute("shape-rendering","crispEdges");return D[S]}return D[S]}function g(S){return S<0?Math.min((1+S)*0.5,0.5):0.5+Math.min(S*0.5,0.5)}var f=null,h=new THREE.Projector,b=document.createElementNS("http://www.w3.org/2000/svg","svg"),j,l,p,A,q,m,B,E,H=new THREE.Rectangle,x=new THREE.Rectangle,I=false,t=new THREE.Color(16777215),k=new THREE.Color(16777215), -w=new THREE.Color(0),u=new THREE.Color(0),n=new THREE.Color(0),o,v=new THREE.Vector3,D=[],y=[],C=[],z,F,J,M,Q=1;this.domElement=b;this.sortElements=this.sortObjects=this.autoClear=true;this.setQuality=function(S){switch(S){case "high":Q=1;break;case "low":Q=0}};this.setSize=function(S,U){j=S;l=U;p=j/2;A=l/2;b.setAttribute("viewBox",-p+" "+-A+" "+j+" "+l);b.setAttribute("width",j);b.setAttribute("height",l);H.set(-p,-A,p,A)};this.clear=function(){for(;b.childNodes.length>0;)b.removeChild(b.childNodes[0])}; -this.render=function(S,U){var ca,da,T,O,Z,V,K,W;this.autoClear&&this.clear();f=h.projectScene(S,U,this.sortElements);M=J=F=0;if(I=S.lights.length>0){K=S.lights;w.setRGB(0,0,0);u.setRGB(0,0,0);n.setRGB(0,0,0);ca=0;for(da=K.length;ca=0&&x>=0&&u>=0&&F>=0)return true;else if(D<0&&x<0||u<0&&F<0)return false;else{if(D<0)z=Math.max(z,D/(D-x));else if(x<0)q=Math.min(q,D/(D-x));if(u<0)z=Math.max(z,u/(u-F));else if(F<0)q=Math.min(q,u/(u-F));if(qD&&G.z0&&H.z<1){w=p[o]=p[o]||new THREE.RenderableParticle;w.x=H.x/H.w;w.y=H.y/H.w;w.z=H.z;w.rotation=O.rotation.z;w.scale.x=O.scale.x*Math.abs(w.x-(H.x+m.projectionMatrix.n11)/ +(H.w+m.projectionMatrix.n14));w.scale.y=O.scale.y*Math.abs(w.y-(H.y+m.projectionMatrix.n22)/(H.w+m.projectionMatrix.n24));w.materials=O.materials;q.push(w);o++}}}}z&&q.sort(a);return q};this.unprojectVector=function(n,m){var z=THREE.Matrix4.makeInvert(m.matrix);z.multiplySelf(THREE.Matrix4.makeInvert(m.projectionMatrix));z.multiplyVector3(n);return n}}; +THREE.DOMRenderer=function(){THREE.Renderer.call(this);var a=null,c=new THREE.Projector,d,e,g,f;this.domElement=document.createElement("div");this.setSize=function(h,b){d=h;e=b;g=d/2;f=e/2};this.render=function(h,b){var j,l,t,A,w,o,p,C;a=c.projectScene(h,b);j=0;for(l=a.length;j0){Q.r+=ma.r*fa;Q.g+=ma.g*fa;Q.b+=ma.b*fa}}else if(fa instanceof THREE.PointLight){N.sub(fa.position,ea);N.normalize();fa= +$.dot(N)*na;if(fa>0){Q.r+=ma.r*fa;Q.g+=ma.g*fa;Q.b+=ma.b*fa}}}}function Ja(P,ea,$){if($.opacity!=0){a($.opacity);c($.blending);var Q,Z,fa,ma,na,pa;if($ instanceof THREE.ParticleBasicMaterial){if($.map&&$.map.image.loaded){ma=$.map.image;na=ma.width>>1;pa=ma.height>>1;Z=ea.scale.x*b;fa=ea.scale.y*j;$=Z*na;Q=fa*pa;M.set(P.x-$,P.y-Q,P.x+$,P.y+Q);if(X.instersects(M)){l.save();l.translate(P.x,P.y);l.rotate(-ea.rotation);l.scale(Z,-fa);l.translate(-na,-pa);l.drawImage(ma,0,0);l.restore()}}}else if($ instanceof +THREE.ParticleCircleMaterial){if(S){aa.r=ja.r+ha.r+E.r;aa.g=ja.g+ha.g+E.g;aa.b=ja.b+ha.b+E.b;q.r=$.color.r*aa.r;q.g=$.color.g*aa.g;q.b=$.color.b*aa.b;q.updateStyleString()}else q.__styleString=$.color.__styleString;$=ea.scale.x*b;Q=ea.scale.y*j;M.set(P.x-$,P.y-Q,P.x+$,P.y+Q);if(X.instersects(M)){Z=q.__styleString;if(C!=Z)l.fillStyle=C=Z;l.save();l.translate(P.x,P.y);l.rotate(-ea.rotation);l.scale($,Q);l.beginPath();l.arc(0,0,1,0,K,true);l.closePath();l.fill();l.restore()}}}}function Ka(P,ea,$,Q){if(Q.opacity!= +0){a(Q.opacity);c(Q.blending);l.beginPath();l.moveTo(P.positionScreen.x,P.positionScreen.y);l.lineTo(ea.positionScreen.x,ea.positionScreen.y);l.closePath();if(Q instanceof THREE.LineBasicMaterial){q.__styleString=Q.color.__styleString;P=Q.linewidth;if(H!=P)l.lineWidth=H=P;P=q.__styleString;if(p!=P)l.strokeStyle=p=P;l.stroke();M.inflate(Q.linewidth*2)}}}function Ga(P,ea,$,Q,Z,fa){if(Z.opacity!=0){a(Z.opacity);c(Z.blending);L=P.positionScreen.x;k=P.positionScreen.y;B=ea.positionScreen.x;n=ea.positionScreen.y; +m=$.positionScreen.x;z=$.positionScreen.y;l.beginPath();l.moveTo(L,k);l.lineTo(B,n);l.lineTo(m,z);l.lineTo(L,k);l.closePath();if(Z instanceof THREE.MeshBasicMaterial)if(Z.map)Z.map.image.loaded&&Z.map.mapping instanceof THREE.UVMapping&&Da(L,k,B,n,m,z,Z.map.image,Q.uvs[0].u,Q.uvs[0].v,Q.uvs[1].u,Q.uvs[1].v,Q.uvs[2].u,Q.uvs[2].v);else if(Z.env_map){if(Z.env_map.image.loaded)if(Z.env_map.mapping instanceof THREE.SphericalReflectionMapping){P=sa.matrix;N.copy(Q.vertexNormalsWorld[0]);U=(N.x*P.n11+N.y* +P.n12+N.z*P.n13)*0.5+0.5;O=-(N.x*P.n21+N.y*P.n22+N.z*P.n23)*0.5+0.5;N.copy(Q.vertexNormalsWorld[1]);ba=(N.x*P.n11+N.y*P.n12+N.z*P.n13)*0.5+0.5;ca=-(N.x*P.n21+N.y*P.n22+N.z*P.n23)*0.5+0.5;N.copy(Q.vertexNormalsWorld[2]);W=(N.x*P.n11+N.y*P.n12+N.z*P.n13)*0.5+0.5;R=-(N.x*P.n21+N.y*P.n22+N.z*P.n23)*0.5+0.5;Da(L,k,B,n,m,z,Z.env_map.image,U,O,ba,ca,W,R)}}else Z.wireframe?qa(Z.color.__styleString,Z.wireframe_linewidth):Ha(Z.color.__styleString);else if(Z instanceof THREE.MeshLambertMaterial){if(Z.map&&!Z.wireframe){Z.map.mapping instanceof +THREE.UVMapping&&Da(L,k,B,n,m,z,Z.map.image,Q.uvs[0].u,Q.uvs[0].v,Q.uvs[1].u,Q.uvs[1].v,Q.uvs[2].u,Q.uvs[2].v);c(THREE.SubtractiveBlending)}if(S)if(!Z.wireframe&&Z.shading==THREE.SmoothShading&&Q.vertexNormalsWorld.length==3){D.r=x.r=u.r=ja.r;D.g=x.g=u.g=ja.g;D.b=x.b=u.b=ja.b;Ba(fa,Q.v1.positionWorld,Q.vertexNormalsWorld[0],D);Ba(fa,Q.v2.positionWorld,Q.vertexNormalsWorld[1],x);Ba(fa,Q.v3.positionWorld,Q.vertexNormalsWorld[2],u);F.r=(x.r+u.r)*0.5;F.g=(x.g+u.g)*0.5;F.b=(x.b+u.b)*0.5;T=Pa(D,x,u,F); +Da(L,k,B,n,m,z,T,0,0,1,0,0,1)}else{aa.r=ja.r;aa.g=ja.g;aa.b=ja.b;Ba(fa,Q.centroidWorld,Q.normalWorld,aa);q.r=Z.color.r*aa.r;q.g=Z.color.g*aa.g;q.b=Z.color.b*aa.b;q.updateStyleString();Z.wireframe?qa(q.__styleString,Z.wireframe_linewidth):Ha(q.__styleString)}else Z.wireframe?qa(Z.color.__styleString,Z.wireframe_linewidth):Ha(Z.color.__styleString)}else if(Z instanceof THREE.MeshDepthMaterial){J=sa.near;G=sa.far;D.r=D.g=D.b=1-La(P.positionScreen.z,J,G);x.r=x.g=x.b=1-La(ea.positionScreen.z,J,G);u.r= +u.g=u.b=1-La($.positionScreen.z,J,G);F.r=(x.r+u.r)*0.5;F.g=(x.g+u.g)*0.5;F.b=(x.b+u.b)*0.5;T=Pa(D,x,u,F);Da(L,k,B,n,m,z,T,0,0,1,0,0,1)}else if(Z instanceof THREE.MeshNormalMaterial){q.r=Ma(Q.normalWorld.x);q.g=Ma(Q.normalWorld.y);q.b=Ma(Q.normalWorld.z);q.updateStyleString();Z.wireframe?qa(q.__styleString,Z.wireframe_linewidth):Ha(q.__styleString)}}}function qa(P,ea){if(p!=P)l.strokeStyle=p=P;if(H!=ea)l.lineWidth=H=ea;l.stroke();M.inflate(ea*2)}function Ha(P){if(C!=P)l.fillStyle=C=P;l.fill()}function Da(P, +ea,$,Q,Z,fa,ma,na,pa,ya,ua,za,Ea){var wa,Aa;wa=ma.width-1;Aa=ma.height-1;na*=wa;pa*=Aa;ya*=wa;ua*=Aa;za*=wa;Ea*=Aa;$-=P;Q-=ea;Z-=P;fa-=ea;ya-=na;ua-=pa;za-=na;Ea-=pa;wa=ya*Ea-za*ua;if(wa!=0){Aa=1/wa;wa=(Ea*$-ua*Z)*Aa;ua=(Ea*Q-ua*fa)*Aa;$=(ya*Z-za*$)*Aa;Q=(ya*fa-za*Q)*Aa;P=P-wa*na-$*pa;ea=ea-ua*na-Q*pa;l.save();l.transform(wa,ua,$,Q,P,ea);l.clip();l.drawImage(ma,0,0);l.restore()}}function Pa(P,ea,$,Q){var Z=~~(P.r*255),fa=~~(P.g*255);P=~~(P.b*255);var ma=~~(ea.r*255),na=~~(ea.g*255);ea=~~(ea.b*255); +var pa=~~($.r*255),ya=~~($.g*255);$=~~($.b*255);var ua=~~(Q.r*255),za=~~(Q.g*255);Q=~~(Q.b*255);ia[0]=Z<0?0:Z>255?255:Z;ia[1]=fa<0?0:fa>255?255:fa;ia[2]=P<0?0:P>255?255:P;ia[4]=ma<0?0:ma>255?255:ma;ia[5]=na<0?0:na>255?255:na;ia[6]=ea<0?0:ea>255?255:ea;ia[8]=pa<0?0:pa>255?255:pa;ia[9]=ya<0?0:ya>255?255:ya;ia[10]=$<0?0:$>255?255:$;ia[12]=ua<0?0:ua>255?255:ua;ia[13]=za<0?0:za>255?255:za;ia[14]=Q<0?0:Q>255?255:Q;da.putImageData(ga,0,0);ra.drawImage(V,0,0);return ta}function La(P,ea,$){P=(P-ea)/($-ea); +return P*P*(3-2*P)}function Ma(P){P=(P+1)*0.5;return P<0?0:P>1?1:P}function Na(P,ea){var $=ea.x-P.x,Q=ea.y-P.y,Z=1/Math.sqrt($*$+Q*Q);$*=Z;Q*=Z;ea.x+=$;ea.y+=Q;P.x-=$;P.y-=Q}var Ia,Qa,la,xa,Ca,Oa,Ra,Fa;this.autoClear?this.clear():l.setTransform(1,0,0,-1,b,j);d=e.projectScene(ka,sa,this.sortElements);(S=ka.lights.length>0)&&oa(ka);Ia=0;for(Qa=d.length;Ia0){ba.r+=R.color.r*X;ba.g+=R.color.g*X;ba.b+=R.color.b*X}}else if(R instanceof THREE.PointLight){z.sub(R.position,O.centroidWorld);z.normalize();X=O.normalWorld.dot(z)*R.intensity;if(X>0){ba.r+=R.color.r*X;ba.g+=R.color.g*X;ba.b+=R.color.b*X}}}}function c(U,O,ba,ca,W,R){u=e(F++);u.setAttribute("d", +"M "+U.positionScreen.x+" "+U.positionScreen.y+" L "+O.positionScreen.x+" "+O.positionScreen.y+" L "+ba.positionScreen.x+","+ba.positionScreen.y+"z");if(W instanceof THREE.MeshBasicMaterial)v.__styleString=W.color.__styleString;else if(W instanceof THREE.MeshLambertMaterial)if(I){L.r=k.r;L.g=k.g;L.b=k.b;a(R,ca,L);v.r=W.color.r*L.r;v.g=W.color.g*L.g;v.b=W.color.b*L.b;v.updateStyleString()}else v.__styleString=W.color.__styleString;else if(W instanceof THREE.MeshDepthMaterial){m=1-W.__2near/(W.__farPlusNear- +ca.z*W.__farMinusNear);v.setRGB(m,m,m)}else W instanceof THREE.MeshNormalMaterial&&v.setRGB(g(ca.normalWorld.x),g(ca.normalWorld.y),g(ca.normalWorld.z));W.wireframe?u.setAttribute("style","fill: none; stroke: "+v.__styleString+"; stroke-width: "+W.wireframe_linewidth+"; stroke-opacity: "+W.opacity+"; stroke-linecap: "+W.wireframe_linecap+"; stroke-linejoin: "+W.wireframe_linejoin):u.setAttribute("style","fill: "+v.__styleString+"; fill-opacity: "+W.opacity);b.appendChild(u)}function d(U,O,ba,ca,W, +R,X){u=e(F++);u.setAttribute("d","M "+U.positionScreen.x+" "+U.positionScreen.y+" L "+O.positionScreen.x+" "+O.positionScreen.y+" L "+ba.positionScreen.x+","+ba.positionScreen.y+" L "+ca.positionScreen.x+","+ca.positionScreen.y+"z");if(R instanceof THREE.MeshBasicMaterial)v.__styleString=R.color.__styleString;else if(R instanceof THREE.MeshLambertMaterial)if(I){L.r=k.r;L.g=k.g;L.b=k.b;a(X,W,L);v.r=R.color.r*L.r;v.g=R.color.g*L.g;v.b=R.color.b*L.b;v.updateStyleString()}else v.__styleString=R.color.__styleString; +else if(R instanceof THREE.MeshDepthMaterial){m=1-R.__2near/(R.__farPlusNear-W.z*R.__farMinusNear);v.setRGB(m,m,m)}else R instanceof THREE.MeshNormalMaterial&&v.setRGB(g(W.normalWorld.x),g(W.normalWorld.y),g(W.normalWorld.z));R.wireframe?u.setAttribute("style","fill: none; stroke: "+v.__styleString+"; stroke-width: "+R.wireframe_linewidth+"; stroke-opacity: "+R.opacity+"; stroke-linecap: "+R.wireframe_linecap+"; stroke-linejoin: "+R.wireframe_linejoin):u.setAttribute("style","fill: "+v.__styleString+ +"; fill-opacity: "+R.opacity);b.appendChild(u)}function e(U){if(q[U]==null){q[U]=document.createElementNS("http://www.w3.org/2000/svg","path");T==0&&q[U].setAttribute("shape-rendering","crispEdges");return q[U]}return q[U]}function g(U){return U<0?Math.min((1+U)*0.5,0.5):0.5+Math.min(U*0.5,0.5)}var f=null,h=new THREE.Projector,b=document.createElementNS("http://www.w3.org/2000/svg","svg"),j,l,t,A,w,o,p,C,H=new THREE.Rectangle,y=new THREE.Rectangle,I=false,v=new THREE.Color(16777215),L=new THREE.Color(16777215), +k=new THREE.Color(0),B=new THREE.Color(0),n=new THREE.Color(0),m,z=new THREE.Vector3,q=[],D=[],x=[],u,F,J,G,T=1;this.domElement=b;this.sortElements=this.sortObjects=this.autoClear=true;this.setQuality=function(U){switch(U){case "high":T=1;break;case "low":T=0}};this.setSize=function(U,O){j=U;l=O;t=j/2;A=l/2;b.setAttribute("viewBox",-t+" "+-A+" "+j+" "+l);b.setAttribute("width",j);b.setAttribute("height",l);H.set(-t,-A,t,A)};this.clear=function(){for(;b.childNodes.length>0;)b.removeChild(b.childNodes[0])}; +this.render=function(U,O){var ba,ca,W,R,X,Y,M,S;this.autoClear&&this.clear();f=h.projectScene(U,O,this.sortElements);G=J=F=0;if(I=U.lights.length>0){M=U.lights;k.setRGB(0,0,0);B.setRGB(0,0,0);n.setRGB(0,0,0);ba=0;for(ca=M.length;ba0){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLUVBuffer);b.bufferData(b.ARRAY_BUFFER,W,u)}if(qa&&ca>0){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLUV2Buffer);b.bufferData(b.ARRAY_BUFFER,ba,u)}if(ia){b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,k.__webGLFaceBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER, -N,u);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,k.__webGLLineBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,L,u)}};this.setLineBuffers=function(k,w){var u,n,o,v=k.vertices,D=k.colors,y=v.length,C=D.length,z=k.__vertexArray,F=k.__colorArray,J=k.__dirtyColors;if(k.__dirtyVertices){for(u=0;u0?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+v.maxDirLights,"#define MAX_POINT_LIGHTS "+v.maxPointLights,v.map?"#define USE_MAP":"",v.env_map?"#define USE_ENVMAP": -"",v.light_map?"#define USE_LIGHTMAP":"",v.vertex_colors?"#define USE_COLOR":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\n"].join("\n");b.attachShader(u,g("fragment",o+C));b.attachShader(u,g("vertex",v+w));b.linkProgram(u);b.getProgramParameter(u,b.LINK_STATUS)|| -alert("Could not initialise shaders\nVALIDATE_STATUS: "+b.getProgramParameter(u,b.VALIDATE_STATUS)+", gl error ["+b.getError()+"]");u.uniforms={};u.attributes={};k.program=u;u=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition"];for(n in k.uniforms)u.push(n);n=k.program;C=0;for(w=u.length;C=0){b.bindBuffer(b.ARRAY_BUFFER,o.__webGLColorBuffer);b.vertexAttribPointer(k.color,3,b.FLOAT,false,0,0);b.enableVertexAttribArray(k.color)}if(k.normal>=0){b.bindBuffer(b.ARRAY_BUFFER,o.__webGLNormalBuffer);b.vertexAttribPointer(k.normal,3,b.FLOAT, -false,0,0);b.enableVertexAttribArray(k.normal)}if(k.tangent>=0){b.bindBuffer(b.ARRAY_BUFFER,o.__webGLTangentBuffer);b.vertexAttribPointer(k.tangent,4,b.FLOAT,false,0,0);b.enableVertexAttribArray(k.tangent)}if(k.uv>=0)if(o.__webGLUVBuffer){b.bindBuffer(b.ARRAY_BUFFER,o.__webGLUVBuffer);b.vertexAttribPointer(k.uv,2,b.FLOAT,false,0,0);b.enableVertexAttribArray(k.uv)}else b.disableVertexAttribArray(k.uv);if(k.uv2>=0)if(o.__webGLUV2Buffer){b.bindBuffer(b.ARRAY_BUFFER,o.__webGLUV2Buffer);b.vertexAttribPointer(k.uv2, -2,b.FLOAT,false,0,0);b.enableVertexAttribArray(k.uv2)}else b.disableVertexAttribArray(k.uv2);if(v instanceof THREE.Mesh)if(n.wireframe){b.lineWidth(n.wireframe_linewidth);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,o.__webGLLineBuffer);b.drawElements(b.LINES,o.__webGLLineCount,b.UNSIGNED_SHORT,0)}else{b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,o.__webGLFaceBuffer);b.drawElements(b.TRIANGLES,o.__webGLFaceCount,b.UNSIGNED_SHORT,0)}else if(v instanceof THREE.Line){v=v.type==THREE.LineStrip?b.LINE_STRIP:b.LINES;b.lineWidth(n.linewidth); -b.drawArrays(v,0,o.__webGLLineCount)}else v instanceof THREE.ParticleSystem&&b.drawArrays(b.POINTS,0,o.__webGLParticleCount)};this.renderPass=function(k,w,u,n,o,v,D){var y,C,z,F,J;z=0;for(F=n.materials.length;z=0;u--){n=k.__webGLObjects[u].object; -w==n&&k.__webGLObjects.splice(u,1)}};this.setupMatrices=function(k,w){k._modelViewMatrix.multiplyToArray(w.matrix,k.matrix,k._modelViewMatrixArray);k._normalMatrix=THREE.Matrix4.makeInvert3x3(k._modelViewMatrix).transposeIntoArray(k._normalMatrixArray)};this.setDepthTest=function(k){k?b.enable(b.DEPTH_TEST):b.disable(b.DEPTH_TEST)};this.setFaceCulling=function(k,w){if(k){!w||w=="ccw"?b.frontFace(b.CCW):b.frontFace(b.CW);if(k=="back")b.cullFace(b.BACK);else k=="front"?b.cullFace(b.FRONT):b.cullFace(b.FRONT_AND_BACK); +b,j=null,l=null,t=null,A=null,w=null,o=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],p=new THREE.Matrix4,C=new Float32Array(16),H=new Float32Array(16),y=new THREE.Vector4,I=true,v=new THREE.Color(0),L=0;if(a){if(a.antialias!==undefined)I=a.antialias;a.clearColor!==undefined&&v.setHex(a.clearColor);if(a.clearAlpha!==undefined)L=a.clearAlpha}this.domElement=h;this.autoClear=true;(function(k,B,n){try{b=h.getContext("experimental-webgl", +{antialias:k})}catch(m){console.log(m)}if(!b){alert("WebGL not supported");throw"cannot create webgl context";}b.clearColor(0,0,0,1);b.clearDepth(1);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.enable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.ONE,b.ONE_MINUS_SRC_ALPHA);b.clearColor(B.r,B.g,B.b,n);_cullEnabled=true})(I,v,L);this.context=b;this.lights={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[]}};this.setSize= +function(k,B){h.width=k;h.height=B;b.viewport(0,0,h.width,h.height)};this.setClearColorHex=function(k,B){var n=new THREE.Color(k);b.clearColor(n.r,n.g,n.b,B)};this.setClearColor=function(k,B){b.clearColor(k.r,k.g,k.b,B)};this.clear=function(){b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)};this.setupLights=function(k,B){var n,m,z,q=0,D=0,x=0,u,F,J,G=this.lights,T=G.directional.colors,U=G.directional.positions,O=G.point.colors,ba=G.point.positions,ca=0,W=0;n=z=z=0;for(m=B.length;n0){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLUVBuffer);b.bufferData(b.ARRAY_BUFFER,aa,n)}if(ra&&ca>0){b.bindBuffer(b.ARRAY_BUFFER,k.__webGLUV2Buffer);b.bufferData(b.ARRAY_BUFFER, +ja,n)}if(ta){b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,k.__webGLFaceBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,N,n);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,k.__webGLLineBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,V,n)}};this.setLineBuffers=function(k,B){var n,m,z,q=k.vertices,D=k.colors,x=q.length,u=D.length,F=k.__vertexArray,J=k.__colorArray,G=k.__dirtyColors;if(k.__dirtyVertices){for(n=0;n0?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+q.maxDirLights,"#define MAX_POINT_LIGHTS "+ +q.maxPointLights,q.map?"#define USE_MAP":"",q.env_map?"#define USE_ENVMAP":"",q.light_map?"#define USE_LIGHTMAP":"",q.vertex_colors?"#define USE_COLOR":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\n"].join("\n");b.attachShader(n,g("fragment",z+u));b.attachShader(n, +g("vertex",q+B));b.linkProgram(n);b.getProgramParameter(n,b.LINK_STATUS)||alert("Could not initialise shaders\nVALIDATE_STATUS: "+b.getProgramParameter(n,b.VALIDATE_STATUS)+", gl error ["+b.getError()+"]");n.uniforms={};n.attributes={};k.program=n;n=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition"];for(m in k.uniforms)n.push(m);m=k.program;u=0;for(B=n.length;u=0){b.bindBuffer(b.ARRAY_BUFFER,z.__webGLColorBuffer);b.vertexAttribPointer(k.color,3,b.FLOAT,false,0,0);b.enableVertexAttribArray(k.color)}if(k.normal>=0){b.bindBuffer(b.ARRAY_BUFFER,z.__webGLNormalBuffer);b.vertexAttribPointer(k.normal,3,b.FLOAT, +false,0,0);b.enableVertexAttribArray(k.normal)}if(k.tangent>=0){b.bindBuffer(b.ARRAY_BUFFER,z.__webGLTangentBuffer);b.vertexAttribPointer(k.tangent,4,b.FLOAT,false,0,0);b.enableVertexAttribArray(k.tangent)}if(k.uv>=0)if(z.__webGLUVBuffer){b.bindBuffer(b.ARRAY_BUFFER,z.__webGLUVBuffer);b.vertexAttribPointer(k.uv,2,b.FLOAT,false,0,0);b.enableVertexAttribArray(k.uv)}else b.disableVertexAttribArray(k.uv);if(k.uv2>=0)if(z.__webGLUV2Buffer){b.bindBuffer(b.ARRAY_BUFFER,z.__webGLUV2Buffer);b.vertexAttribPointer(k.uv2, +2,b.FLOAT,false,0,0);b.enableVertexAttribArray(k.uv2)}else b.disableVertexAttribArray(k.uv2);if(q instanceof THREE.Mesh)if(m.wireframe){b.lineWidth(m.wireframe_linewidth);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,z.__webGLLineBuffer);b.drawElements(b.LINES,z.__webGLLineCount,b.UNSIGNED_SHORT,0)}else{b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,z.__webGLFaceBuffer);b.drawElements(b.TRIANGLES,z.__webGLFaceCount,b.UNSIGNED_SHORT,0)}else if(q instanceof THREE.Line){q=q.type==THREE.LineStrip?b.LINE_STRIP:b.LINES;b.lineWidth(m.linewidth); +b.drawArrays(q,0,z.__webGLLineCount)}else q instanceof THREE.ParticleSystem&&b.drawArrays(b.POINTS,0,z.__webGLParticleCount)};this.renderPass=function(k,B,n,m,z,q,D){var x,u,F,J,G;F=0;for(J=m.materials.length;F=0;n--){m=k.__webGLObjects[n].object; +B==m&&k.__webGLObjects.splice(n,1)}};this.setupMatrices=function(k,B){k._modelViewMatrix.multiplyToArray(B.matrix,k.matrix,k._modelViewMatrixArray);k._normalMatrix=THREE.Matrix4.makeInvert3x3(k._modelViewMatrix).transposeIntoArray(k._normalMatrixArray)};this.setDepthTest=function(k){k?b.enable(b.DEPTH_TEST):b.disable(b.DEPTH_TEST)};this.setFaceCulling=function(k,B){if(k){!B||B=="ccw"?b.frontFace(b.CCW):b.frontFace(b.CW);if(k=="back")b.cullFace(b.BACK);else k=="front"?b.cullFace(b.FRONT):b.cullFace(b.FRONT_AND_BACK); b.enable(b.CULL_FACE)}else b.disable(b.CULL_FACE)};this.supportsVertexTextures=function(){return b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0}}; THREE.Snippets={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube env_map;\nuniform int combine;\n#endif", envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( env_map, vec3( -vReflect.x, vReflect.yz ) );\nif ( combine == 1 ) {\ngl_FragColor = vec4( mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity ), opacity );\n} else {\ngl_FragColor = gl_FragColor * cubeColor;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refraction_ratio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refraction_ratio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif", @@ -229,17 +229,17 @@ THREE.RenderableFace3=function(){this.z=null;this.v1=new THREE.Vertex;this.v2=ne THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.Vertex;this.v2=new THREE.Vertex;this.materials=null}; THREE.Detector={canvas:!!document.createElement("canvas").getContext,webgl:window.Uint8Array!=undefined,workers:!!window.Worker,addGetWebGLMessage:function(a){var c=document.body,d="oldie";if(a){if(a.parent!==undefined)c=a.parent;if(a.id!==undefined)d=a.id}a=document.createElement("center");var e=document.createElement("div");e.innerHTML='Sorry, your browser doesn\'t support WebGL
\n
\nPlease try in\nChrome 9+ /\nFirefox 4+ /\nSafari OSX 10.6+';e.id= d;d=e.style;d.fontFamily="monospace";d.fontSize="13px";d.textAlign="center";d.background="#eee";d.color="#000";d.padding="1em";d.width="475px";d.margin="5em auto 0";a.appendChild(e);c.appendChild(a);return e}}; -var GeometryUtils={merge:function(a,c){var d=c instanceof THREE.Mesh,e=a.vertices.length,g=d?c.geometry:c,f=a.vertices,h=g.vertices,b=a.faces,j=g.faces,l=a.uvs;g=g.uvs;d&&c.autoUpdateMatrix&&c.updateMatrix();for(var p=0,A=h.length;p25)f=25;g=(f-1)*0.5;d=Array(f);for(c=e=0;c25)f=25;g=(f-1)*0.5;d=Array(f);for(c=e=0;c0||(p=this.vertices.push(new THREE.Vertex(new THREE.Vector3(A,b,q)))-1);l.push(p)}c.push(l)}var m,B,E;g=c.length;for(d=0;d0)for(e=0;e1){m=this.vertices[h].position.clone(); -B=this.vertices[j].position.clone();E=this.vertices[l].position.clone();m.normalize();B.normalize();E.normalize();this.faces.push(new THREE.Face3(h,j,l,[new THREE.Vector3(m.x,m.y,m.z),new THREE.Vector3(B.x,B.y,B.z),new THREE.Vector3(E.x,E.y,E.z)]));this.uvs.push([p,A,H])}}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.sortFacesByMaterial();this.boundingSphere={radius:a}};Sphere.prototype=new THREE.Geometry;Sphere.prototype.constructor=Sphere; +var Sphere=function(a,c,d){THREE.Geometry.call(this);var e,g=Math.PI,f=Math.max(3,c||8),h=Math.max(2,d||6);c=[];for(d=0;d0||(t=this.vertices.push(new THREE.Vertex(new THREE.Vector3(A,b,w)))-1);l.push(t)}c.push(l)}var o,p,C;g=c.length;for(d=0;d0)for(e=0;e1){o=this.vertices[h].position.clone(); +p=this.vertices[j].position.clone();C=this.vertices[l].position.clone();o.normalize();p.normalize();C.normalize();this.faces.push(new THREE.Face3(h,j,l,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(p.x,p.y,p.z),new THREE.Vector3(C.x,C.y,C.z)]));this.uvs.push([t,A,H])}}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.sortFacesByMaterial();this.boundingSphere={radius:a}};Sphere.prototype=new THREE.Geometry;Sphere.prototype.constructor=Sphere; var Torus=function(a,c,d,e){this.radius=a||100;this.tube=c||40;this.segmentsR=d||8;this.segmentsT=e||6;a=[];THREE.Geometry.call(this);for(c=0;c<=this.segmentsR;++c)for(d=0;d<=this.segmentsT;++d){e=d/this.segmentsT*2*Math.PI;var g=c/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(g))*Math.cos(e),(this.radius+this.tube*Math.cos(g))*Math.sin(e),this.tube*Math.sin(g))));a.push([d/this.segmentsT,1-c/this.segmentsR])}for(c=1;c<=this.segmentsR;++c)for(d= 1;d<=this.segmentsT;++d){e=(this.segmentsT+1)*c+d;g=(this.segmentsT+1)*c+d-1;var f=(this.segmentsT+1)*(c-1)+d-1,h=(this.segmentsT+1)*(c-1)+d;this.faces.push(new THREE.Face4(e,g,f,h));this.uvs.push([new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[g][0],a[g][1]),new THREE.UV(a[f][0],a[f][1]),new THREE.UV(a[h][0],a[h][1])])}delete a;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.sortFacesByMaterial()};Torus.prototype=new THREE.Geometry;Torus.prototype.constructor=Torus; -var Icosahedron=function(a){function c(A,q,m){var B=Math.sqrt(A*A+q*q+m*m);return g.vertices.push(new THREE.Vertex(new THREE.Vector3(A/B,q/B,m/B)))-1}function d(A,q,m,B){B.faces.push(new THREE.Face3(A,q,m))}function e(A,q){var m=g.vertices[A].position,B=g.vertices[q].position;return c((m.x+B.x)/2,(m.y+B.y)/2,(m.z+B.z)/2)}var g=this,f=new THREE.Geometry,h;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;c(-1,a,0);c(1,a,0);c(-1,-a,0);c(1,-a,0);c(0,-1,a);c(0,1,a);c(0,-1,-a);c(0, -1,-a);c(a,0,-1);c(a,0,1);c(-a,0,-1);c(-a,0,1);d(0,11,5,f);d(0,5,1,f);d(0,1,7,f);d(0,7,10,f);d(0,10,11,f);d(1,5,9,f);d(5,11,4,f);d(11,10,2,f);d(10,7,6,f);d(7,1,8,f);d(3,9,4,f);d(3,4,2,f);d(3,2,6,f);d(3,6,8,f);d(3,8,9,f);d(4,9,5,f);d(2,4,11,f);d(6,2,10,f);d(8,6,7,f);d(9,8,1,f);for(a=0;a=this.maxCount-3&&b(this)};this.begin= -function(){this.count=0;this.hasNormal=this.hasPos=false};this.end=function(d){if(this.count!=0){for(var e=this.count*3;ethis.size-1)j=this.size-1;var q=Math.floor(l-b);if(q<1)q=1;l=Math.floor(l+b);if(l>this.size-1)l=this.size-1;var m=Math.floor(p-b);if(m<1)m=1;b=Math.floor(p+b); -if(b>this.size-1)b=this.size-1;var B,E,H,x,I,t;for(A=A;A0)this.field[H+B]+=x}}}};this.addPlaneX=function(d,e){var g,f,h,b,j,l=this.size,p=this.yd,A=this.zd,q=this.field,m=l*Math.sqrt(d/e);if(m>l)m=l;for(g=0;g0)for(f=0;fp)B=p;for(f=0;f0){j=f*A;for(g=0;gsize)dist=size;for(h=0;h0){j=zd*h;for(f=0;fthis.size-1)j=this.size-1;var w=Math.floor(l-b);if(w<1)w=1;l=Math.floor(l+b);if(l>this.size-1)l=this.size-1;var o=Math.floor(t-b);if(o<1)o=1;b=Math.floor(t+b); +if(b>this.size-1)b=this.size-1;var p,C,H,y,I,v;for(A=A;A0)this.field[H+p]+=y}}}};this.addPlaneX=function(d,e){var g,f,h,b,j,l=this.size,t=this.yd,A=this.zd,w=this.field,o=l*Math.sqrt(d/e);if(o>l)o=l;for(g=0;g0)for(f=0;ft)p=t;for(f=0;f0){j=f*A;for(g=0;gsize)dist=size;for(h=0;h0){j=zd*h;for(f=0;f>7)-127;L=($&127)<<16|X<<8|L;if(L==0&&ia==-127)return 0;return(1-2*(ma>>7))*(1+L*Math.pow(2,-23))*Math.pow(2,ia)}function b(G,N){var L=p(G,N),X=p(G,N+1),$=p(G,N+2);return(p(G,N+3)<<24)+($<<16)+(X<<8)+L}function j(G,N){var L=p(G,N);return(p(G,N+1)<<8)+L}function l(G,N){var L=p(G,N);return L>127?L-256:L}function p(G,N){return G.charCodeAt(N)&255}function A(G){var N,L,X;N= -b(a,G);L=b(a,G+u);X=b(a,G+n);G=j(a,G+o);THREE.Loader.prototype.f3(x,N,L,X,G)}function q(G){var N,L,X,$,ma,ia;N=b(a,G);L=b(a,G+u);X=b(a,G+n);$=j(a,G+o);ma=b(a,G+v);ia=b(a,G+D);G=b(a,G+y);THREE.Loader.prototype.f3n(x,k,N,L,X,$,ma,ia,G)}function m(G){var N,L,X,$;N=b(a,G);L=b(a,G+C);X=b(a,G+z);$=b(a,G+F);G=j(a,G+J);THREE.Loader.prototype.f4(x,N,L,X,$,G)}function B(G){var N,L,X,$,ma,ia,qa,ta;N=b(a,G);L=b(a,G+C);X=b(a,G+z);$=b(a,G+F);ma=j(a,G+J);ia=b(a,G+M);qa=b(a,G+Q);ta=b(a,G+S);G=b(a,G+U);THREE.Loader.prototype.f4n(x, -k,N,L,X,$,ma,ia,qa,ta,G)}function E(G){var N,L;N=b(a,G);L=b(a,G+ca);G=b(a,G+da);THREE.Loader.prototype.uv3(x.uvs,w[N*2],w[N*2+1],w[L*2],w[L*2+1],w[G*2],w[G*2+1])}function H(G){var N,L,X;N=b(a,G);L=b(a,G+T);X=b(a,G+O);G=b(a,G+Z);THREE.Loader.prototype.uv4(x.uvs,w[N*2],w[N*2+1],w[L*2],w[L*2+1],w[X*2],w[X*2+1],w[G*2],w[G*2+1])}var x=this,I=0,t,k=[],w=[],u,n,o,v,D,y,C,z,F,J,M,Q,S,U,ca,da,T,O,Z,V,K,W,ba,ha,ea;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(x,e,f);t={signature:a.substr(I, -8),header_bytes:p(a,I+8),vertex_coordinate_bytes:p(a,I+9),normal_coordinate_bytes:p(a,I+10),uv_coordinate_bytes:p(a,I+11),vertex_index_bytes:p(a,I+12),normal_index_bytes:p(a,I+13),uv_index_bytes:p(a,I+14),material_index_bytes:p(a,I+15),nvertices:b(a,I+16),nnormals:b(a,I+16+4),nuvs:b(a,I+16+8),ntri_flat:b(a,I+16+12),ntri_smooth:b(a,I+16+16),ntri_flat_uv:b(a,I+16+20),ntri_smooth_uv:b(a,I+16+24),nquad_flat:b(a,I+16+28),nquad_smooth:b(a,I+16+32),nquad_flat_uv:b(a,I+16+36),nquad_smooth_uv:b(a,I+16+40)}; -I+=t.header_bytes;u=t.vertex_index_bytes;n=t.vertex_index_bytes*2;o=t.vertex_index_bytes*3;v=t.vertex_index_bytes*3+t.material_index_bytes;D=t.vertex_index_bytes*3+t.material_index_bytes+t.normal_index_bytes;y=t.vertex_index_bytes*3+t.material_index_bytes+t.normal_index_bytes*2;C=t.vertex_index_bytes;z=t.vertex_index_bytes*2;F=t.vertex_index_bytes*3;J=t.vertex_index_bytes*4;M=t.vertex_index_bytes*4+t.material_index_bytes;Q=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes;S=t.vertex_index_bytes* -4+t.material_index_bytes+t.normal_index_bytes*2;U=t.vertex_index_bytes*4+t.material_index_bytes+t.normal_index_bytes*3;ca=t.uv_index_bytes;da=t.uv_index_bytes*2;T=t.uv_index_bytes;O=t.uv_index_bytes*2;Z=t.uv_index_bytes*3;f=t.vertex_index_bytes*3+t.material_index_bytes;ea=t.vertex_index_bytes*4+t.material_index_bytes;V=t.ntri_flat*f;K=t.ntri_smooth*(f+t.normal_index_bytes*3);W=t.ntri_flat_uv*(f+t.uv_index_bytes*3);ba=t.ntri_smooth_uv*(f+t.normal_index_bytes*3+t.uv_index_bytes*3);ha=t.nquad_flat*ea; -f=t.nquad_smooth*(ea+t.normal_index_bytes*4);ea=t.nquad_flat_uv*(ea+t.uv_index_bytes*4);I+=function(G){var N,L,X,$=t.vertex_coordinate_bytes*3,ma=G+t.nvertices*$;for(G=G;G>7)-127;N=(da&127)<<16|V<<8|N;if(N==0&&ia==-127)return 0;return(1-2*(ga>>7))*(1+N*Math.pow(2,-23))*Math.pow(2,ia)}function b(E,K){var N=t(E,K),V=t(E,K+1),da=t(E,K+2);return(t(E,K+3)<<24)+(da<<16)+(V<<8)+N}function j(E,K){var N=t(E,K);return(t(E,K+1)<<8)+N}function l(E,K){var N=t(E,K);return N>127?N-256:N}function t(E,K){return E.charCodeAt(K)&255}function A(E){var K, +N,V;K=b(a,E);N=b(a,E+B);V=b(a,E+n);E=j(a,E+m);THREE.Loader.prototype.f3(y,K,N,V,E)}function w(E){var K,N,V,da,ga,ia;K=b(a,E);N=b(a,E+B);V=b(a,E+n);da=j(a,E+m);ga=b(a,E+z);ia=b(a,E+q);E=b(a,E+D);THREE.Loader.prototype.f3n(y,L,K,N,V,da,ga,ia,E)}function o(E){var K,N,V,da;K=b(a,E);N=b(a,E+x);V=b(a,E+u);da=b(a,E+F);E=j(a,E+J);THREE.Loader.prototype.f4(y,K,N,V,da,E)}function p(E){var K,N,V,da,ga,ia,ta,ra;K=b(a,E);N=b(a,E+x);V=b(a,E+u);da=b(a,E+F);ga=j(a,E+J);ia=b(a,E+G);ta=b(a,E+T);ra=b(a,E+U);E=b(a,E+ +O);THREE.Loader.prototype.f4n(y,L,K,N,V,da,ga,ia,ta,ra,E)}function C(E){var K,N;K=b(a,E);N=b(a,E+ba);E=b(a,E+ca);THREE.Loader.prototype.uv3(y.uvs,k[K*2],k[K*2+1],k[N*2],k[N*2+1],k[E*2],k[E*2+1])}function H(E){var K,N,V;K=b(a,E);N=b(a,E+W);V=b(a,E+R);E=b(a,E+X);THREE.Loader.prototype.uv4(y.uvs,k[K*2],k[K*2+1],k[N*2],k[N*2+1],k[V*2],k[V*2+1],k[E*2],k[E*2+1])}var y=this,I=0,v,L=[],k=[],B,n,m,z,q,D,x,u,F,J,G,T,U,O,ba,ca,W,R,X,Y,M,S,aa,ja,ha;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(y, +e,f);v={signature:a.substr(I,8),header_bytes:t(a,I+8),vertex_coordinate_bytes:t(a,I+9),normal_coordinate_bytes:t(a,I+10),uv_coordinate_bytes:t(a,I+11),vertex_index_bytes:t(a,I+12),normal_index_bytes:t(a,I+13),uv_index_bytes:t(a,I+14),material_index_bytes:t(a,I+15),nvertices:b(a,I+16),nnormals:b(a,I+16+4),nuvs:b(a,I+16+8),ntri_flat:b(a,I+16+12),ntri_smooth:b(a,I+16+16),ntri_flat_uv:b(a,I+16+20),ntri_smooth_uv:b(a,I+16+24),nquad_flat:b(a,I+16+28),nquad_smooth:b(a,I+16+32),nquad_flat_uv:b(a,I+16+36), +nquad_smooth_uv:b(a,I+16+40)};I+=v.header_bytes;B=v.vertex_index_bytes;n=v.vertex_index_bytes*2;m=v.vertex_index_bytes*3;z=v.vertex_index_bytes*3+v.material_index_bytes;q=v.vertex_index_bytes*3+v.material_index_bytes+v.normal_index_bytes;D=v.vertex_index_bytes*3+v.material_index_bytes+v.normal_index_bytes*2;x=v.vertex_index_bytes;u=v.vertex_index_bytes*2;F=v.vertex_index_bytes*3;J=v.vertex_index_bytes*4;G=v.vertex_index_bytes*4+v.material_index_bytes;T=v.vertex_index_bytes*4+v.material_index_bytes+ +v.normal_index_bytes;U=v.vertex_index_bytes*4+v.material_index_bytes+v.normal_index_bytes*2;O=v.vertex_index_bytes*4+v.material_index_bytes+v.normal_index_bytes*3;ba=v.uv_index_bytes;ca=v.uv_index_bytes*2;W=v.uv_index_bytes;R=v.uv_index_bytes*2;X=v.uv_index_bytes*3;f=v.vertex_index_bytes*3+v.material_index_bytes;ha=v.vertex_index_bytes*4+v.material_index_bytes;Y=v.ntri_flat*f;M=v.ntri_smooth*(f+v.normal_index_bytes*3);S=v.ntri_flat_uv*(f+v.uv_index_bytes*3);aa=v.ntri_smooth_uv*(f+v.normal_index_bytes* +3+v.uv_index_bytes*3);ja=v.nquad_flat*ha;f=v.nquad_smooth*(ha+v.normal_index_bytes*4);ha=v.nquad_flat_uv*(ha+v.uv_index_bytes*4);I+=function(E){var K,N,V,da=v.vertex_coordinate_bytes*3,ga=E+v.nvertices*da;for(E=E;E + + + three.js - io - blender - vertex colors - webgl + + + + + +
+
three.js - vertex colors - blender export - webgl
+ + + + + + + + diff --git a/examples/obj/cubecolors/.htaccess b/examples/obj/cubecolors/.htaccess new file mode 100644 index 00000000..746a0633 --- /dev/null +++ b/examples/obj/cubecolors/.htaccess @@ -0,0 +1,7 @@ + +SetOutputFilter DEFLATE + + + +SetOutputFilter DEFLATE + diff --git a/examples/obj/cubecolors/cubecolors.blend b/examples/obj/cubecolors/cubecolors.blend new file mode 100644 index 00000000..c46e779c Binary files /dev/null and b/examples/obj/cubecolors/cubecolors.blend differ diff --git a/examples/obj/cubecolors/cubecolors.js b/examples/obj/cubecolors/cubecolors.js new file mode 100644 index 00000000..fb737831 --- /dev/null +++ b/examples/obj/cubecolors/cubecolors.js @@ -0,0 +1,48 @@ +/* + * File generated with Blender 2.55 Exporter + * https://github.com/mrdoob/three.js/tree/master/utils/exporters/blender/ + * + * vertices: 1538 + * faces: 1536 + * materials: 0 + * + */ + +var model = { + + 'materials': [ { + "a_dbg_color" : 0xeeeeee, + "a_dbg_index" : 0, + "a_dbg_name" : "Material", + "col_ambient" : [0.0, 0.0, 0.0], + "col_diffuse" : [1.0, 1.0, 1.0], + "col_specular" : [0.0, 0.0, 0.0], + "shading" : "Lambert", + "specular_coef" : 50, + "transparency" : 1.0, + "vertex_colors" : true + }], + + 'normals': [0.000000,-1.000000,0.000000,0.707083,-0.707083,0.000000,0.000000,-0.707083,-0.707083,0.577349,-0.577349,-0.577349,0.000000,-0.707083,0.707083,0.577349,-0.577349,0.577349,-0.707083,-0.707083,0.000000,-0.577349,-0.577349,0.577349,-0.577349,-0.577349,-0.577349,0.000000,1.000000,0.000000,0.000000,0.707083,-0.707083,0.707083,0.707083,0.000000,0.577349,0.577349,-0.577349,-0.707083,0.707083,0.000000,-0.577349,0.577349,-0.577349,0.000000,0.707083,0.707083,-0.577349,0.577349,0.577349,0.577349,0.577349,0.577349,1.000000,0.000000,0.000000,0.707083,0.000000,-0.707083,0.707083,0.000000,0.707083,0.000000,0.000000,1.000000,-0.707083,0.000000,0.707083,-1.000000,0.000000,0.000000,-0.707083,0.000000,-0.707083,0.000000,0.000000,-1.000000], + + 'vertices': [-0.000000,-1.000000,-0.000000,0.125000,-1.000000,-0.000000,0.250000,-1.000000,-0.000000,0.375000,-1.000000,-0.000000,0.500000,-1.000000,-0.000000,0.625000,-1.000000,-0.000000,0.750000,-1.000000,-0.000000,0.875000,-1.000000,-0.000000,-0.000000,-1.000000,0.125000,-0.000000,-1.000000,0.250000,-0.000000,-1.000000,0.375000,-0.000000,-1.000000,0.500000,-0.000000,-1.000000,0.625000,-0.000000,-1.000000,0.750000,-0.000000,-1.000000,0.875000,-0.125000,-1.000000,-0.000000,-0.250000,-1.000000,-0.000000,-0.375000,-1.000000,-0.000000,-0.500000,-1.000000,-0.000000,-0.625000,-1.000000,-0.000000,-0.750000,-1.000000,-0.000000,-0.875000,-1.000000,-0.000000,0.000000,-1.000000,-0.125000,0.000000,-1.000000,-0.250000,0.000000,-1.000000,-0.375000,0.000000,-1.000000,-0.500000,0.000000,-1.000000,-0.625000,0.000000,-1.000000,-0.750000,0.000000,-1.000000,-0.875000,0.125000,-1.000000,-0.125000,0.250000,-1.000000,-0.125000,0.375000,-1.000000,-0.125000,0.500000,-1.000000,-0.125000,0.625000,-1.000000,-0.125000,0.750000,-1.000000,-0.125000,0.875000,-1.000000,-0.125000,0.125000,-1.000000,-0.250000,0.250000,-1.000000,-0.250000,0.375000,-1.000000,-0.250000,0.500000,-1.000000,-0.250000,0.625000,-1.000000,-0.250000,0.750000,-1.000000,-0.250000,0.875000,-1.000000,-0.250000,0.125000,-1.000000,-0.375000,0.250000,-1.000000,-0.375000,0.375000,-1.000000,-0.375000,0.500000,-1.000000,-0.375000,0.625000,-1.000000,-0.375000,0.750000,-1.000000,-0.375000,0.875000,-1.000000,-0.375000,0.125000,-1.000000,-0.500000,0.250000,-1.000000,-0.500000,0.375000,-1.000000,-0.500000,0.500000,-1.000000,-0.500000,0.625000,-1.000000,-0.500000,0.750000,-1.000000,-0.500000,0.875000,-1.000000,-0.500000,0.125000,-1.000000,-0.625000,0.250000,-1.000000,-0.625000,0.375000,-1.000000,-0.625000,0.500000,-1.000000,-0.625000,0.625000,-1.000000,-0.625000,0.750000,-1.000000,-0.625000,0.875000,-1.000000,-0.625000,0.125000,-1.000000,-0.750000,0.250000,-1.000000,-0.750000,0.375000,-1.000000,-0.750000,0.500000,-1.000000,-0.750000,0.625000,-1.000000,-0.750000,0.750000,-1.000000,-0.750000,0.875000,-1.000000,-0.750000,0.125000,-1.000000,-0.875000,0.250000,-1.000000,-0.875000,0.375000,-1.000000,-0.875000,0.500000,-1.000000,-0.875000,0.625000,-1.000000,-0.875000,0.750000,-1.000000,-0.875000,0.875000,-1.000000,-0.875000,0.125000,-1.000000,0.125000,0.125000,-1.000000,0.250000,0.125000,-1.000000,0.375000,0.125000,-1.000000,0.500000,0.125000,-1.000000,0.625000,0.125000,-1.000000,0.750000,0.125000,-1.000000,0.875000,0.250000,-1.000000,0.125000,0.250000,-1.000000,0.250000,0.250000,-1.000000,0.375000,0.250000,-1.000000,0.500000,0.250000,-1.000000,0.625000,0.250000,-1.000000,0.750000,0.250000,-1.000000,0.875000,0.375000,-1.000000,0.125000,0.375000,-1.000000,0.250000,0.375000,-1.000000,0.375000,0.375000,-1.000000,0.500000,0.375000,-1.000000,0.625000,0.375000,-1.000000,0.750000,0.375000,-1.000000,0.875000,0.500000,-1.000000,0.125000,0.500000,-1.000000,0.250000,0.500000,-1.000000,0.375000,0.500000,-1.000000,0.500000,0.500000,-1.000000,0.625000,0.500000,-1.000000,0.750000,0.500000,-1.000000,0.875000,0.625000,-1.000000,0.125000,0.625000,-1.000000,0.250000,0.625000,-1.000000,0.375000,0.625000,-1.000000,0.500000,0.625000,-1.000000,0.625000,0.625000,-1.000000,0.750000,0.625000,-1.000000,0.875000,0.750000,-1.000000,0.125000,0.750000,-1.000000,0.250000,0.750000,-1.000000,0.375000,0.750000,-1.000000,0.500000,0.750000,-1.000000,0.625000,0.750000,-1.000000,0.750000,0.750000,-1.000000,0.875000,0.875000,-1.000000,0.125000,0.875000,-1.000000,0.250000,0.875000,-1.000000,0.375000,0.875000,-1.000000,0.500000,0.875000,-1.000000,0.625000,0.875000,-1.000000,0.750000,0.875000,-1.000000,0.875000,-0.125000,-1.000000,0.125000,-0.250000,-1.000000,0.125000,-0.375000,-1.000000,0.125000,-0.500000,-1.000000,0.125000,-0.625000,-1.000000,0.125000,-0.750000,-1.000000,0.125000,-0.875000,-1.000000,0.125000,-0.125000,-1.000000,0.250000,-0.250000,-1.000000,0.250000,-0.375000,-1.000000,0.250000,-0.500000,-1.000000,0.250000,-0.625000,-1.000000,0.250000,-0.750000,-1.000000,0.250000,-0.875000,-1.000000,0.250000,-0.125000,-1.000000,0.375000,-0.250000,-1.000000,0.375000,-0.375000,-1.000000,0.375000,-0.500000,-1.000000,0.375000,-0.625000,-1.000000,0.375000,-0.750000,-1.000000,0.375000,-0.875000,-1.000000,0.375000,-0.125000,-1.000000,0.500000,-0.250000,-1.000000,0.500000,-0.375000,-1.000000,0.500000,-0.500000,-1.000000,0.500000,-0.625000,-1.000000,0.500000,-0.750000,-1.000000,0.500000,-0.875000,-1.000000,0.500000,-0.125000,-1.000000,0.625000,-0.250000,-1.000000,0.625000,-0.375000,-1.000000,0.625000,-0.500000,-1.000000,0.625000,-0.625000,-1.000000,0.625000,-0.750000,-1.000000,0.625000,-0.875000,-1.000000,0.625000,-0.125000,-1.000000,0.750000,-0.250000,-1.000000,0.750000,-0.375000,-1.000000,0.750000,-0.500000,-1.000000,0.750000,-0.625000,-1.000000,0.750000,-0.750000,-1.000000,0.750000,-0.875000,-1.000000,0.750000,-0.125000,-1.000000,0.875000,-0.250000,-1.000000,0.875000,-0.375000,-1.000000,0.875000,-0.500000,-1.000000,0.875000,-0.625000,-1.000000,0.875000,-0.750000,-1.000000,0.875000,-0.875000,-1.000000,0.875000,-0.125000,-1.000000,-0.125000,-0.125000,-1.000000,-0.250000,-0.125000,-1.000000,-0.375000,-0.125000,-1.000000,-0.500000,-0.125000,-1.000000,-0.625000,-0.125000,-1.000000,-0.750000,-0.125000,-1.000000,-0.875000,-0.250000,-1.000000,-0.125000,-0.250000,-1.000000,-0.250000,-0.250000,-1.000000,-0.375000,-0.250000,-1.000000,-0.500000,-0.250000,-1.000000,-0.625000,-0.250000,-1.000000,-0.750000,-0.250000,-1.000000,-0.875000,-0.375000,-1.000000,-0.125000,-0.375000,-1.000000,-0.250000,-0.375000,-1.000000,-0.375000,-0.375000,-1.000000,-0.500000,-0.375000,-1.000000,-0.625000,-0.375000,-1.000000,-0.750000,-0.375000,-1.000000,-0.875000,-0.500000,-1.000000,-0.125000,-0.500000,-1.000000,-0.250000,-0.500000,-1.000000,-0.375000,-0.500000,-1.000000,-0.500000,-0.500000,-1.000000,-0.625000,-0.500000,-1.000000,-0.750000,-0.500000,-1.000000,-0.875000,-0.625000,-1.000000,-0.125000,-0.625000,-1.000000,-0.250000,-0.625000,-1.000000,-0.375000,-0.625000,-1.000000,-0.500000,-0.625000,-1.000000,-0.625000,-0.625000,-1.000000,-0.750000,-0.625000,-1.000000,-0.875000,-0.750000,-1.000000,-0.125000,-0.750000,-1.000000,-0.250000,-0.750000,-1.000000,-0.375000,-0.750000,-1.000000,-0.500000,-0.750000,-1.000000,-0.625000,-0.750000,-1.000000,-0.750000,-0.750000,-1.000000,-0.875000,-0.875000,-1.000000,-0.125000,-0.875000,-1.000000,-0.250000,-0.875000,-1.000000,-0.375000,-0.875000,-1.000000,-0.500000,-0.875000,-1.000000,-0.625000,-0.875000,-1.000000,-0.750000,-0.875000,-1.000000,-0.875000,-0.000000,1.000000,0.000000,-0.000000,1.000000,-0.125000,-0.000000,1.000000,-0.250000,-0.000000,1.000000,-0.375000,0.000000,1.000000,-0.500000,0.000000,1.000000,-0.625000,0.000000,1.000000,-0.750000,0.000000,1.000000,-0.875000,-0.125000,1.000000,-0.000000,-0.250000,1.000000,-0.000000,-0.375000,1.000000,-0.000000,-0.500000,1.000000,-0.000000,-0.625000,1.000000,-0.000000,-0.750000,1.000000,-0.000000,-0.875000,1.000000,-0.000000,-0.000000,1.000000,0.125000,-0.000000,1.000000,0.250000,-0.000000,1.000000,0.375000,-0.000000,1.000000,0.500000,-0.000000,1.000000,0.625000,-0.000000,1.000000,0.750000,-0.000001,1.000000,0.875000,0.125000,1.000000,0.000000,0.250000,1.000000,0.000000,0.375000,1.000000,0.000000,0.500000,1.000000,0.000000,0.625000,1.000000,0.000000,0.750000,1.000000,0.000000,0.875000,1.000000,0.000000,0.125000,1.000000,-0.125000,0.125000,1.000000,-0.250000,0.125000,1.000000,-0.375000,0.125000,1.000000,-0.500000,0.125000,1.000000,-0.625000,0.125000,1.000000,-0.750000,0.125000,1.000000,-0.875000,0.250000,1.000000,-0.125000,0.250000,1.000000,-0.250000,0.250000,1.000000,-0.375000,0.250000,1.000000,-0.500000,0.250000,1.000000,-0.625000,0.250000,1.000000,-0.750000,0.250000,1.000000,-0.875000,0.375000,1.000000,-0.125000,0.375000,1.000000,-0.250000,0.375000,1.000000,-0.375000,0.375000,1.000000,-0.500000,0.375000,1.000000,-0.625000,0.375000,1.000000,-0.750000,0.375000,1.000000,-0.875000,0.500000,1.000000,-0.125000,0.500000,1.000000,-0.250000,0.500000,1.000000,-0.375000,0.500000,1.000000,-0.500000,0.500000,1.000000,-0.625000,0.500000,1.000000,-0.750000,0.500000,1.000000,-0.875000,0.625000,1.000000,-0.125000,0.625000,1.000000,-0.250000,0.625000,1.000000,-0.375000,0.625000,1.000000,-0.500000,0.625000,1.000000,-0.625000,0.625000,1.000000,-0.750000,0.625000,1.000000,-0.875000,0.750000,1.000000,-0.125000,0.750000,1.000000,-0.250000,0.750000,1.000000,-0.375000,0.750000,1.000000,-0.500000,0.750000,1.000000,-0.625000,0.750000,1.000000,-0.750000,0.750000,1.000000,-0.875000,0.875000,1.000000,-0.125000,0.875000,1.000000,-0.250000,0.875000,1.000000,-0.375000,0.875000,1.000000,-0.500000,0.875000,1.000000,-0.625000,0.875000,1.000000,-0.750000,0.875000,1.000000,-0.875000,-0.125000,1.000000,-0.125000,-0.250000,1.000000,-0.125000,-0.375000,1.000000,-0.125000,-0.500000,1.000000,-0.125000,-0.625000,1.000000,-0.125000,-0.750000,1.000000,-0.125000,-0.875000,1.000000,-0.125000,-0.125000,1.000000,-0.250000,-0.250000,1.000000,-0.250000,-0.375000,1.000000,-0.250000,-0.500000,1.000000,-0.250000,-0.625000,1.000000,-0.250000,-0.750000,1.000000,-0.250000,-0.875000,1.000000,-0.250000,-0.125000,1.000000,-0.375000,-0.250000,1.000000,-0.375000,-0.375000,1.000000,-0.375000,-0.500000,1.000000,-0.375000,-0.625000,1.000000,-0.375000,-0.750000,1.000000,-0.375000,-0.875000,1.000000,-0.375000,-0.125000,1.000000,-0.500000,-0.250000,1.000000,-0.500000,-0.375000,1.000000,-0.500000,-0.500000,1.000000,-0.500000,-0.625000,1.000000,-0.500000,-0.750000,1.000000,-0.500000,-0.875000,1.000000,-0.500000,-0.125000,1.000000,-0.625000,-0.250000,1.000000,-0.625000,-0.375000,1.000000,-0.625000,-0.500000,1.000000,-0.625000,-0.625000,1.000000,-0.625000,-0.750000,1.000000,-0.625000,-0.875000,1.000000,-0.625000,-0.125000,1.000000,-0.750000,-0.250000,1.000000,-0.750000,-0.375000,1.000000,-0.750000,-0.500000,1.000000,-0.750000,-0.625000,1.000000,-0.750000,-0.750000,1.000000,-0.750000,-0.875000,1.000000,-0.750000,-0.125000,1.000000,-0.875000,-0.250000,1.000000,-0.875000,-0.375000,1.000000,-0.875000,-0.500000,1.000000,-0.875000,-0.625000,1.000000,-0.875000,-0.750000,1.000000,-0.875000,-0.875000,1.000000,-0.875000,-0.125000,1.000000,0.125000,-0.125000,1.000000,0.250000,-0.125000,1.000000,0.375000,-0.125000,1.000000,0.500000,-0.125000,1.000000,0.625000,-0.125000,1.000000,0.750000,-0.125001,1.000000,0.875000,-0.250000,1.000000,0.125000,-0.250000,1.000000,0.250000,-0.250000,1.000000,0.375000,-0.250000,1.000000,0.500000,-0.250000,1.000000,0.625000,-0.250000,1.000000,0.750000,-0.250000,1.000000,0.875000,-0.375000,1.000000,0.125000,-0.375000,1.000000,0.250000,-0.375000,1.000000,0.375000,-0.375000,1.000000,0.500000,-0.375000,1.000000,0.625000,-0.375000,1.000000,0.750000,-0.375000,1.000000,0.875000,-0.500000,1.000000,0.125000,-0.500000,1.000000,0.250000,-0.500000,1.000000,0.375000,-0.500000,1.000000,0.500000,-0.500000,1.000000,0.625000,-0.500000,1.000000,0.750000,-0.500000,1.000000,0.875000,-0.625000,1.000000,0.125000,-0.625000,1.000000,0.250000,-0.625000,1.000000,0.375000,-0.625000,1.000000,0.500000,-0.625000,1.000000,0.625000,-0.625000,1.000000,0.750000,-0.625000,1.000000,0.875000,-0.750000,1.000000,0.125000,-0.750000,1.000000,0.250000,-0.750000,1.000000,0.375000,-0.750000,1.000000,0.500000,-0.750000,1.000000,0.625000,-0.750000,1.000000,0.750000,-0.750000,1.000000,0.875000,-0.875000,1.000000,0.125000,-0.875000,1.000000,0.250000,-0.875000,1.000000,0.375000,-0.875000,1.000000,0.500000,-0.875000,1.000000,0.625000,-0.875000,1.000000,0.750000,-0.875000,1.000000,0.875000,0.125000,1.000000,0.125000,0.250000,1.000000,0.125000,0.375000,1.000000,0.125000,0.500000,1.000000,0.125000,0.625000,1.000000,0.125000,0.750000,1.000000,0.125000,0.875000,1.000000,0.125000,0.125000,1.000000,0.250000,0.250000,1.000000,0.250000,0.375000,1.000000,0.250000,0.500000,1.000000,0.250000,0.625000,1.000000,0.250000,0.750000,1.000000,0.250000,0.875000,1.000000,0.250000,0.125000,1.000000,0.375000,0.250000,1.000000,0.375000,0.375000,1.000000,0.375000,0.500000,1.000000,0.375000,0.625000,1.000000,0.375000,0.750000,1.000000,0.375000,0.875000,1.000000,0.375000,0.125000,1.000000,0.500000,0.250000,1.000000,0.500000,0.375000,1.000000,0.500000,0.500000,1.000000,0.500000,0.625000,1.000000,0.500000,0.750000,1.000000,0.500000,0.875000,1.000000,0.500000,0.125000,1.000000,0.625000,0.250000,1.000000,0.625000,0.375000,1.000000,0.625000,0.500000,1.000000,0.625000,0.625000,1.000000,0.625000,0.750000,1.000000,0.625000,0.875000,1.000000,0.625000,0.125000,1.000000,0.750000,0.249999,1.000000,0.750000,0.374999,1.000000,0.750000,0.499999,1.000000,0.750000,0.624999,1.000000,0.750000,0.749999,1.000000,0.750000,0.874999,1.000000,0.750000,0.124999,1.000000,0.875000,0.249999,1.000000,0.875000,0.374999,1.000000,0.875000,0.499999,1.000000,0.875000,0.624999,1.000000,0.875000,0.749999,1.000000,0.875000,0.874999,1.000000,0.875000,1.000000,0.000000,0.000000,1.000000,-0.000000,-0.125000,1.000000,-0.000000,-0.250000,1.000000,-0.000000,-0.375000,1.000000,-0.000000,-0.500000,1.000000,-0.000000,-0.625000,1.000000,-0.000000,-0.750000,1.000000,-0.000000,-0.875000,1.000000,0.125000,0.000000,1.000000,0.250000,0.000000,1.000000,0.375000,0.000000,1.000000,0.500000,0.000000,1.000000,0.625000,0.000000,1.000000,0.750000,0.000000,1.000000,0.875000,0.000000,1.000000,0.000000,0.125000,1.000000,0.000000,0.250000,1.000000,0.000000,0.375000,1.000000,0.000000,0.500000,1.000000,0.000000,0.625000,1.000000,0.000000,0.750000,1.000000,0.000000,0.875000,1.000000,-0.125000,0.000000,1.000000,-0.250000,0.000000,1.000000,-0.375000,0.000000,1.000000,-0.500000,0.000000,1.000000,-0.625000,0.000000,1.000000,-0.750000,0.000000,1.000000,-0.875000,-0.000000,1.000000,-0.125000,-0.125000,1.000000,-0.125000,-0.250000,1.000000,-0.125000,-0.375000,1.000000,-0.125000,-0.500000,1.000000,-0.125000,-0.625000,1.000000,-0.125000,-0.750000,1.000000,-0.125000,-0.875000,1.000000,-0.250000,-0.125000,1.000000,-0.250000,-0.250000,1.000000,-0.250000,-0.375000,1.000000,-0.250000,-0.500000,1.000000,-0.250000,-0.625000,1.000000,-0.250000,-0.750000,1.000000,-0.250000,-0.875000,1.000000,-0.375000,-0.125000,1.000000,-0.375000,-0.250000,1.000000,-0.375000,-0.375000,1.000000,-0.375000,-0.500000,1.000000,-0.375000,-0.625000,1.000000,-0.375000,-0.750000,1.000000,-0.375000,-0.875000,1.000000,-0.500000,-0.125000,1.000000,-0.500000,-0.250000,1.000000,-0.500000,-0.375000,1.000000,-0.500000,-0.500000,1.000000,-0.500000,-0.625000,1.000000,-0.500000,-0.750000,1.000000,-0.500000,-0.875000,1.000000,-0.625000,-0.125000,1.000000,-0.625000,-0.250000,1.000000,-0.625000,-0.375000,1.000000,-0.625000,-0.500000,1.000000,-0.625000,-0.625000,1.000000,-0.625000,-0.750000,1.000000,-0.625000,-0.875000,1.000000,-0.750000,-0.125000,1.000000,-0.750000,-0.250000,1.000000,-0.750000,-0.375000,1.000000,-0.750000,-0.500000,1.000000,-0.750000,-0.625000,1.000000,-0.750000,-0.750000,1.000000,-0.750000,-0.875000,1.000000,-0.875000,-0.125000,1.000000,-0.875000,-0.250000,1.000000,-0.875000,-0.375000,1.000000,-0.875000,-0.500000,1.000000,-0.875000,-0.625000,1.000000,-0.875000,-0.750000,1.000000,-0.875000,-0.875000,1.000000,0.125000,-0.125000,1.000000,0.250000,-0.125000,1.000000,0.375000,-0.125000,1.000000,0.500000,-0.125000,1.000000,0.625000,-0.125000,1.000000,0.750000,-0.125000,1.000000,0.875000,-0.125000,1.000000,0.125000,-0.250000,1.000000,0.250000,-0.250000,1.000000,0.375000,-0.250000,1.000000,0.500000,-0.250000,1.000000,0.625000,-0.250000,1.000000,0.750000,-0.250000,1.000000,0.875000,-0.250000,1.000000,0.125000,-0.375000,1.000000,0.250000,-0.375000,1.000000,0.375000,-0.375000,1.000000,0.500000,-0.375000,1.000000,0.625000,-0.375000,1.000000,0.750000,-0.375000,1.000000,0.875000,-0.375000,1.000000,0.125000,-0.500000,1.000000,0.250000,-0.500000,1.000000,0.375000,-0.500000,1.000000,0.500000,-0.500000,1.000000,0.625000,-0.500000,1.000000,0.750000,-0.500000,1.000000,0.875000,-0.500000,1.000000,0.125000,-0.625000,1.000000,0.250000,-0.625000,1.000000,0.375000,-0.625000,1.000000,0.500000,-0.625000,1.000000,0.625000,-0.625000,1.000000,0.750000,-0.625000,1.000000,0.875000,-0.625000,1.000000,0.125000,-0.750000,1.000000,0.250000,-0.750000,1.000000,0.375000,-0.750000,1.000000,0.500000,-0.750000,1.000000,0.625000,-0.750000,1.000000,0.750000,-0.750000,1.000000,0.875000,-0.750000,1.000000,0.125000,-0.875000,1.000000,0.250000,-0.875000,1.000000,0.375000,-0.875000,1.000000,0.500000,-0.875000,1.000000,0.625000,-0.875000,1.000000,0.750000,-0.875000,1.000000,0.875000,-0.875000,1.000000,0.125000,0.125000,1.000000,0.125000,0.250000,1.000000,0.125000,0.375000,1.000000,0.125000,0.500000,1.000000,0.125000,0.625000,1.000000,0.125000,0.750000,1.000000,0.125000,0.875000,1.000000,0.250000,0.125000,1.000000,0.250000,0.250000,1.000000,0.250000,0.375000,1.000000,0.250000,0.500000,1.000000,0.250000,0.625000,1.000000,0.250000,0.750000,1.000000,0.250000,0.875000,1.000000,0.375000,0.125000,1.000000,0.375000,0.250000,1.000000,0.375000,0.375000,1.000000,0.375000,0.500000,1.000000,0.375000,0.625000,1.000000,0.375000,0.750000,1.000000,0.375000,0.875000,1.000000,0.500000,0.125000,1.000000,0.500000,0.250000,1.000000,0.500000,0.375000,1.000000,0.500000,0.500000,1.000000,0.500000,0.625000,1.000000,0.500000,0.750000,0.999999,0.500000,0.875000,1.000000,0.625000,0.125000,1.000000,0.625000,0.250000,1.000000,0.625000,0.375000,1.000000,0.625000,0.500000,1.000000,0.625000,0.625000,1.000000,0.625000,0.750000,0.999999,0.625000,0.875000,1.000000,0.750000,0.125000,1.000000,0.750000,0.250000,1.000000,0.750000,0.375000,1.000000,0.750000,0.500000,1.000000,0.750000,0.625000,0.999999,0.750000,0.750000,0.999999,0.750000,0.875000,1.000000,0.875000,0.125000,1.000000,0.875000,0.250000,1.000000,0.875000,0.375000,1.000000,0.875000,0.500000,1.000000,0.875000,0.625000,0.999999,0.875000,0.750000,0.999999,0.875000,0.875000,1.000000,-0.125000,0.125000,1.000000,-0.250000,0.125000,1.000000,-0.375000,0.125000,1.000000,-0.500000,0.125000,1.000000,-0.625000,0.125000,1.000000,-0.750000,0.125000,1.000000,-0.875000,0.125000,1.000000,-0.125000,0.250000,1.000000,-0.250000,0.250000,1.000000,-0.375000,0.250000,1.000000,-0.500000,0.250000,1.000000,-0.625000,0.250000,1.000000,-0.750000,0.250000,1.000000,-0.875000,0.250000,1.000000,-0.125000,0.375000,1.000000,-0.250000,0.375000,1.000000,-0.375000,0.375000,1.000000,-0.500000,0.375000,1.000000,-0.625000,0.375000,1.000000,-0.750000,0.375000,1.000000,-0.875000,0.375000,1.000000,-0.125000,0.500000,1.000000,-0.250000,0.500000,1.000000,-0.375000,0.500000,1.000000,-0.500000,0.500000,1.000000,-0.625000,0.500000,1.000000,-0.750000,0.500000,1.000000,-0.875000,0.500000,1.000000,-0.125000,0.625000,1.000000,-0.250000,0.625000,1.000000,-0.375000,0.625000,1.000000,-0.500000,0.625000,1.000000,-0.625000,0.625000,1.000000,-0.750000,0.625000,1.000000,-0.875000,0.625000,1.000000,-0.125000,0.750000,1.000000,-0.250000,0.750000,1.000000,-0.375000,0.750000,1.000000,-0.500000,0.750000,1.000000,-0.625000,0.750000,1.000000,-0.750000,0.750000,1.000000,-0.875000,0.750000,1.000000,-0.125000,0.875000,1.000000,-0.250000,0.875000,1.000000,-0.375000,0.875000,1.000000,-0.500000,0.875000,1.000000,-0.625000,0.875000,1.000000,-0.750000,0.875000,1.000000,-0.875000,0.875000,-0.000000,0.000000,1.000000,0.125000,0.000000,1.000000,0.250000,0.000000,1.000000,0.375000,0.000000,1.000000,0.500000,0.000000,1.000000,0.625000,0.000000,1.000000,0.750000,0.000000,1.000000,0.875000,0.000000,1.000000,-0.000000,0.125000,1.000000,-0.000000,0.250000,1.000000,-0.000000,0.375000,1.000000,-0.000000,0.500000,1.000000,-0.000000,0.625000,1.000000,-0.000001,0.750000,1.000000,-0.000001,0.875000,1.000000,-0.125000,0.000000,1.000000,-0.250000,0.000000,1.000000,-0.375000,0.000000,1.000000,-0.500000,0.000000,1.000000,-0.625000,0.000000,1.000000,-0.750000,0.000000,1.000000,-0.875000,0.000000,1.000000,-0.000000,-0.125000,1.000000,-0.000000,-0.250000,1.000000,-0.000000,-0.375000,1.000000,-0.000000,-0.500000,1.000000,-0.000000,-0.625000,1.000000,-0.000000,-0.750000,1.000000,-0.000000,-0.875000,1.000000,0.125000,-0.125000,1.000000,0.250000,-0.125000,1.000000,0.375000,-0.125000,1.000000,0.500000,-0.125000,1.000000,0.625000,-0.125000,1.000000,0.750000,-0.125000,1.000000,0.875000,-0.125000,1.000000,0.125000,-0.250000,1.000000,0.250000,-0.250000,1.000000,0.375000,-0.250000,1.000000,0.500000,-0.250000,1.000000,0.625000,-0.250000,1.000000,0.750000,-0.250000,1.000000,0.875000,-0.250000,1.000000,0.125000,-0.375000,1.000000,0.250000,-0.375000,1.000000,0.375000,-0.375000,1.000000,0.500000,-0.375000,1.000000,0.625000,-0.375000,1.000000,0.750000,-0.375000,1.000000,0.875000,-0.375000,1.000000,0.125000,-0.500000,1.000000,0.250000,-0.500000,1.000000,0.375000,-0.500000,1.000000,0.500000,-0.500000,1.000000,0.625000,-0.500000,1.000000,0.750000,-0.500000,1.000000,0.875000,-0.500000,1.000000,0.125000,-0.625000,1.000000,0.250000,-0.625000,1.000000,0.375000,-0.625000,1.000000,0.500000,-0.625000,1.000000,0.625000,-0.625000,1.000000,0.750000,-0.625000,1.000000,0.875000,-0.625000,1.000000,0.125000,-0.750000,1.000000,0.250000,-0.750000,1.000000,0.375000,-0.750000,1.000000,0.500000,-0.750000,1.000000,0.625000,-0.750000,1.000000,0.750000,-0.750000,1.000000,0.875000,-0.750000,1.000000,0.125000,-0.875000,1.000000,0.250000,-0.875000,1.000000,0.375000,-0.875000,1.000000,0.500000,-0.875000,1.000000,0.625000,-0.875000,1.000000,0.750000,-0.875000,1.000000,0.875000,-0.875000,1.000000,0.125000,0.125000,1.000000,0.125000,0.250000,1.000000,0.125000,0.375000,1.000000,0.125000,0.500000,1.000000,0.124999,0.625000,1.000000,0.124999,0.750000,1.000000,0.124999,0.875000,1.000000,0.250000,0.125000,1.000000,0.250000,0.250000,1.000000,0.250000,0.375000,1.000000,0.250000,0.500000,1.000000,0.249999,0.625000,1.000000,0.249999,0.750000,1.000000,0.249999,0.875000,1.000000,0.375000,0.125000,1.000000,0.375000,0.250000,1.000000,0.375000,0.375000,1.000000,0.374999,0.500000,1.000000,0.374999,0.625000,1.000000,0.374999,0.750000,1.000000,0.374999,0.875000,1.000000,0.500000,0.125000,1.000000,0.500000,0.250000,1.000000,0.500000,0.375000,1.000000,0.499999,0.500000,1.000000,0.499999,0.625000,1.000000,0.499999,0.750000,1.000000,0.499999,0.875000,1.000000,0.625000,0.125000,1.000000,0.625000,0.250000,1.000000,0.625000,0.375000,1.000000,0.624999,0.500000,1.000000,0.624999,0.625000,1.000000,0.624999,0.750000,1.000000,0.624999,0.875000,1.000000,0.750000,0.125000,1.000000,0.750000,0.250000,1.000000,0.750000,0.375000,1.000000,0.749999,0.500000,1.000000,0.749999,0.625000,1.000000,0.749999,0.750000,1.000000,0.749999,0.875000,1.000000,0.875000,0.125000,1.000000,0.875000,0.250000,1.000000,0.875000,0.375000,1.000000,0.874999,0.500000,1.000000,0.874999,0.625000,1.000000,0.874999,0.750000,1.000000,0.874999,0.875000,1.000000,-0.125000,0.125000,1.000000,-0.250000,0.125000,1.000000,-0.375000,0.125000,1.000000,-0.500000,0.125000,1.000000,-0.625000,0.125000,1.000000,-0.750000,0.125000,1.000000,-0.875000,0.125000,1.000000,-0.125000,0.250000,1.000000,-0.250000,0.250000,1.000000,-0.375000,0.250000,1.000000,-0.500000,0.250000,1.000000,-0.625000,0.250000,1.000000,-0.750000,0.250000,1.000000,-0.875000,0.250000,1.000000,-0.125000,0.375000,1.000000,-0.250000,0.375000,1.000000,-0.375000,0.375000,1.000000,-0.500000,0.375000,1.000000,-0.625000,0.375000,1.000000,-0.750000,0.375000,1.000000,-0.875000,0.375000,1.000000,-0.125000,0.500000,1.000000,-0.250000,0.500000,1.000000,-0.375000,0.500000,1.000000,-0.500000,0.500000,1.000000,-0.625000,0.500000,1.000000,-0.750000,0.500000,1.000000,-0.875000,0.500000,1.000000,-0.125000,0.625000,1.000000,-0.250000,0.625000,1.000000,-0.375000,0.625000,1.000000,-0.500000,0.625000,1.000000,-0.625000,0.625000,1.000000,-0.750000,0.625000,1.000000,-0.875000,0.625000,1.000000,-0.125000,0.750000,1.000000,-0.250000,0.750000,1.000000,-0.375000,0.750000,1.000000,-0.500000,0.750000,1.000000,-0.625000,0.750000,1.000000,-0.750000,0.750000,1.000000,-0.875000,0.750000,1.000000,-0.125001,0.875000,1.000000,-0.250001,0.875000,1.000000,-0.375000,0.875000,1.000000,-0.500000,0.875000,1.000000,-0.625000,0.875000,1.000000,-0.750000,0.875000,1.000000,-0.875000,0.875000,1.000000,-0.125000,-0.125000,1.000000,-0.125000,-0.250000,1.000000,-0.125000,-0.375000,1.000000,-0.125000,-0.500000,1.000000,-0.125000,-0.625000,1.000000,-0.125000,-0.750000,1.000000,-0.125000,-0.875000,1.000000,-0.250000,-0.125000,1.000000,-0.250000,-0.250000,1.000000,-0.250000,-0.375000,1.000000,-0.250000,-0.500000,1.000000,-0.250000,-0.625000,1.000000,-0.250000,-0.750000,1.000000,-0.250000,-0.875000,1.000000,-0.375000,-0.125000,1.000000,-0.375000,-0.250000,1.000000,-0.375000,-0.375000,1.000000,-0.375000,-0.500000,1.000000,-0.375000,-0.625000,1.000000,-0.375000,-0.750000,1.000000,-0.375000,-0.875000,1.000000,-0.500000,-0.125000,1.000000,-0.500000,-0.250000,1.000000,-0.500000,-0.375000,1.000000,-0.500000,-0.500000,1.000000,-0.500000,-0.625000,1.000000,-0.500000,-0.750000,1.000000,-0.500000,-0.875000,1.000000,-0.625000,-0.125000,1.000000,-0.625000,-0.250000,1.000000,-0.625000,-0.375000,1.000000,-0.625000,-0.500000,1.000000,-0.625000,-0.625000,1.000000,-0.625000,-0.750000,1.000000,-0.625000,-0.875000,1.000000,-0.750000,-0.125000,1.000000,-0.750000,-0.250000,1.000000,-0.750000,-0.375000,1.000000,-0.750000,-0.500000,1.000000,-0.750000,-0.625000,1.000000,-0.750000,-0.750000,1.000000,-0.750000,-0.875000,1.000000,-0.875000,-0.125000,1.000000,-0.875000,-0.250000,1.000000,-0.875000,-0.375000,1.000000,-0.875000,-0.500000,1.000000,-0.875000,-0.625000,1.000000,-0.875000,-0.750000,1.000000,-0.875000,-0.875000,1.000000,-1.000000,-0.000000,-0.000000,-1.000000,0.000000,0.125000,-1.000000,0.000000,0.250000,-1.000000,0.000000,0.375000,-1.000000,0.000000,0.500000,-1.000000,0.000000,0.625000,-1.000000,0.000000,0.750000,-1.000000,0.000000,0.875000,-1.000000,0.125000,-0.000000,-1.000000,0.250000,-0.000000,-1.000000,0.375000,-0.000000,-1.000000,0.500000,-0.000000,-1.000000,0.625000,-0.000000,-1.000000,0.750000,-0.000000,-1.000000,0.875000,-0.000000,-1.000000,-0.000000,-0.125000,-1.000000,-0.000000,-0.250000,-1.000000,-0.000000,-0.375000,-1.000000,-0.000000,-0.500000,-1.000000,-0.000000,-0.625000,-1.000000,-0.000000,-0.750000,-1.000000,-0.000000,-0.875000,-1.000000,-0.125000,-0.000000,-1.000000,-0.250000,-0.000000,-1.000000,-0.375000,-0.000000,-1.000000,-0.500000,-0.000000,-1.000000,-0.625000,-0.000000,-1.000000,-0.750000,-0.000000,-1.000000,-0.875000,-0.000000,-1.000000,-0.125000,0.125000,-1.000000,-0.125000,0.250000,-1.000000,-0.125000,0.375000,-1.000000,-0.125000,0.500000,-1.000000,-0.125000,0.625000,-1.000000,-0.125000,0.750000,-1.000000,-0.125000,0.875000,-1.000000,-0.250000,0.125000,-1.000000,-0.250000,0.250000,-1.000000,-0.250000,0.375000,-1.000000,-0.250000,0.500000,-1.000000,-0.250000,0.625000,-1.000000,-0.250000,0.750000,-1.000000,-0.250000,0.875000,-1.000000,-0.375000,0.125000,-1.000000,-0.375000,0.250000,-1.000000,-0.375000,0.375000,-1.000000,-0.375000,0.500000,-1.000000,-0.375000,0.625000,-1.000000,-0.375000,0.750000,-1.000000,-0.375000,0.875000,-1.000000,-0.500000,0.125000,-1.000000,-0.500000,0.250000,-1.000000,-0.500000,0.375000,-1.000000,-0.500000,0.500000,-1.000000,-0.500000,0.625000,-1.000000,-0.500000,0.750000,-1.000000,-0.500000,0.875000,-1.000000,-0.625000,0.125000,-1.000000,-0.625000,0.250000,-1.000000,-0.625000,0.375000,-1.000000,-0.625000,0.500000,-1.000000,-0.625000,0.625000,-1.000000,-0.625000,0.750000,-1.000000,-0.625000,0.875000,-1.000000,-0.750000,0.125000,-1.000000,-0.750000,0.250000,-1.000000,-0.750000,0.375000,-1.000000,-0.750000,0.500000,-1.000000,-0.750000,0.625000,-1.000000,-0.750000,0.750000,-1.000000,-0.750000,0.875000,-1.000000,-0.875000,0.125000,-1.000000,-0.875000,0.250000,-1.000000,-0.875000,0.375000,-1.000000,-0.875000,0.500000,-1.000000,-0.875000,0.625000,-1.000000,-0.875000,0.750000,-1.000000,-0.875000,0.875000,-1.000000,0.125000,0.125000,-1.000000,0.250000,0.125000,-1.000000,0.375000,0.125000,-1.000000,0.500000,0.125000,-1.000000,0.625000,0.125000,-1.000000,0.750000,0.125000,-1.000000,0.875000,0.125000,-1.000000,0.125000,0.250000,-1.000000,0.250000,0.250000,-1.000000,0.375000,0.250000,-1.000000,0.500000,0.250000,-1.000000,0.625000,0.250000,-1.000000,0.750000,0.250000,-1.000000,0.875000,0.250000,-1.000000,0.125000,0.375000,-1.000000,0.250000,0.375000,-1.000000,0.375000,0.375000,-1.000000,0.500000,0.375000,-1.000000,0.625000,0.375000,-1.000000,0.750000,0.375000,-1.000000,0.875000,0.375000,-1.000000,0.125000,0.500000,-1.000000,0.250000,0.500000,-1.000000,0.375000,0.500000,-1.000000,0.500000,0.500000,-1.000000,0.625000,0.500000,-1.000000,0.750000,0.500000,-1.000000,0.875000,0.500000,-1.000000,0.125000,0.625000,-1.000000,0.250000,0.625000,-1.000000,0.375000,0.625000,-1.000000,0.500000,0.625000,-1.000000,0.625000,0.625000,-1.000000,0.750000,0.625000,-1.000000,0.875000,0.625000,-1.000000,0.125000,0.750000,-1.000000,0.250000,0.750000,-1.000000,0.375000,0.750000,-1.000000,0.500000,0.750000,-1.000000,0.625000,0.750000,-1.000000,0.750000,0.750000,-1.000000,0.875000,0.750000,-1.000000,0.125000,0.875000,-1.000000,0.250000,0.875000,-1.000000,0.375000,0.875000,-1.000000,0.500000,0.875000,-1.000000,0.625000,0.875000,-1.000000,0.750000,0.874999,-1.000000,0.875000,0.874999,-1.000000,0.125000,-0.125000,-1.000000,0.125000,-0.250000,-1.000000,0.125000,-0.375000,-1.000000,0.125000,-0.500000,-1.000000,0.125000,-0.625000,-1.000000,0.125000,-0.750000,-1.000000,0.125000,-0.875000,-1.000000,0.250000,-0.125000,-1.000000,0.250000,-0.250000,-1.000000,0.250000,-0.375000,-1.000000,0.250000,-0.500000,-1.000000,0.250000,-0.625000,-1.000000,0.250000,-0.750000,-1.000000,0.250000,-0.875000,-1.000000,0.375000,-0.125000,-1.000000,0.375000,-0.250000,-1.000000,0.375000,-0.375000,-1.000000,0.375000,-0.500000,-1.000000,0.375000,-0.625000,-1.000000,0.375000,-0.750000,-1.000000,0.375000,-0.875000,-1.000000,0.500000,-0.125000,-1.000000,0.500000,-0.250000,-1.000000,0.500000,-0.375000,-1.000000,0.500000,-0.500000,-1.000000,0.500000,-0.625000,-1.000000,0.500000,-0.750000,-1.000000,0.500000,-0.875000,-1.000000,0.625000,-0.125000,-1.000000,0.625000,-0.250000,-1.000000,0.625000,-0.375000,-1.000000,0.625000,-0.500000,-1.000000,0.625000,-0.625000,-1.000000,0.625000,-0.750000,-1.000000,0.625000,-0.875000,-1.000000,0.750000,-0.125000,-1.000000,0.750000,-0.250000,-1.000000,0.750000,-0.375000,-1.000000,0.750000,-0.500000,-1.000000,0.750000,-0.625000,-1.000000,0.750000,-0.750000,-1.000000,0.750000,-0.875000,-1.000000,0.875000,-0.125000,-1.000000,0.875000,-0.250000,-1.000000,0.875000,-0.375000,-1.000000,0.875000,-0.500000,-1.000000,0.875000,-0.625000,-1.000000,0.875000,-0.750000,-1.000000,0.875000,-0.875000,-1.000000,-0.125000,-0.125000,-1.000000,-0.250000,-0.125000,-1.000000,-0.375000,-0.125000,-1.000000,-0.500000,-0.125000,-1.000000,-0.625000,-0.125000,-1.000000,-0.750000,-0.125000,-1.000000,-0.875000,-0.125000,-1.000000,-0.125000,-0.250000,-1.000000,-0.250000,-0.250000,-1.000000,-0.375000,-0.250000,-1.000000,-0.500000,-0.250000,-1.000000,-0.625000,-0.250000,-1.000000,-0.750000,-0.250000,-1.000000,-0.875000,-0.250000,-1.000000,-0.125000,-0.375000,-1.000000,-0.250000,-0.375000,-1.000000,-0.375000,-0.375000,-1.000000,-0.500000,-0.375000,-1.000000,-0.625000,-0.375000,-1.000000,-0.750000,-0.375000,-1.000000,-0.875000,-0.375000,-1.000000,-0.125000,-0.500000,-1.000000,-0.250000,-0.500000,-1.000000,-0.375000,-0.500000,-1.000000,-0.500000,-0.500000,-1.000000,-0.625000,-0.500000,-1.000000,-0.750000,-0.500000,-1.000000,-0.875000,-0.500000,-1.000000,-0.125000,-0.625000,-1.000000,-0.250000,-0.625000,-1.000000,-0.375000,-0.625000,-1.000000,-0.500000,-0.625000,-1.000000,-0.625000,-0.625000,-1.000000,-0.750000,-0.625000,-1.000000,-0.875000,-0.625000,-1.000000,-0.125000,-0.750000,-1.000000,-0.250000,-0.750000,-1.000000,-0.375000,-0.750000,-1.000000,-0.500000,-0.750000,-1.000000,-0.625000,-0.750000,-1.000000,-0.750000,-0.750000,-1.000000,-0.875000,-0.750000,-1.000000,-0.125000,-0.875000,-1.000000,-0.250000,-0.875000,-1.000000,-0.375000,-0.875000,-1.000000,-0.500000,-0.875000,-1.000000,-0.625000,-0.875000,-1.000000,-0.750000,-0.875000,-1.000000,-0.875000,-0.875000,0.000000,-0.000000,-1.000000,0.125000,-0.000000,-1.000000,0.250000,-0.000000,-1.000000,0.375000,-0.000000,-1.000000,0.500000,-0.000000,-1.000000,0.625000,-0.000000,-1.000000,0.750000,-0.000000,-1.000000,0.875000,-0.000000,-1.000000,0.000000,-0.125000,-1.000000,0.000000,-0.250000,-1.000000,0.000000,-0.375000,-1.000000,0.000000,-0.500000,-1.000000,0.000000,-0.625000,-1.000000,0.000000,-0.750000,-1.000000,0.000000,-0.875000,-1.000000,-0.125000,-0.000000,-1.000000,-0.250000,-0.000000,-1.000000,-0.375000,-0.000000,-1.000000,-0.500000,-0.000000,-1.000000,-0.625000,-0.000000,-1.000000,-0.750000,-0.000000,-1.000000,-0.875000,-0.000000,-1.000000,0.000000,0.125000,-1.000000,0.000000,0.250000,-1.000000,0.000000,0.375000,-1.000000,0.000000,0.500000,-1.000000,0.000000,0.625000,-1.000000,0.000000,0.750000,-1.000000,0.000000,0.875000,-1.000000,0.125000,0.125000,-1.000000,0.250000,0.125000,-1.000000,0.375000,0.125000,-1.000000,0.500000,0.125000,-1.000000,0.625000,0.125000,-1.000000,0.750000,0.125000,-1.000000,0.875000,0.125000,-1.000000,0.125000,0.250000,-1.000000,0.250000,0.250000,-1.000000,0.375000,0.250000,-1.000000,0.500000,0.250000,-1.000000,0.625000,0.250000,-1.000000,0.750000,0.250000,-1.000000,0.875000,0.250000,-1.000000,0.125000,0.375000,-1.000000,0.250000,0.375000,-1.000000,0.375000,0.375000,-1.000000,0.500000,0.375000,-1.000000,0.625000,0.375000,-1.000000,0.750000,0.375000,-1.000000,0.875000,0.375000,-1.000000,0.125000,0.500000,-1.000000,0.250000,0.500000,-1.000000,0.375000,0.500000,-1.000000,0.500000,0.500000,-1.000000,0.625000,0.500000,-1.000000,0.750000,0.500000,-1.000000,0.875000,0.500000,-1.000000,0.125000,0.625000,-1.000000,0.250000,0.625000,-1.000000,0.375000,0.625000,-1.000000,0.500000,0.625000,-1.000000,0.625000,0.625000,-1.000000,0.750000,0.625000,-1.000000,0.875000,0.625000,-1.000000,0.125000,0.750000,-1.000000,0.250000,0.750000,-1.000000,0.375000,0.750000,-1.000000,0.500000,0.750000,-1.000000,0.625000,0.750000,-1.000000,0.750000,0.750000,-1.000000,0.875000,0.750000,-1.000000,0.125000,0.875000,-1.000000,0.250000,0.875000,-1.000000,0.375000,0.875000,-1.000000,0.500000,0.875000,-1.000000,0.625000,0.875000,-1.000000,0.750000,0.875000,-1.000000,0.875000,0.875000,-1.000000,0.125000,-0.125000,-1.000000,0.125000,-0.250000,-1.000000,0.125000,-0.375000,-1.000000,0.125000,-0.500000,-1.000000,0.125000,-0.625000,-1.000000,0.125000,-0.750000,-1.000000,0.125000,-0.875000,-1.000000,0.250000,-0.125000,-1.000000,0.250000,-0.250000,-1.000000,0.250000,-0.375000,-1.000000,0.250000,-0.500000,-1.000000,0.250000,-0.625000,-1.000000,0.250000,-0.750000,-1.000000,0.250000,-0.875000,-1.000000,0.375000,-0.125000,-1.000000,0.375000,-0.250000,-1.000000,0.375000,-0.375000,-1.000000,0.375000,-0.500000,-1.000000,0.375000,-0.625000,-1.000000,0.375000,-0.750000,-1.000000,0.375000,-0.875000,-1.000000,0.500000,-0.125000,-1.000000,0.500000,-0.250000,-1.000000,0.500000,-0.375000,-1.000000,0.500000,-0.500000,-1.000000,0.500000,-0.625000,-1.000000,0.500000,-0.750000,-1.000000,0.500000,-0.875000,-1.000000,0.625000,-0.125000,-1.000000,0.625000,-0.250000,-1.000000,0.625000,-0.375000,-1.000000,0.625000,-0.500000,-1.000000,0.625000,-0.625000,-1.000000,0.625000,-0.750000,-1.000000,0.625000,-0.875000,-1.000000,0.750000,-0.125000,-1.000000,0.750000,-0.250000,-1.000000,0.750000,-0.375000,-1.000000,0.750000,-0.500000,-1.000000,0.750000,-0.625000,-1.000000,0.750000,-0.750000,-1.000000,0.750000,-0.875000,-1.000000,0.875000,-0.125000,-1.000000,0.875000,-0.250000,-1.000000,0.875000,-0.375000,-1.000000,0.875000,-0.500000,-1.000000,0.875000,-0.625000,-1.000000,0.875000,-0.750000,-1.000000,0.875000,-0.875000,-1.000000,-0.125000,-0.125000,-1.000000,-0.250000,-0.125000,-1.000000,-0.375000,-0.125000,-1.000000,-0.500000,-0.125000,-1.000000,-0.625000,-0.125000,-1.000000,-0.750000,-0.125000,-1.000000,-0.875000,-0.125000,-1.000000,-0.125000,-0.250000,-1.000000,-0.250000,-0.250000,-1.000000,-0.375000,-0.250000,-1.000000,-0.500000,-0.250000,-1.000000,-0.625000,-0.250000,-1.000000,-0.750000,-0.250000,-1.000000,-0.875000,-0.250000,-1.000000,-0.125000,-0.375000,-1.000000,-0.250000,-0.375000,-1.000000,-0.375000,-0.375000,-1.000000,-0.500000,-0.375000,-1.000000,-0.625000,-0.375000,-1.000000,-0.750000,-0.375000,-1.000000,-0.875000,-0.375000,-1.000000,-0.125000,-0.500000,-1.000000,-0.250000,-0.500000,-1.000000,-0.375000,-0.500000,-1.000000,-0.500000,-0.500000,-1.000000,-0.625000,-0.500000,-1.000000,-0.750000,-0.500000,-1.000000,-0.875000,-0.500000,-1.000000,-0.125000,-0.625000,-1.000000,-0.250000,-0.625000,-1.000000,-0.375000,-0.625000,-1.000000,-0.500000,-0.625000,-1.000000,-0.625000,-0.625000,-1.000000,-0.750000,-0.625000,-1.000000,-0.875000,-0.625000,-1.000000,-0.125000,-0.750000,-1.000000,-0.250000,-0.750000,-1.000000,-0.375000,-0.750000,-1.000000,-0.500000,-0.750000,-1.000000,-0.625000,-0.750000,-1.000000,-0.750000,-0.750000,-1.000000,-0.875000,-0.750000,-1.000000,-0.125000,-0.875000,-1.000000,-0.250000,-0.875000,-1.000000,-0.375000,-0.875000,-1.000000,-0.500000,-0.875000,-1.000000,-0.625000,-0.875000,-1.000000,-0.750000,-0.875000,-1.000000,-0.875000,-0.875000,-1.000000,-0.125000,0.125000,-1.000000,-0.125000,0.250000,-1.000000,-0.125000,0.375000,-1.000000,-0.125000,0.500000,-1.000000,-0.125000,0.625000,-1.000000,-0.125000,0.750000,-1.000000,-0.125000,0.875000,-1.000000,-0.250000,0.125000,-1.000000,-0.250000,0.250000,-1.000000,-0.250000,0.375000,-1.000000,-0.250000,0.500000,-1.000000,-0.250000,0.625000,-1.000000,-0.250000,0.750000,-1.000000,-0.250000,0.875000,-1.000000,-0.375000,0.125000,-1.000000,-0.375000,0.250000,-1.000000,-0.375000,0.375000,-1.000000,-0.375000,0.500000,-1.000000,-0.375000,0.625000,-1.000000,-0.375000,0.750000,-1.000000,-0.375000,0.875000,-1.000000,-0.500000,0.125000,-1.000000,-0.500000,0.250000,-1.000000,-0.500000,0.375000,-1.000000,-0.500000,0.500000,-1.000000,-0.500000,0.625000,-1.000000,-0.500000,0.750000,-1.000000,-0.500000,0.875000,-1.000000,-0.625000,0.125000,-1.000000,-0.625000,0.250000,-1.000000,-0.625000,0.375000,-1.000000,-0.625000,0.500000,-1.000000,-0.625000,0.625000,-1.000000,-0.625000,0.750000,-1.000000,-0.625000,0.875000,-1.000000,-0.750000,0.125000,-1.000000,-0.750000,0.250000,-1.000000,-0.750000,0.375000,-1.000000,-0.750000,0.500000,-1.000000,-0.750000,0.625000,-1.000000,-0.750000,0.750000,-1.000000,-0.750000,0.875000,-1.000000,-0.875000,0.125000,-1.000000,-0.875000,0.250000,-1.000000,-0.875000,0.375000,-1.000000,-0.875000,0.500000,-1.000000,-0.875000,0.625000,-1.000000,-0.875000,0.750000,-1.000000,-0.875000,0.875000,-1.000000,1.000000,-1.000000,-0.875000,1.000000,-1.000000,-0.750000,1.000000,-1.000000,-0.625000,1.000000,-1.000000,-0.500000,1.000000,-1.000000,-0.375000,1.000000,-1.000000,-0.250000,1.000000,-1.000000,-0.125000,1.000000,-1.000000,-0.000000,1.000000,-1.000000,0.125000,1.000000,-1.000000,0.250000,1.000000,-1.000000,0.375000,1.000000,-1.000000,0.500000,1.000000,-1.000000,0.625000,1.000000,-1.000000,0.750000,1.000000,-1.000000,0.875000,0.875000,-1.000000,-1.000000,0.750000,-1.000000,-1.000000,0.625000,-1.000000,-1.000000,0.500000,-1.000000,-1.000000,0.375000,-1.000000,-1.000000,0.250000,-1.000000,-1.000000,0.125000,-1.000000,-1.000000,0.000000,-1.000000,-1.000000,-0.125000,-1.000000,-1.000000,-0.250000,-1.000000,-1.000000,-0.375000,-1.000000,-1.000000,-0.500000,-1.000000,-1.000000,-0.625000,-1.000000,-1.000000,-0.750000,-1.000000,-1.000000,-0.875000,-1.000000,-1.000000,1.000000,-0.875000,-1.000000,1.000000,-0.750000,-1.000000,1.000000,-0.625000,-1.000000,1.000000,-0.500000,-1.000000,1.000000,-0.375000,-1.000000,1.000000,-0.250000,-1.000000,1.000000,-0.125000,-1.000000,1.000000,-0.000000,-1.000000,1.000000,0.125000,-1.000000,1.000000,0.250000,-1.000000,1.000000,0.375000,-1.000000,1.000000,0.500000,-1.000000,1.000000,0.625000,-1.000000,1.000000,0.750000,-1.000000,1.000000,0.875000,-1.000000,0.875000,-1.000000,1.000000,0.750000,-1.000000,1.000000,0.625000,-1.000000,1.000000,0.500000,-1.000000,1.000000,0.375000,-1.000000,1.000000,0.250000,-1.000000,1.000000,0.125000,-1.000000,1.000000,-0.000000,-1.000000,1.000000,-0.125000,-1.000000,1.000000,-0.250000,-1.000000,1.000000,-0.375000,-1.000000,1.000000,-0.500000,-1.000000,1.000000,-0.625000,-1.000000,1.000000,-0.750000,-1.000000,1.000000,-0.875000,-1.000000,1.000000,1.000000,-0.875000,1.000000,1.000000,-0.750000,1.000000,1.000000,-0.625000,1.000000,1.000000,-0.500000,1.000000,1.000000,-0.375000,1.000000,1.000000,-0.250000,1.000000,1.000000,-0.125000,1.000000,1.000000,0.000000,1.000000,1.000000,0.125000,1.000000,1.000000,0.250000,1.000000,1.000000,0.375000,1.000000,0.999999,0.500000,1.000000,0.999999,0.625000,1.000000,0.999999,0.750000,1.000000,0.999999,0.875000,1.000000,-1.000000,-1.000000,0.875000,-1.000000,-1.000000,0.750000,-1.000000,-1.000000,0.625000,-1.000000,-1.000000,0.500000,-1.000000,-1.000000,0.375000,-1.000000,-1.000000,0.250000,-1.000000,-1.000000,0.125000,-1.000000,-1.000000,-0.000000,-1.000000,-1.000000,-0.125000,-1.000000,-1.000000,-0.250000,-1.000000,-1.000000,-0.375000,-1.000000,-1.000000,-0.500000,-1.000000,-1.000000,-0.625000,-1.000000,-1.000000,-0.750000,-1.000000,-1.000000,-0.875000,-1.000000,-0.875000,1.000000,-1.000000,-0.750000,1.000000,-1.000000,-0.625000,1.000000,-1.000000,-0.500000,1.000000,-1.000000,-0.375000,1.000000,-1.000000,-0.250000,1.000000,-1.000000,-0.125000,1.000000,-1.000000,0.000000,1.000000,-1.000000,0.125000,1.000000,-1.000000,0.250000,1.000000,-1.000000,0.375000,1.000000,-1.000000,0.500000,1.000000,-1.000000,0.625000,1.000000,-1.000000,0.750000,0.999999,-1.000000,0.875000,0.999999,-1.000000,-0.875000,-1.000000,-1.000000,-0.750000,-1.000000,-1.000000,-0.625000,-1.000000,-1.000000,-0.500000,-1.000000,-1.000000,-0.375000,-1.000000,-1.000000,-0.250000,-1.000000,-1.000000,-0.125000,-1.000000,-1.000000,-0.000000,-1.000000,-1.000000,0.125000,-1.000000,-1.000000,0.250000,-1.000000,-1.000000,0.375000,-1.000000,-1.000000,0.500000,-1.000000,-1.000000,0.625000,-1.000000,-1.000000,0.750000,-1.000000,-1.000000,0.875000,-1.000000,1.000000,1.000000,-0.875000,1.000000,1.000000,-0.750000,1.000000,1.000000,-0.625000,1.000000,1.000000,-0.500000,1.000000,1.000000,-0.375000,1.000000,1.000000,-0.250000,1.000000,1.000000,-0.125000,1.000000,1.000000,0.000000,1.000000,1.000000,0.125000,1.000000,1.000000,0.250000,1.000000,1.000000,0.375000,1.000000,1.000000,0.500000,1.000000,1.000000,0.625000,0.999999,1.000000,0.750000,0.999999,1.000000,0.875000,0.875000,1.000000,-1.000000,0.750000,1.000000,-1.000000,0.625000,1.000000,-1.000000,0.500000,1.000000,-1.000000,0.375000,1.000000,-1.000000,0.250000,1.000000,-1.000000,0.125000,1.000000,-1.000000,0.000000,1.000000,-1.000000,-0.125000,1.000000,-1.000000,-0.250000,1.000000,-1.000000,-0.375000,1.000000,-1.000000,-0.500000,1.000000,-1.000000,-0.625000,1.000000,-1.000000,-0.750000,1.000000,-1.000000,-0.875000,1.000000,-1.000000,0.874999,1.000000,1.000000,0.749999,1.000000,1.000000,0.624999,1.000000,1.000000,0.499999,1.000000,1.000000,0.374999,1.000000,1.000000,0.249999,1.000000,1.000000,0.124999,1.000000,1.000000,-0.000001,1.000000,1.000000,-0.125001,1.000000,1.000000,-0.250001,1.000000,1.000000,-0.375001,1.000000,1.000000,-0.500000,1.000000,1.000000,-0.625000,1.000000,1.000000,-0.750000,1.000000,1.000000,-0.875000,1.000000,1.000000,-1.000000,1.000000,0.874999,-1.000000,1.000000,0.749999,-1.000000,1.000000,0.625000,-1.000000,1.000000,0.500000,-1.000000,1.000000,0.375000,-1.000000,1.000000,0.250000,-1.000000,1.000000,0.125000,-1.000000,1.000000,-0.000000,-1.000000,1.000000,-0.125000,-1.000000,1.000000,-0.250000,-1.000000,1.000000,-0.375000,-1.000000,1.000000,-0.500000,-1.000000,1.000000,-0.625000,-1.000000,1.000000,-0.750000,-1.000000,1.000000,-0.875000,1.000000,-1.000000,-1.000000,1.000000,-1.000000,1.000000,-1.000000,-1.000000,1.000000,-1.000000,-1.000000,-1.000000,1.000000,1.000000,-1.000000,0.999999,1.000000,1.000000,-1.000000,1.000000,0.999999,-1.000000,1.000000,-1.000000], + + 'colors': [0.992157,0.000000,0.458824,0.992157,0.000000,0.458824,0.992157,0.000000,0.458824,0.992157,0.000000,0.458824,0.992157,0.000000,0.458824,0.984314,0.011765,0.466667,0.980392,0.709804,0.819608,0.980392,0.972549,0.968627,1.000000,0.000000,0.349020,0.992157,0.035294,0.031373,0.992157,0.047059,0.000000,0.992157,0.062745,0.000000,0.992157,0.443137,0.000000,0.992157,0.611765,0.125490,1.000000,0.945098,0.780392,0.992157,0.000000,0.458824,0.992157,0.000000,0.458824,0.992157,0.000000,0.458824,0.992157,0.000000,0.458824,0.992157,0.000000,0.458824,0.992157,0.109804,0.498039,0.992157,0.850980,0.815686,0.992157,0.000000,0.470588,0.976471,0.000000,0.831373,0.968627,0.000000,0.992157,0.898039,0.000000,0.992157,0.196078,0.129412,0.992157,0.192157,0.513726,0.956863,0.894118,0.933333,0.878431,0.992157,0.000000,0.470588,0.992157,0.000000,0.470588,0.992157,0.000000,0.470588,0.992157,0.000000,0.466667,0.988235,0.003922,0.474510,0.980392,0.682353,0.819608,0.980392,0.972549,0.968627,0.976471,0.000000,0.819608,0.976471,0.000000,0.811765,0.976471,0.000000,0.796078,0.976471,0.000000,0.749020,0.976471,0.000000,0.733333,0.980392,0.623529,0.882353,0.980392,0.964706,0.972549,0.968627,0.000000,0.992157,0.968627,0.000000,0.992157,0.968627,0.000000,0.992157,0.968627,0.000000,0.984314,0.968627,0.000000,0.984314,0.968627,0.611765,0.968627,0.972549,0.964706,0.980392,0.898039,0.000000,0.992157,0.898039,0.000000,0.992157,0.905882,0.000000,0.992157,0.901961,0.000000,0.992157,0.890196,0.000000,0.992157,0.937255,0.627451,0.972549,0.972549,0.972549,0.976471,0.207843,0.117647,0.992157,0.211765,0.117647,0.992157,0.215686,0.105882,0.992157,0.196078,0.113725,0.992157,0.160784,0.109804,0.988235,0.694118,0.690196,0.972549,0.960784,0.976471,0.976471,0.156863,0.486275,0.960784,0.156863,0.478431,0.964706,0.184314,0.482353,0.956863,0.239216,0.501961,0.952941,0.321569,0.545098,0.933333,0.752941,0.831373,0.945098,0.964706,0.984314,0.972549,0.870588,0.921569,0.882353,0.890196,0.929412,0.878431,0.894118,0.937255,0.878431,0.905882,0.941176,0.878431,0.925490,0.952941,0.878431,0.952941,0.968627,0.905882,0.980392,0.988235,0.945098,1.000000,0.000000,0.341176,0.992157,0.031373,0.023529,0.992157,0.047059,0.000000,0.992157,0.062745,0.000000,0.992157,0.458824,0.000000,0.992157,0.607843,0.117647,1.000000,0.937255,0.772549,1.000000,0.000000,0.341176,0.992157,0.035294,0.019608,0.992157,0.047059,0.000000,0.992157,0.066667,0.000000,0.992157,0.466667,0.000000,1.000000,0.619608,0.141176,1.000000,0.941176,0.780392,0.992157,0.000000,0.333333,0.992157,0.035294,0.015686,0.992157,0.047059,0.000000,0.992157,0.070588,0.000000,0.992157,0.466667,0.000000,1.000000,0.627451,0.156863,1.000000,0.941176,0.772549,0.992157,0.000000,0.313726,0.992157,0.035294,0.007843,0.992157,0.047059,0.000000,0.992157,0.070588,0.000000,0.992157,0.458824,0.000000,1.000000,0.619608,0.137255,1.000000,0.941176,0.776471,0.980392,0.007843,0.313726,0.984314,0.039216,0.007843,0.992157,0.047059,0.000000,0.992157,0.074510,0.000000,1.000000,0.470588,0.000000,1.000000,0.615686,0.121569,1.000000,0.941176,0.776471,0.980392,0.733333,0.796078,0.980392,0.705882,0.682353,0.980392,0.631373,0.603922,0.980392,0.572549,0.521569,0.980392,0.713726,0.431373,0.980392,0.709804,0.341176,0.984314,0.945098,0.800000,0.980392,0.976471,0.964706,0.980392,0.972549,0.960784,0.980392,0.968627,0.956863,0.980392,0.968627,0.952941,0.980392,0.976471,0.949020,0.980392,0.976471,0.941176,0.980392,0.984314,0.952941,1.000000,0.000000,0.352941,0.992157,0.000000,0.352941,0.992157,0.000000,0.345098,0.992157,0.000000,0.345098,1.000000,0.000000,0.309804,1.000000,0.058824,0.329412,1.000000,0.850980,0.796078,0.992157,0.035294,0.031373,0.992157,0.035294,0.031373,0.992157,0.035294,0.027451,0.992157,0.035294,0.015686,1.000000,0.047059,0.011765,1.000000,0.152941,0.113725,1.000000,0.886275,0.780392,0.992157,0.047059,0.000000,0.992157,0.047059,0.000000,0.992157,0.047059,0.000000,0.992157,0.047059,0.000000,1.000000,0.047059,0.000000,1.000000,0.290196,0.227451,1.000000,0.905882,0.792157,0.992157,0.047059,0.000000,0.992157,0.047059,0.000000,0.992157,0.050980,0.000000,0.992157,0.054902,0.000000,1.000000,0.066667,0.000000,1.000000,0.368627,0.282353,1.000000,0.929412,0.811765,0.992157,0.431373,0.000000,0.992157,0.423529,0.000000,1.000000,0.431373,0.000000,1.000000,0.450980,0.000000,1.000000,0.466667,0.000000,1.000000,0.650980,0.294118,1.000000,0.952941,0.815686,1.000000,0.619608,0.141176,1.000000,0.650980,0.200000,1.000000,0.666667,0.227451,1.000000,0.705882,0.309804,1.000000,0.705882,0.301961,1.000000,0.780392,0.462745,1.000000,0.960784,0.823529,1.000000,0.945098,0.784314,1.000000,0.952941,0.800000,1.000000,0.956863,0.803922,1.000000,0.960784,0.811765,1.000000,0.960784,0.811765,1.000000,0.968627,0.827451,1.000000,0.988235,0.866667,0.992157,0.000000,0.470588,0.976471,0.000000,0.827451,0.968627,0.000000,0.992157,0.894118,0.000000,0.992157,0.180392,0.129412,0.992157,0.258824,0.556863,0.956863,0.913725,0.941176,0.878431,0.992157,0.000000,0.470588,0.976471,0.000000,0.815686,0.968627,0.000000,0.992157,0.901961,0.000000,0.992157,0.207843,0.113725,0.992157,0.380392,0.619608,0.937255,0.925490,0.952941,0.878431,0.992157,0.000000,0.466667,0.976471,0.000000,0.780392,0.968627,0.000000,0.992157,0.909804,0.000000,0.992157,0.207843,0.105882,0.992157,0.454902,0.658824,0.925490,0.937255,0.960784,0.878431,0.992157,0.000000,0.462745,0.976471,0.000000,0.741176,0.968627,0.000000,0.992157,0.925490,0.000000,0.992157,0.258824,0.101961,0.992157,0.560784,0.721569,0.917647,0.941176,0.956863,0.878431,0.992157,0.000000,0.458824,0.976471,0.000000,0.717647,0.968627,0.000000,0.992157,0.933333,0.000000,0.992157,0.274510,0.101961,0.984314,0.572549,0.737255,0.913725,0.941176,0.964706,0.878431,0.992157,0.113725,0.513726,0.976471,0.094118,0.725490,0.968627,0.070588,0.972549,0.937255,0.062745,0.972549,0.364706,0.168627,0.972549,0.592157,0.745098,0.909804,0.945098,0.964706,0.878431,0.992157,0.870588,0.823529,0.992157,0.858824,0.858824,0.988235,0.827451,0.890196,0.984314,0.847059,0.882353,0.886275,0.854902,0.882353,0.905882,0.929412,0.878431,0.984314,0.984314,0.878431,0.807843,0.447059,0.203922,0.784314,0.501961,0.188235,0.760784,0.556863,0.176471,0.737255,0.611765,0.160784,0.713726,0.666667,0.149020,0.690196,0.721569,0.133333,0.784314,0.854902,0.403922,0.968627,0.980392,0.819608,0.784314,0.450980,0.227451,0.760784,0.458824,0.254902,0.737255,0.466667,0.278431,0.713726,0.470588,0.305882,0.690196,0.478431,0.329412,0.729412,0.588235,0.458824,0.952941,0.929412,0.811765,0.831373,0.388235,0.215686,0.854902,0.333333,0.231373,0.878431,0.278431,0.243137,0.901961,0.223529,0.258824,0.925490,0.168627,0.270588,0.949020,0.164706,0.317647,0.988235,0.803922,0.756863,0.831373,0.439216,0.176471,0.854902,0.431373,0.152941,0.878431,0.423529,0.125490,0.901961,0.419608,0.101961,0.925490,0.411765,0.074510,0.949020,0.462745,0.141176,0.992157,0.913725,0.768627,0.811765,0.494118,0.164706,0.788235,0.549020,0.152941,0.768627,0.603922,0.141176,0.749020,0.654902,0.129412,0.729412,0.709804,0.117647,0.800000,0.835294,0.372549,0.972549,0.980392,0.819608,0.839216,0.486275,0.141176,0.819608,0.537255,0.129412,0.800000,0.592157,0.121569,0.784314,0.647059,0.109804,0.764706,0.698039,0.101961,0.835294,0.831373,0.376471,0.976471,0.976471,0.819608,0.862745,0.478431,0.117647,0.850980,0.529412,0.109804,0.835294,0.584314,0.101961,0.819608,0.635294,0.090196,0.803922,0.690196,0.082353,0.850980,0.823529,0.349020,0.980392,0.976471,0.819608,0.890196,0.470588,0.094118,0.878431,0.521569,0.086275,0.866667,0.572549,0.078431,0.854902,0.627451,0.074510,0.843137,0.678431,0.066667,0.882353,0.811765,0.337255,0.984314,0.980392,0.819608,0.917647,0.462745,0.070588,0.909804,0.513726,0.062745,0.898039,0.564706,0.058824,0.890196,0.615686,0.054902,0.882353,0.666667,0.050980,0.921569,0.835294,0.407843,0.984314,0.976471,0.819608,0.945098,0.498039,0.121569,0.937255,0.525490,0.086275,0.933333,0.572549,0.078431,0.925490,0.611765,0.070588,0.921569,0.666667,0.058824,0.945098,0.835294,0.443137,0.988235,0.976471,0.827451,0.988235,0.909804,0.749020,0.988235,0.905882,0.725490,0.988235,0.905882,0.713726,0.984314,0.909804,0.701961,0.984314,0.909804,0.694118,0.980392,0.945098,0.756863,0.992157,0.984314,0.850980,0.756863,0.509804,0.211765,0.729412,0.513726,0.235294,0.701961,0.521569,0.262745,0.678431,0.529412,0.286275,0.650980,0.537255,0.309804,0.678431,0.611765,0.411765,0.937255,0.925490,0.800000,0.729412,0.564706,0.196078,0.701961,0.572549,0.219608,0.670588,0.580392,0.243137,0.643137,0.588235,0.262745,0.611765,0.596078,0.286275,0.627451,0.650980,0.372549,0.929412,0.937255,0.792157,0.701961,0.619608,0.184314,0.670588,0.631373,0.203922,0.639216,0.639216,0.223529,0.603922,0.647059,0.243137,0.572549,0.658824,0.262745,0.580392,0.694118,0.349020,0.925490,0.941176,0.792157,0.678431,0.678431,0.168627,0.643137,0.686275,0.184314,0.603922,0.698039,0.203922,0.568627,0.705882,0.223529,0.533333,0.717647,0.243137,0.596078,0.776471,0.380392,0.937255,0.960784,0.811765,0.650980,0.733333,0.152941,0.611765,0.745098,0.168627,0.572549,0.756863,0.184314,0.533333,0.764706,0.203922,0.494118,0.776471,0.219608,0.666667,0.858824,0.478431,0.956863,0.976471,0.827451,0.752941,0.858824,0.403922,0.752941,0.874510,0.462745,0.768627,0.898039,0.521569,0.752941,0.905882,0.549020,0.780392,0.925490,0.607843,0.894118,0.960784,0.752941,0.980392,0.988235,0.858824,0.968627,0.980392,0.827451,0.964706,0.980392,0.827451,0.968627,0.984314,0.831373,0.964706,0.984314,0.835294,0.964706,0.984314,0.839216,0.976471,0.988235,0.850980,0.988235,0.988235,0.866667,0.811765,0.396078,0.243137,0.839216,0.337255,0.258824,0.862745,0.282353,0.274510,0.890196,0.227451,0.290196,0.917647,0.168627,0.305882,0.945098,0.141176,0.341176,0.988235,0.764706,0.745098,0.788235,0.400000,0.270588,0.819608,0.345098,0.286275,0.850980,0.286275,0.305882,0.878431,0.231373,0.321569,0.909804,0.172549,0.337255,0.937255,0.117647,0.360784,0.984314,0.725490,0.729412,0.768627,0.407843,0.298039,0.800000,0.349020,0.317647,0.835294,0.290196,0.337255,0.866667,0.231373,0.352941,0.898039,0.176471,0.372549,0.933333,0.125490,0.392157,0.980392,0.670588,0.713726,0.749020,0.411765,0.325490,0.784314,0.352941,0.345098,0.819608,0.294118,0.364706,0.854902,0.235294,0.388235,0.890196,0.176471,0.407843,0.925490,0.121569,0.427451,0.980392,0.682353,0.729412,0.729412,0.419608,0.352941,0.764706,0.356863,0.376471,0.803922,0.298039,0.396078,0.843137,0.239216,0.419608,0.882353,0.180392,0.443137,0.921569,0.121569,0.462745,0.984314,0.694118,0.745098,0.756863,0.525490,0.470588,0.807843,0.525490,0.521569,0.858824,0.545098,0.588235,0.894118,0.549020,0.623529,0.917647,0.505882,0.631373,0.945098,0.498039,0.654902,0.980392,0.792157,0.800000,0.960784,0.929412,0.823529,0.968627,0.937255,0.831373,0.980392,0.937255,0.843137,0.976471,0.933333,0.843137,0.984314,0.933333,0.847059,0.988235,0.933333,0.850980,0.992157,0.964706,0.862745,0.850980,0.384314,0.188235,0.874510,0.376471,0.160784,0.894118,0.372549,0.133333,0.913725,0.368627,0.105882,0.937255,0.360784,0.078431,0.956863,0.435294,0.164706,0.992157,0.913725,0.772549,0.874510,0.329412,0.200000,0.890196,0.325490,0.172549,0.909804,0.321569,0.141176,0.925490,0.313726,0.113725,0.945098,0.309804,0.086275,0.960784,0.411765,0.180392,0.992157,0.917647,0.784314,0.894118,0.274510,0.211765,0.909804,0.270588,0.180392,0.925490,0.266667,0.152941,0.937255,0.262745,0.121569,0.952941,0.258824,0.090196,0.968627,0.392157,0.207843,0.992157,0.921569,0.796078,0.913725,0.219608,0.223529,0.925490,0.215686,0.192157,0.937255,0.215686,0.160784,0.949020,0.211765,0.129412,0.960784,0.207843,0.094118,0.972549,0.384314,0.247059,0.992157,0.925490,0.800000,0.937255,0.164706,0.235294,0.945098,0.164706,0.203922,0.952941,0.160784,0.168627,0.960784,0.160784,0.133333,0.972549,0.156863,0.101961,0.980392,0.376471,0.278431,0.992157,0.921569,0.803922,0.956863,0.172549,0.290196,0.960784,0.180392,0.262745,0.968627,0.172549,0.227451,0.972549,0.160784,0.184314,0.980392,0.168627,0.160784,0.984314,0.403922,0.341176,0.992157,0.925490,0.815686,0.988235,0.839216,0.772549,0.992157,0.827451,0.756863,0.992157,0.819608,0.745098,0.992157,0.839216,0.756863,0.992157,0.835294,0.749020,0.992157,0.870588,0.768627,0.996078,0.960784,0.847059,1.000000,0.694118,0.498039,1.000000,0.717647,0.498039,1.000000,0.745098,0.498039,1.000000,0.768627,0.498039,1.000000,0.792157,0.498039,1.000000,0.815686,0.498039,1.000000,0.839216,0.505882,1.000000,0.960784,0.800000,1.000000,0.658824,0.435294,1.000000,0.619608,0.372549,1.000000,0.580392,0.309804,1.000000,0.545098,0.247059,1.000000,0.505882,0.184314,1.000000,0.525490,0.215686,1.000000,0.925490,0.776471,1.000000,0.670588,0.498039,1.000000,0.647059,0.498039,1.000000,0.623529,0.498039,1.000000,0.600000,0.498039,1.000000,0.572549,0.498039,1.000000,0.572549,0.513726,1.000000,0.898039,0.796078,1.000000,0.733333,0.560784,1.000000,0.772549,0.623529,1.000000,0.807843,0.686275,1.000000,0.847059,0.749020,1.000000,0.901961,0.819608,1.000000,0.980392,0.874510,1.000000,0.988235,0.878431,1.000000,0.752941,0.560784,1.000000,0.776471,0.560784,1.000000,0.796078,0.560784,1.000000,0.815686,0.560784,1.000000,0.839216,0.560784,1.000000,0.858824,0.568627,1.000000,0.964706,0.796078,1.000000,0.788235,0.623529,1.000000,0.807843,0.623529,1.000000,0.823529,0.623529,1.000000,0.843137,0.623529,1.000000,0.862745,0.623529,1.000000,0.878431,0.631373,1.000000,0.968627,0.811765,1.000000,0.823529,0.686275,1.000000,0.839216,0.686275,1.000000,0.854902,0.686275,1.000000,0.870588,0.686275,1.000000,0.882353,0.686275,0.996078,0.898039,0.686275,0.988235,0.972549,0.831373,1.000000,0.858824,0.749020,1.000000,0.870588,0.749020,1.000000,0.882353,0.749020,1.000000,0.894118,0.749020,0.992157,0.905882,0.749020,0.945098,0.917647,0.764706,0.956863,0.980392,0.862745,1.000000,0.913725,0.819608,1.000000,0.933333,0.831373,1.000000,0.937255,0.831373,1.000000,0.941176,0.823529,0.988235,0.937255,0.819608,0.933333,0.937255,0.827451,0.968627,0.984314,0.870588,1.000000,0.984314,0.874510,1.000000,0.984314,0.874510,1.000000,0.988235,0.874510,1.000000,0.988235,0.874510,1.000000,0.988235,0.874510,0.992157,0.984314,0.874510,0.992157,0.988235,0.874510,1.000000,0.988235,0.878431,1.000000,0.988235,0.878431,1.000000,0.988235,0.878431,1.000000,0.988235,0.878431,1.000000,0.988235,0.878431,1.000000,0.988235,0.878431,1.000000,0.988235,0.878431,1.000000,0.686275,0.435294,1.000000,0.650980,0.372549,1.000000,0.615686,0.309804,1.000000,0.580392,0.247059,1.000000,0.545098,0.184314,1.000000,0.560784,0.207843,1.000000,0.929412,0.780392,1.000000,0.709804,0.435294,1.000000,0.678431,0.372549,1.000000,0.647059,0.309804,1.000000,0.615686,0.247059,1.000000,0.584314,0.184314,1.000000,0.607843,0.219608,1.000000,0.937255,0.780392,1.000000,0.737255,0.435294,1.000000,0.709804,0.372549,1.000000,0.682353,0.309804,1.000000,0.650980,0.247059,1.000000,0.623529,0.184314,1.000000,0.639216,0.211765,1.000000,0.937255,0.768627,1.000000,0.764706,0.435294,1.000000,0.741176,0.372549,1.000000,0.713726,0.309804,1.000000,0.690196,0.247059,1.000000,0.662745,0.184314,1.000000,0.654902,0.172549,1.000000,0.933333,0.752941,1.000000,0.792157,0.435294,1.000000,0.768627,0.372549,1.000000,0.749020,0.309804,1.000000,0.725490,0.247059,1.000000,0.701961,0.184314,1.000000,0.698039,0.176471,1.000000,0.933333,0.737255,1.000000,0.823529,0.447059,1.000000,0.800000,0.392157,1.000000,0.784314,0.325490,1.000000,0.760784,0.254902,1.000000,0.741176,0.196078,1.000000,0.741176,0.207843,1.000000,0.956863,0.772549,1.000000,0.960784,0.784314,1.000000,0.956863,0.768627,1.000000,0.945098,0.737255,1.000000,0.945098,0.729412,1.000000,0.937255,0.701961,1.000000,0.925490,0.694118,1.000000,0.976471,0.839216,1.000000,0.631373,0.435294,1.000000,0.603922,0.435294,1.000000,0.576471,0.435294,1.000000,0.549020,0.435294,1.000000,0.521569,0.435294,1.000000,0.517647,0.458824,1.000000,0.890196,0.792157,1.000000,0.588235,0.372549,1.000000,0.560784,0.372549,1.000000,0.529412,0.372549,1.000000,0.498039,0.372549,1.000000,0.466667,0.372549,1.000000,0.466667,0.396078,1.000000,0.882353,0.780392,1.000000,0.549020,0.309804,1.000000,0.513726,0.309804,1.000000,0.482353,0.309804,1.000000,0.447059,0.309804,1.000000,0.415686,0.309804,1.000000,0.407843,0.337255,1.000000,0.854902,0.756863,1.000000,0.505882,0.247059,1.000000,0.470588,0.247059,1.000000,0.435294,0.247059,1.000000,0.400000,0.247059,1.000000,0.360784,0.247059,1.000000,0.356863,0.274510,1.000000,0.847059,0.745098,1.000000,0.466667,0.184314,1.000000,0.427451,0.184314,1.000000,0.388235,0.184314,1.000000,0.349020,0.184314,1.000000,0.309804,0.184314,1.000000,0.368627,0.278431,1.000000,0.882353,0.776471,1.000000,0.521569,0.247059,1.000000,0.498039,0.262745,1.000000,0.435294,0.231373,1.000000,0.384314,0.219608,1.000000,0.333333,0.200000,1.000000,0.384314,0.282353,1.000000,0.843137,0.733333,1.000000,0.921569,0.780392,1.000000,0.917647,0.788235,1.000000,0.913725,0.784314,1.000000,0.901961,0.780392,1.000000,0.890196,0.768627,1.000000,0.878431,0.764706,1.000000,0.933333,0.819608,1.000000,0.713726,0.560784,1.000000,0.752941,0.623529,1.000000,0.792157,0.686275,1.000000,0.835294,0.749020,1.000000,0.894118,0.819608,1.000000,0.980392,0.874510,1.000000,0.988235,0.878431,1.000000,0.690196,0.560784,1.000000,0.733333,0.623529,1.000000,0.780392,0.686275,1.000000,0.823529,0.749020,1.000000,0.894118,0.819608,1.000000,0.980392,0.874510,1.000000,0.988235,0.878431,1.000000,0.670588,0.560784,1.000000,0.717647,0.623529,1.000000,0.764706,0.686275,1.000000,0.811765,0.749020,1.000000,0.894118,0.823529,1.000000,0.980392,0.874510,1.000000,0.988235,0.878431,1.000000,0.647059,0.560784,1.000000,0.698039,0.623529,1.000000,0.749020,0.686275,1.000000,0.800000,0.749020,1.000000,0.886275,0.827451,1.000000,0.980392,0.874510,1.000000,0.988235,0.878431,1.000000,0.627451,0.560784,1.000000,0.678431,0.623529,1.000000,0.733333,0.686275,1.000000,0.784314,0.749020,1.000000,0.878431,0.823529,1.000000,0.980392,0.874510,1.000000,0.988235,0.878431,1.000000,0.615686,0.560784,1.000000,0.662745,0.623529,1.000000,0.717647,0.686275,1.000000,0.772549,0.749020,1.000000,0.878431,0.823529,1.000000,0.980392,0.874510,1.000000,0.988235,0.878431,1.000000,0.878431,0.788235,1.000000,0.874510,0.792157,1.000000,0.878431,0.800000,1.000000,0.886275,0.811765,1.000000,0.949020,0.854902,1.000000,0.980392,0.874510,1.000000,0.984314,0.878431,1.000000,0.501961,0.654902,1.000000,0.501961,0.635294,1.000000,0.501961,0.615686,1.000000,0.501961,0.596078,1.000000,0.501961,0.576471,1.000000,0.501961,0.556863,1.000000,0.643137,0.631373,1.000000,0.949020,0.843137,1.000000,0.439216,0.611765,1.000000,0.376471,0.568627,1.000000,0.313726,0.525490,1.000000,0.250980,0.482353,1.000000,0.188235,0.439216,1.000000,0.203922,0.435294,1.000000,0.854902,0.796078,1.000000,0.498039,0.674510,1.000000,0.498039,0.694118,1.000000,0.498039,0.713726,1.000000,0.498039,0.733333,1.000000,0.498039,0.752941,1.000000,0.698039,0.807843,1.000000,0.960784,0.866667,1.000000,0.560784,0.698039,1.000000,0.623529,0.741176,1.000000,0.686275,0.784314,1.000000,0.749020,0.827451,1.000000,0.811765,0.870588,1.000000,0.874510,0.913725,1.000000,0.937255,0.956863,1.000000,0.560784,0.682353,1.000000,0.560784,0.662745,1.000000,0.564706,0.647059,1.000000,0.564706,0.627451,1.000000,0.564706,0.611765,1.000000,0.705882,0.686275,1.000000,0.956863,0.850980,1.000000,0.623529,0.725490,1.000000,0.623529,0.709804,1.000000,0.623529,0.698039,1.000000,0.623529,0.682353,1.000000,0.623529,0.666667,1.000000,0.741176,0.713726,1.000000,0.960784,0.854902,1.000000,0.686275,0.772549,1.000000,0.686275,0.760784,1.000000,0.686275,0.745098,1.000000,0.686275,0.733333,1.000000,0.686275,0.721569,1.000000,0.756863,0.749020,1.000000,0.960784,0.858824,1.000000,0.749020,0.815686,1.000000,0.749020,0.807843,1.000000,0.749020,0.796078,1.000000,0.749020,0.788235,1.000000,0.749020,0.776471,1.000000,0.780392,0.780392,1.000000,0.960784,0.858824,1.000000,0.811765,0.862745,1.000000,0.811765,0.854902,1.000000,0.811765,0.847059,1.000000,0.811765,0.839216,1.000000,0.811765,0.831373,1.000000,0.823529,0.823529,1.000000,0.960784,0.862745,1.000000,0.874510,0.905882,1.000000,0.874510,0.901961,1.000000,0.874510,0.898039,1.000000,0.874510,0.894118,1.000000,0.874510,0.886275,1.000000,0.874510,0.878431,1.000000,0.964706,0.878431,1.000000,0.937255,0.952941,1.000000,0.937255,0.949020,1.000000,0.937255,0.949020,1.000000,0.937255,0.945098,1.000000,0.937255,0.941176,1.000000,0.937255,0.929412,1.000000,0.976471,0.878431,1.000000,0.439216,0.588235,1.000000,0.376471,0.545098,1.000000,0.313726,0.498039,1.000000,0.250980,0.454902,1.000000,0.188235,0.407843,1.000000,0.160784,0.384314,1.000000,0.811765,0.760784,1.000000,0.439216,0.568627,1.000000,0.376471,0.521569,1.000000,0.313726,0.470588,1.000000,0.250980,0.423529,1.000000,0.188235,0.376471,1.000000,0.137255,0.337255,1.000000,0.756863,0.721569,1.000000,0.439216,0.545098,1.000000,0.376471,0.494118,1.000000,0.313726,0.447059,1.000000,0.250980,0.396078,1.000000,0.188235,0.345098,1.000000,0.141176,0.301961,1.000000,0.752941,0.705882,1.000000,0.439216,0.525490,1.000000,0.376471,0.470588,1.000000,0.313726,0.419608,1.000000,0.250980,0.364706,1.000000,0.192157,0.313726,1.000000,0.133333,0.262745,1.000000,0.701961,0.662745,1.000000,0.439216,0.501961,1.000000,0.376471,0.447059,1.000000,0.313726,0.392157,1.000000,0.250980,0.337255,1.000000,0.192157,0.282353,1.000000,0.129412,0.227451,1.000000,0.635294,0.600000,1.000000,0.564706,0.560784,1.000000,0.478431,0.494118,1.000000,0.368627,0.400000,1.000000,0.301961,0.341176,1.000000,0.294118,0.329412,1.000000,0.266667,0.301961,1.000000,0.635294,0.588235,1.000000,0.933333,0.831373,1.000000,0.913725,0.815686,1.000000,0.894118,0.796078,1.000000,0.878431,0.780392,1.000000,0.890196,0.792157,1.000000,0.898039,0.792157,1.000000,0.941176,0.835294,1.000000,0.439216,0.635294,1.000000,0.435294,0.654902,1.000000,0.435294,0.678431,1.000000,0.435294,0.701961,1.000000,0.435294,0.721569,1.000000,0.647059,0.792157,1.000000,0.949020,0.866667,1.000000,0.376471,0.592157,1.000000,0.376471,0.619608,1.000000,0.376471,0.643137,1.000000,0.372549,0.666667,1.000000,0.372549,0.690196,1.000000,0.552941,0.756863,1.000000,0.937255,0.862745,1.000000,0.313726,0.552941,1.000000,0.313726,0.580392,1.000000,0.313726,0.607843,1.000000,0.313726,0.635294,1.000000,0.309804,0.662745,1.000000,0.521569,0.745098,1.000000,0.937255,0.858824,1.000000,0.250980,0.513726,1.000000,0.250980,0.541176,1.000000,0.250980,0.572549,1.000000,0.250980,0.600000,1.000000,0.250980,0.631373,1.000000,0.450980,0.713726,1.000000,0.925490,0.854902,1.000000,0.188235,0.470588,1.000000,0.188235,0.505882,1.000000,0.188235,0.537255,1.000000,0.188235,0.568627,1.000000,0.188235,0.600000,1.000000,0.372549,0.682353,1.000000,0.925490,0.854902,1.000000,0.231373,0.486275,1.000000,0.180392,0.490196,1.000000,0.152941,0.513726,1.000000,0.152941,0.545098,1.000000,0.152941,0.572549,1.000000,0.384314,0.678431,1.000000,0.917647,0.850980,1.000000,0.850980,0.796078,1.000000,0.835294,0.796078,1.000000,0.807843,0.792157,1.000000,0.800000,0.788235,1.000000,0.776471,0.788235,1.000000,0.850980,0.823529,1.000000,0.964706,0.862745,1.000000,0.560784,0.713726,1.000000,0.623529,0.756863,1.000000,0.686275,0.796078,1.000000,0.749020,0.835294,1.000000,0.811765,0.878431,1.000000,0.874510,0.917647,1.000000,0.937255,0.956863,1.000000,0.560784,0.733333,1.000000,0.623529,0.768627,1.000000,0.686275,0.807843,1.000000,0.749020,0.847059,1.000000,0.811765,0.882353,1.000000,0.874510,0.921569,1.000000,0.937255,0.960784,1.000000,0.560784,0.749020,1.000000,0.623529,0.784314,1.000000,0.686275,0.819608,1.000000,0.749020,0.854902,1.000000,0.811765,0.890196,1.000000,0.874510,0.925490,1.000000,0.937255,0.960784,1.000000,0.560784,0.764706,1.000000,0.623529,0.800000,1.000000,0.686275,0.831373,1.000000,0.749020,0.866667,1.000000,0.811765,0.898039,1.000000,0.874510,0.933333,1.000000,0.937255,0.964706,1.000000,0.560784,0.784314,1.000000,0.623529,0.815686,1.000000,0.686275,0.843137,1.000000,0.749020,0.874510,1.000000,0.811765,0.901961,1.000000,0.874510,0.925490,1.000000,0.937255,0.956863,1.000000,0.756863,0.827451,1.000000,0.815686,0.850980,1.000000,0.847059,0.862745,1.000000,0.898039,0.878431,1.000000,0.925490,0.878431,1.000000,0.945098,0.890196,1.000000,0.968627,0.894118,1.000000,0.964706,0.866667,1.000000,0.968627,0.870588,1.000000,0.972549,0.870588,1.000000,0.976471,0.878431,1.000000,0.980392,0.878431,1.000000,0.984314,0.878431,1.000000,0.988235,0.878431,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.984314,0.725490,0.905882,0.992157,0.725490,0.905882,0.988235,0.776471,0.905882,0.956863,0.968627,0.933333,0.866667,0.725490,0.905882,0.980392,0.725490,0.905882,0.988235,0.725490,0.905882,0.980392,0.725490,0.905882,0.988235,0.725490,0.905882,0.992157,0.725490,0.905882,0.984314,0.866667,0.921569,0.886275,0.725490,0.905882,0.988235,0.729412,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.992157,0.725490,0.905882,0.988235,0.768627,0.909804,0.964706,0.964706,0.972549,0.862745,0.725490,0.905882,0.984314,0.737255,0.905882,0.980392,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.850980,0.929412,0.917647,0.725490,0.905882,0.988235,0.725490,0.905882,0.984314,0.725490,0.905882,0.980392,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.772549,0.905882,0.964706,0.968627,0.945098,0.870588,0.729412,0.905882,0.984314,0.729412,0.905882,0.984314,0.725490,0.905882,0.980392,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.780392,0.909804,0.960784,0.964706,0.949020,0.874510,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.984314,0.725490,0.905882,0.992157,0.725490,0.905882,0.988235,0.776471,0.909804,0.964706,0.972549,0.952941,0.874510,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.988235,0.796078,0.917647,0.960784,0.976471,0.960784,0.878431,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.737255,0.905882,0.988235,0.835294,0.925490,0.937255,0.984314,0.964706,0.878431,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.988235,0.745098,0.905882,0.976471,0.815686,0.925490,0.945098,0.945098,0.964706,0.894118,0.992157,0.980392,0.878431,0.870588,0.937255,0.909804,0.878431,0.941176,0.901961,0.925490,0.952941,0.890196,0.949020,0.968627,0.882353,0.976471,0.972549,0.878431,0.992157,0.984314,0.878431,0.996078,0.984314,0.878431,0.725490,0.905882,0.984314,0.725490,0.905882,0.988235,0.725490,0.905882,0.984314,0.725490,0.905882,0.988235,0.725490,0.905882,0.992157,0.729412,0.905882,0.984314,0.878431,0.917647,0.878431,0.725490,0.905882,0.984314,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.737255,0.905882,0.980392,0.890196,0.909804,0.870588,0.725490,0.905882,0.980392,0.725490,0.905882,0.980392,0.725490,0.905882,0.984314,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.745098,0.905882,0.976471,0.921569,0.905882,0.854902,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.784314,0.905882,0.949020,0.949020,0.905882,0.835294,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.729412,0.905882,0.988235,0.725490,0.905882,0.988235,0.752941,0.905882,0.972549,0.870588,0.905882,0.890196,0.968627,0.894118,0.831373,0.776471,0.905882,0.960784,0.780392,0.905882,0.956863,0.780392,0.905882,0.956863,0.819608,0.905882,0.933333,0.898039,0.905882,0.886275,0.972549,0.886275,0.839216,0.976471,0.862745,0.827451,0.968627,0.921569,0.862745,0.968627,0.913725,0.858824,0.972549,0.905882,0.854902,0.980392,0.894118,0.847059,0.992157,0.898039,0.847059,0.988235,0.878431,0.843137,0.984314,0.850980,0.827451,0.725490,0.905882,0.984314,0.725490,0.905882,0.984314,0.725490,0.905882,0.980392,0.725490,0.905882,0.988235,0.725490,0.905882,0.992157,0.756863,0.905882,0.972549,0.952941,0.972549,0.858824,0.729412,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.992157,0.737255,0.905882,0.980392,0.917647,0.960784,0.870588,0.725490,0.905882,0.980392,0.725490,0.905882,0.984314,0.725490,0.905882,0.984314,0.725490,0.905882,0.984314,0.725490,0.905882,0.988235,0.733333,0.905882,0.984314,0.878431,0.949020,0.894118,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.984314,0.725490,0.905882,0.988235,0.741176,0.905882,0.976471,0.866667,0.945098,0.909804,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.988235,0.776471,0.913725,0.956863,0.921569,0.964706,0.870588,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.729412,0.905882,0.984314,0.760784,0.909804,0.964706,0.862745,0.945098,0.898039,0.956863,0.980392,0.847059,0.854902,0.917647,0.890196,0.854902,0.925490,0.890196,0.858824,0.937255,0.890196,0.858824,0.941176,0.894118,0.894118,0.956863,0.878431,0.945098,0.976471,0.847059,0.960784,0.988235,0.843137,0.725490,0.905882,0.988235,0.741176,0.905882,0.980392,0.725490,0.905882,0.988235,0.725490,0.905882,0.988235,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.854902,0.933333,0.925490,0.725490,0.905882,0.988235,0.737255,0.905882,0.980392,0.725490,0.905882,0.988235,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.874510,0.933333,0.909804,0.725490,0.905882,0.984314,0.725490,0.905882,0.980392,0.725490,0.905882,0.988235,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.984314,0.886275,0.941176,0.909804,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.992157,0.725490,0.905882,0.988235,0.733333,0.905882,0.980392,0.756863,0.905882,0.976471,0.929412,0.960784,0.898039,0.725490,0.905882,0.988235,0.725490,0.905882,0.992157,0.729412,0.905882,0.992157,0.749020,0.909804,0.980392,0.807843,0.925490,0.949020,0.854902,0.945098,0.937255,0.968627,0.980392,0.882353,0.772549,0.909804,0.960784,0.780392,0.913725,0.960784,0.788235,0.921569,0.956863,0.878431,0.945098,0.913725,0.956863,0.972549,0.878431,0.980392,0.984314,0.882353,0.992157,0.992157,0.878431,0.956863,0.972549,0.862745,0.964706,0.972549,0.866667,0.972549,0.976471,0.866667,0.988235,0.988235,0.870588,0.988235,0.988235,0.870588,0.992157,0.992157,0.878431,0.992157,0.996078,0.878431,0.733333,0.945098,0.529412,0.780392,0.937255,0.525490,0.819608,0.929412,0.517647,0.815686,0.921569,0.513726,0.772549,0.921569,0.501961,0.776471,0.917647,0.498039,0.850980,0.913725,0.549020,0.984314,0.976471,0.831373,0.133333,0.984314,0.462745,0.023529,0.992157,0.443137,0.054902,0.992157,0.482353,0.290196,0.964706,0.886275,0.345098,0.949020,0.984314,0.239216,0.721569,0.960784,0.756863,0.862745,0.894118,0.701961,0.949020,0.533333,0.650980,0.956863,0.529412,0.596078,0.964706,0.533333,0.564706,0.972549,0.533333,0.541176,0.976471,0.533333,0.533333,0.984314,0.556863,0.909804,0.992157,0.811765,0.784314,0.937255,0.490196,0.760784,0.929412,0.431373,0.737255,0.921569,0.376471,0.713726,0.917647,0.321569,0.690196,0.909804,0.262745,0.666667,0.901961,0.207843,0.874510,0.952941,0.627451,0.811765,0.929412,0.482353,0.839216,0.921569,0.474510,0.862745,0.913725,0.470588,0.890196,0.905882,0.462745,0.917647,0.898039,0.454902,0.945098,0.901961,0.513726,0.992157,0.980392,0.819608,0.788235,0.921569,0.427451,0.819608,0.913725,0.419608,0.850980,0.901961,0.411765,0.878431,0.894118,0.403922,0.909804,0.886275,0.396078,0.937255,0.890196,0.462745,0.992157,0.976471,0.811765,0.768627,0.913725,0.368627,0.800000,0.901961,0.360784,0.835294,0.894118,0.352941,0.866667,0.886275,0.345098,0.898039,0.874510,0.337255,0.941176,0.886275,0.443137,0.992157,0.972549,0.811765,0.749020,0.905882,0.309804,0.784314,0.894118,0.301961,0.819608,0.886275,0.294118,0.854902,0.874510,0.282353,0.890196,0.862745,0.274510,0.937255,0.882353,0.419608,0.988235,0.972549,0.807843,0.729412,0.898039,0.254902,0.764706,0.886275,0.243137,0.803922,0.874510,0.235294,0.843137,0.862745,0.223529,0.882353,0.854902,0.215686,0.929412,0.866667,0.345098,0.992157,0.972549,0.800000,0.705882,0.890196,0.196078,0.749020,0.878431,0.192157,0.788235,0.866667,0.188235,0.831373,0.854902,0.172549,0.874510,0.843137,0.164706,0.921569,0.854902,0.286275,0.988235,0.964706,0.776471,0.890196,0.949020,0.639216,0.917647,0.956863,0.670588,0.937255,0.956863,0.682353,0.945098,0.945098,0.670588,0.956863,0.941176,0.662745,0.964706,0.933333,0.635294,0.984314,0.964706,0.792157,0.160784,0.984314,0.462745,0.027451,0.992157,0.443137,0.047059,0.992157,0.478431,0.274510,0.964706,0.862745,0.345098,0.952941,0.988235,0.239216,0.725490,0.964706,0.756863,0.862745,0.894118,0.188235,0.976471,0.466667,0.027451,0.992157,0.443137,0.047059,0.988235,0.470588,0.266667,0.960784,0.847059,0.352941,0.949020,0.984314,0.250980,0.749020,0.964706,0.768627,0.866667,0.894118,0.156863,0.980392,0.458824,0.027451,0.992157,0.443137,0.058824,0.988235,0.474510,0.286275,0.960784,0.866667,0.349020,0.952941,0.988235,0.266667,0.760784,0.964706,0.760784,0.858824,0.894118,0.129412,0.984314,0.454902,0.027451,0.992157,0.443137,0.082353,0.984314,0.482353,0.317647,0.956863,0.901961,0.349020,0.956863,0.984314,0.305882,0.796078,0.964706,0.784314,0.874510,0.894118,0.109804,0.984314,0.447059,0.035294,0.992157,0.443137,0.101961,0.984314,0.482353,0.321569,0.956863,0.913725,0.356863,0.956863,0.984314,0.352941,0.839216,0.960784,0.796078,0.882353,0.894118,0.298039,0.980392,0.529412,0.227451,0.992157,0.529412,0.290196,0.984314,0.556863,0.439216,0.956863,0.878431,0.552941,0.960784,0.941176,0.603922,0.886275,0.901961,0.894118,0.933333,0.878431,0.925490,0.988235,0.831373,0.905882,0.988235,0.827451,0.913725,0.988235,0.831373,0.937255,0.988235,0.878431,0.945098,0.984314,0.878431,0.952941,0.972549,0.878431,0.976471,0.980392,0.878431,0.113725,0.988235,0.458824,0.094118,0.988235,0.454902,0.078431,0.992157,0.454902,0.062745,0.992157,0.450980,0.066667,0.992157,0.454902,0.086275,0.992157,0.462745,0.796078,0.992157,0.784314,0.023529,0.992157,0.443137,0.023529,0.992157,0.443137,0.023529,0.992157,0.443137,0.023529,0.992157,0.447059,0.023529,0.992157,0.447059,0.047059,0.992157,0.454902,0.780392,0.992157,0.776471,0.054902,0.992157,0.490196,0.062745,0.988235,0.501961,0.090196,0.984314,0.525490,0.098039,0.984314,0.545098,0.101961,0.984314,0.545098,0.145098,0.984314,0.556863,0.819608,0.988235,0.803922,0.305882,0.964706,0.917647,0.317647,0.964706,0.929412,0.329412,0.956863,0.949020,0.329412,0.956863,0.952941,0.341176,0.956863,0.952941,0.396078,0.956863,0.933333,0.890196,0.984314,0.878431,0.345098,0.949020,0.988235,0.337255,0.949020,0.988235,0.337255,0.945098,0.988235,0.337255,0.941176,0.988235,0.337255,0.941176,0.988235,0.427451,0.925490,0.956863,0.909804,0.972549,0.878431,0.266667,0.737255,0.964706,0.278431,0.741176,0.964706,0.247059,0.729412,0.964706,0.200000,0.694118,0.968627,0.235294,0.725490,0.968627,0.392157,0.756863,0.941176,0.917647,0.952941,0.878431,0.831373,0.901961,0.886275,0.843137,0.913725,0.886275,0.839216,0.905882,0.886275,0.811765,0.890196,0.886275,0.839216,0.905882,0.886275,0.862745,0.917647,0.878431,0.968627,0.976471,0.878431,0.756863,0.945098,0.498039,0.729412,0.937255,0.439216,0.701961,0.933333,0.384314,0.678431,0.925490,0.329412,0.650980,0.921569,0.274510,0.623529,0.913725,0.219608,0.854902,0.960784,0.635294,0.729412,0.952941,0.501961,0.701961,0.945098,0.447059,0.670588,0.941176,0.392157,0.643137,0.937255,0.337255,0.611765,0.929412,0.282353,0.580392,0.925490,0.235294,0.850980,0.964706,0.643137,0.701961,0.960784,0.509804,0.670588,0.956863,0.454902,0.639216,0.949020,0.400000,0.603922,0.945098,0.349020,0.572549,0.941176,0.294118,0.541176,0.937255,0.243137,0.839216,0.968627,0.654902,0.678431,0.968627,0.517647,0.643137,0.964706,0.462745,0.603922,0.960784,0.407843,0.568627,0.956863,0.356863,0.533333,0.952941,0.301961,0.501961,0.949020,0.258824,0.843137,0.972549,0.682353,0.650980,0.976471,0.521569,0.611765,0.972549,0.470588,0.572549,0.968627,0.419608,0.533333,0.968627,0.364706,0.494118,0.964706,0.313726,0.470588,0.960784,0.270588,0.858824,0.984314,0.717647,0.666667,0.984314,0.556863,0.643137,0.980392,0.537255,0.611765,0.980392,0.498039,0.576471,0.976471,0.450980,0.564706,0.976471,0.427451,0.584314,0.972549,0.447059,0.898039,0.984314,0.772549,0.933333,0.992157,0.823529,0.941176,0.988235,0.827451,0.937255,0.988235,0.823529,0.941176,0.988235,0.823529,0.937255,0.988235,0.819608,0.945098,0.988235,0.823529,0.968627,0.988235,0.847059,0.980392,0.988235,0.937255,0.980392,0.992157,0.968627,0.972549,0.992157,0.976471,0.980392,0.992157,0.976471,0.980392,0.988235,0.976471,0.980392,0.984314,0.972549,0.980392,0.988235,0.972549,0.980392,0.988235,0.968627,0.980392,0.984314,0.968627,0.980392,0.984314,0.964706,0.980392,0.984314,0.964706,0.980392,0.984314,0.968627,0.980392,0.988235,0.972549,0.980392,0.988235,0.972549,0.980392,0.988235,0.964706,0.976471,0.980392,0.890196,0.960784,0.968627,0.878431,0.956863,0.968627,0.878431,0.952941,0.964706,0.878431,0.949020,0.968627,0.878431,0.952941,0.968627,0.878431,0.952941,0.968627,0.878431,0.952941,0.968627,0.878431,0.949020,0.968627,0.878431,0.949020,0.968627,0.878431,0.945098,0.964706,0.878431,0.941176,0.960784,0.878431,0.941176,0.960784,0.878431,0.945098,0.964706,0.878431,0.976471,0.980392,0.878431,1.000000,0.988235,0.878431,0.992157,0.988235,0.878431,0.980392,0.988235,0.878431,0.980392,0.988235,0.870588,0.992157,0.988235,0.866667,1.000000,0.988235,0.862745,1.000000,0.984314,0.858824,1.000000,0.984314,0.854902,1.000000,0.984314,0.854902,1.000000,0.984314,0.850980,1.000000,0.984314,0.847059,1.000000,0.984314,0.847059,1.000000,0.984314,0.843137,1.000000,0.980392,0.839216,1.000000,0.988235,0.858824,0.984314,0.980392,0.909804,0.992157,0.968627,0.839216,1.000000,0.972549,0.839216,1.000000,0.972549,0.835294,1.000000,0.972549,0.835294,1.000000,0.972549,0.835294,1.000000,0.972549,0.835294,1.000000,0.972549,0.835294,1.000000,0.972549,0.835294,1.000000,0.968627,0.835294,1.000000,0.968627,0.831373,1.000000,0.968627,0.827451,1.000000,0.968627,0.831373,1.000000,0.976471,0.839216,1.000000,0.988235,0.870588,1.000000,0.988235,0.878431,1.000000,0.988235,0.874510,1.000000,0.984314,0.870588,1.000000,0.976471,0.866667,1.000000,0.976471,0.866667,1.000000,0.972549,0.858824,1.000000,0.968627,0.854902,1.000000,0.968627,0.858824,1.000000,0.968627,0.850980,1.000000,0.964706,0.850980,1.000000,0.964706,0.847059,1.000000,0.960784,0.850980,1.000000,0.956863,0.843137,1.000000,0.913725,0.807843,1.000000,0.949020,0.835294,1.000000,0.988235,0.870588,1.000000,0.972549,0.839216,1.000000,0.964706,0.831373,1.000000,0.952941,0.839216,1.000000,0.952941,0.843137,1.000000,0.956863,0.847059,1.000000,0.956863,0.858824,0.992157,0.956863,0.858824,0.992157,0.952941,0.866667,0.992157,0.949020,0.878431,0.992157,0.952941,0.878431,0.988235,0.956863,0.878431,0.964706,0.956863,0.878431,0.964706,0.968627,0.878431,0.992157,0.988235,0.878431,1.000000,0.988235,0.878431,1.000000,0.980392,0.878431,1.000000,0.976471,0.878431,1.000000,0.972549,0.878431,1.000000,0.976471,0.878431,1.000000,0.972549,0.870588,1.000000,0.968627,0.870588,1.000000,0.968627,0.870588,1.000000,0.964706,0.866667,1.000000,0.960784,0.866667,1.000000,0.960784,0.866667,1.000000,0.960784,0.866667,1.000000,0.956863,0.866667,1.000000,0.952941,0.862745,1.000000,0.956863,0.866667,0.988235,0.996078,0.878431,0.988235,0.996078,0.878431,0.988235,0.996078,0.870588,0.984314,0.996078,0.870588,0.984314,0.996078,0.866667,0.980392,0.996078,0.866667,0.980392,0.996078,0.862745,0.976471,0.996078,0.862745,0.976471,0.996078,0.858824,0.972549,0.996078,0.854902,0.972549,0.996078,0.854902,0.968627,0.996078,0.850980,0.968627,0.996078,0.847059,0.964706,0.996078,0.847059,0.960784,0.996078,0.843137,1.000000,0.984314,0.850980,1.000000,0.976471,0.839216,1.000000,0.976471,0.839216,1.000000,0.972549,0.835294,1.000000,0.972549,0.835294,1.000000,0.968627,0.835294,1.000000,0.964706,0.835294,1.000000,0.964706,0.839216,1.000000,0.964706,0.835294,1.000000,0.960784,0.835294,1.000000,0.956863,0.835294,1.000000,0.952941,0.835294,1.000000,0.949020,0.831373,1.000000,0.945098,0.831373,1.000000,0.945098,0.827451,0.992157,0.980392,0.827451,0.988235,0.980392,0.823529,0.988235,0.984314,0.827451,0.984314,0.980392,0.831373,0.984314,0.984314,0.835294,0.980392,0.984314,0.835294,0.976471,0.984314,0.839216,0.976471,0.984314,0.835294,0.972549,0.984314,0.835294,0.972549,0.988235,0.831373,0.964706,0.984314,0.835294,0.964706,0.988235,0.831373,0.956863,0.988235,0.827451,0.956863,0.988235,0.831373,0.968627,0.988235,0.847059,1.000000,0.956863,0.843137,1.000000,0.949020,0.839216,1.000000,0.952941,0.843137,1.000000,0.949020,0.843137,1.000000,0.952941,0.843137,1.000000,0.949020,0.847059,1.000000,0.949020,0.847059,1.000000,0.952941,0.850980,1.000000,0.949020,0.850980,1.000000,0.945098,0.850980,1.000000,0.945098,0.850980,1.000000,0.945098,0.850980,1.000000,0.945098,0.854902,1.000000,0.952941,0.858824,1.000000,0.984314,0.870588,0.992157,0.976471,0.866667,0.988235,0.952941,0.858824,0.988235,0.956863,0.854902,0.984314,0.956863,0.858824,0.984314,0.960784,0.854902,0.980392,0.960784,0.854902,0.980392,0.968627,0.850980,0.980392,0.972549,0.854902,0.976471,0.972549,0.854902,0.972549,0.976471,0.850980,0.972549,0.976471,0.850980,0.968627,0.976471,0.847059,0.968627,0.984314,0.847059,0.980392,0.988235,0.858824,0.984314,0.988235,0.866667,0.968627,0.976471,0.890196,0.980392,0.972549,0.913725,1.000000,0.988235,0.870588,0.984314,0.984314,0.878431,1.000000,0.972549,0.800000,1.000000,0.890196,0.784314,1.000000,0.988235,0.870588,0.956863,0.996078,0.835294], + + 'uvs': [], + + 'triangles': [], + 'triangles_n': [], + 'triangles_uv': [], + 'triangles_n_uv': [], + + 'quads': [], + 'quads_n': [0,22,29,1,0,0,0,0,0,1,29,30,2,0,0,0,0,0,2,30,31,3,0,0,0,0,0,3,31,32,4,0,0,0,0,0,4,32,33,5,0,0,0,0,0,5,33,34,6,0,0,0,0,0,6,34,35,7,0,0,0,0,0,7,35,1356,1357,0,0,0,1,1,22,23,36,29,0,0,0,0,0,29,36,37,30,0,0,0,0,0,30,37,38,31,0,0,0,0,0,31,38,39,32,0,0,0,0,0,32,39,40,33,0,0,0,0,0,33,40,41,34,0,0,0,0,0,34,41,42,35,0,0,0,0,0,35,42,1355,1356,0,0,0,1,1,23,24,43,36,0,0,0,0,0,36,43,44,37,0,0,0,0,0,37,44,45,38,0,0,0,0,0,38,45,46,39,0,0,0,0,0,39,46,47,40,0,0,0,0,0,40,47,48,41,0,0,0,0,0,41,48,49,42,0,0,0,0,0,42,49,1354,1355,0,0,0,1,1,24,25,50,43,0,0,0,0,0,43,50,51,44,0,0,0,0,0,44,51,52,45,0,0,0,0,0,45,52,53,46,0,0,0,0,0,46,53,54,47,0,0,0,0,0,47,54,55,48,0,0,0,0,0,48,55,56,49,0,0,0,0,0,49,56,1353,1354,0,0,0,1,1,25,26,57,50,0,0,0,0,0,50,57,58,51,0,0,0,0,0,51,58,59,52,0,0,0,0,0,52,59,60,53,0,0,0,0,0,53,60,61,54,0,0,0,0,0,54,61,62,55,0,0,0,0,0,55,62,63,56,0,0,0,0,0,56,63,1352,1353,0,0,0,1,1,26,27,64,57,0,0,0,0,0,57,64,65,58,0,0,0,0,0,58,65,66,59,0,0,0,0,0,59,66,67,60,0,0,0,0,0,60,67,68,61,0,0,0,0,0,61,68,69,62,0,0,0,0,0,62,69,70,63,0,0,0,0,0,63,70,1351,1352,0,0,0,1,1,27,28,71,64,0,0,0,0,0,64,71,72,65,0,0,0,0,0,65,72,73,66,0,0,0,0,0,66,73,74,67,0,0,0,0,0,67,74,75,68,0,0,0,0,0,68,75,76,69,0,0,0,0,0,69,76,77,70,0,0,0,0,0,70,77,1350,1351,0,0,0,1,1,28,1372,1371,71,0,0,2,2,0,71,1371,1370,72,0,0,2,2,0,72,1370,1369,73,0,0,2,2,0,73,1369,1368,74,0,0,2,2,0,74,1368,1367,75,0,0,2,2,0,75,1367,1366,76,0,0,2,2,0,76,1366,1365,77,0,0,2,2,0,77,1365,1530,1350,0,0,2,3,1,0,1,78,8,0,0,0,0,0,8,78,79,9,0,0,0,0,0,9,79,80,10,0,0,0,0,0,10,80,81,11,0,0,0,0,0,11,81,82,12,0,0,0,0,0,12,82,83,13,0,0,0,0,0,13,83,84,14,0,0,0,0,0,14,84,1401,1402,0,0,0,4,4,1,2,85,78,0,0,0,0,0,78,85,86,79,0,0,0,0,0,79,86,87,80,0,0,0,0,0,80,87,88,81,0,0,0,0,0,81,88,89,82,0,0,0,0,0,82,89,90,83,0,0,0,0,0,83,90,91,84,0,0,0,0,0,84,91,1400,1401,0,0,0,4,4,2,3,92,85,0,0,0,0,0,85,92,93,86,0,0,0,0,0,86,93,94,87,0,0,0,0,0,87,94,95,88,0,0,0,0,0,88,95,96,89,0,0,0,0,0,89,96,97,90,0,0,0,0,0,90,97,98,91,0,0,0,0,0,91,98,1399,1400,0,0,0,4,4,3,4,99,92,0,0,0,0,0,92,99,100,93,0,0,0,0,0,93,100,101,94,0,0,0,0,0,94,101,102,95,0,0,0,0,0,95,102,103,96,0,0,0,0,0,96,103,104,97,0,0,0,0,0,97,104,105,98,0,0,0,0,0,98,105,1398,1399,0,0,0,4,4,4,5,106,99,0,0,0,0,0,99,106,107,100,0,0,0,0,0,100,107,108,101,0,0,0,0,0,101,108,109,102,0,0,0,0,0,102,109,110,103,0,0,0,0,0,103,110,111,104,0,0,0,0,0,104,111,112,105,0,0,0,0,0,105,112,1397,1398,0,0,0,4,4,5,6,113,106,0,0,0,0,0,106,113,114,107,0,0,0,0,0,107,114,115,108,0,0,0,0,0,108,115,116,109,0,0,0,0,0,109,116,117,110,0,0,0,0,0,110,117,118,111,0,0,0,0,0,111,118,119,112,0,0,0,0,0,112,119,1396,1397,0,0,0,4,4,6,7,120,113,0,0,0,0,0,113,120,121,114,0,0,0,0,0,114,121,122,115,0,0,0,0,0,115,122,123,116,0,0,0,0,0,116,123,124,117,0,0,0,0,0,117,124,125,118,0,0,0,0,0,118,125,126,119,0,0,0,0,0,119,126,1395,1396,0,0,0,4,4,7,1357,1358,120,0,0,1,1,0,120,1358,1359,121,0,0,1,1,0,121,1359,1360,122,0,0,1,1,0,122,1360,1361,123,0,0,1,1,0,123,1361,1362,124,0,0,1,1,0,124,1362,1363,125,0,0,1,1,0,125,1363,1364,126,0,0,1,1,0,126,1364,1531,1395,0,0,1,5,4,0,8,127,15,0,0,0,0,0,15,127,128,16,0,0,0,0,0,16,128,129,17,0,0,0,0,0,17,129,130,18,0,0,0,0,0,18,130,131,19,0,0,0,0,0,19,131,132,20,0,0,0,0,0,20,132,133,21,0,0,0,0,0,21,133,1431,1432,0,0,0,6,6,8,9,134,127,0,0,0,0,0,127,134,135,128,0,0,0,0,0,128,135,136,129,0,0,0,0,0,129,136,137,130,0,0,0,0,0,130,137,138,131,0,0,0,0,0,131,138,139,132,0,0,0,0,0,132,139,140,133,0,0,0,0,0,133,140,1430,1431,0,0,0,6,6,9,10,141,134,0,0,0,0,0,134,141,142,135,0,0,0,0,0,135,142,143,136,0,0,0,0,0,136,143,144,137,0,0,0,0,0,137,144,145,138,0,0,0,0,0,138,145,146,139,0,0,0,0,0,139,146,147,140,0,0,0,0,0,140,147,1429,1430,0,0,0,6,6,10,11,148,141,0,0,0,0,0,141,148,149,142,0,0,0,0,0,142,149,150,143,0,0,0,0,0,143,150,151,144,0,0,0,0,0,144,151,152,145,0,0,0,0,0,145,152,153,146,0,0,0,0,0,146,153,154,147,0,0,0,0,0,147,154,1428,1429,0,0,0,6,6,11,12,155,148,0,0,0,0,0,148,155,156,149,0,0,0,0,0,149,156,157,150,0,0,0,0,0,150,157,158,151,0,0,0,0,0,151,158,159,152,0,0,0,0,0,152,159,160,153,0,0,0,0,0,153,160,161,154,0,0,0,0,0,154,161,1427,1428,0,0,0,6,6,12,13,162,155,0,0,0,0,0,155,162,163,156,0,0,0,0,0,156,163,164,157,0,0,0,0,0,157,164,165,158,0,0,0,0,0,158,165,166,159,0,0,0,0,0,159,166,167,160,0,0,0,0,0,160,167,168,161,0,0,0,0,0,161,168,1426,1427,0,0,0,6,6,13,14,169,162,0,0,0,0,0,162,169,170,163,0,0,0,0,0,163,170,171,164,0,0,0,0,0,164,171,172,165,0,0,0,0,0,165,172,173,166,0,0,0,0,0,166,173,174,167,0,0,0,0,0,167,174,175,168,0,0,0,0,0,168,175,1425,1426,0,0,0,6,6,14,1402,1403,169,0,0,4,4,0,169,1403,1404,170,0,0,4,4,0,170,1404,1405,171,0,0,4,4,0,171,1405,1406,172,0,0,4,4,0,172,1406,1407,173,0,0,4,4,0,173,1407,1408,174,0,0,4,4,0,174,1408,1409,175,0,0,4,4,0,175,1409,1532,1425,0,0,4,7,6,0,15,176,22,0,0,0,0,0,22,176,177,23,0,0,0,0,0,23,177,178,24,0,0,0,0,0,24,178,179,25,0,0,0,0,0,25,179,180,26,0,0,0,0,0,26,180,181,27,0,0,0,0,0,27,181,182,28,0,0,0,0,0,28,182,1373,1372,0,0,0,2,2,15,16,183,176,0,0,0,0,0,176,183,184,177,0,0,0,0,0,177,184,185,178,0,0,0,0,0,178,185,186,179,0,0,0,0,0,179,186,187,180,0,0,0,0,0,180,187,188,181,0,0,0,0,0,181,188,189,182,0,0,0,0,0,182,189,1374,1373,0,0,0,2,2,16,17,190,183,0,0,0,0,0,183,190,191,184,0,0,0,0,0,184,191,192,185,0,0,0,0,0,185,192,193,186,0,0,0,0,0,186,193,194,187,0,0,0,0,0,187,194,195,188,0,0,0,0,0,188,195,196,189,0,0,0,0,0,189,196,1375,1374,0,0,0,2,2,17,18,197,190,0,0,0,0,0,190,197,198,191,0,0,0,0,0,191,198,199,192,0,0,0,0,0,192,199,200,193,0,0,0,0,0,193,200,201,194,0,0,0,0,0,194,201,202,195,0,0,0,0,0,195,202,203,196,0,0,0,0,0,196,203,1376,1375,0,0,0,2,2,18,19,204,197,0,0,0,0,0,197,204,205,198,0,0,0,0,0,198,205,206,199,0,0,0,0,0,199,206,207,200,0,0,0,0,0,200,207,208,201,0,0,0,0,0,201,208,209,202,0,0,0,0,0,202,209,210,203,0,0,0,0,0,203,210,1377,1376,0,0,0,2,2,19,20,211,204,0,0,0,0,0,204,211,212,205,0,0,0,0,0,205,212,213,206,0,0,0,0,0,206,213,214,207,0,0,0,0,0,207,214,215,208,0,0,0,0,0,208,215,216,209,0,0,0,0,0,209,216,217,210,0,0,0,0,0,210,217,1378,1377,0,0,0,2,2,20,21,218,211,0,0,0,0,0,211,218,219,212,0,0,0,0,0,212,219,220,213,0,0,0,0,0,213,220,221,214,0,0,0,0,0,214,221,222,215,0,0,0,0,0,215,222,223,216,0,0,0,0,0,216,223,224,217,0,0,0,0,0,217,224,1379,1378,0,0,0,2,2,21,1432,1433,218,0,0,6,6,0,218,1433,1434,219,0,0,6,6,0,219,1434,1435,220,0,0,6,6,0,220,1435,1436,221,0,0,6,6,0,221,1436,1437,222,0,0,6,6,0,222,1437,1438,223,0,0,6,6,0,223,1438,1439,224,0,0,6,6,0,224,1439,1533,1379,0,0,6,8,2,225,247,254,226,0,9,9,9,9,226,254,255,227,0,9,9,9,9,227,255,256,228,0,9,9,9,9,228,256,257,229,0,9,9,9,9,229,257,258,230,0,9,9,9,9,230,258,259,231,0,9,9,9,9,231,259,260,232,0,9,9,9,9,232,260,1491,1492,0,9,9,10,10,247,248,261,254,0,9,9,9,9,254,261,262,255,0,9,9,9,9,255,262,263,256,0,9,9,9,9,256,263,264,257,0,9,9,9,9,257,264,265,258,0,9,9,9,9,258,265,266,259,0,9,9,9,9,259,266,267,260,0,9,9,9,9,260,267,1490,1491,0,9,9,10,10,248,249,268,261,0,9,9,9,9,261,268,269,262,0,9,9,9,9,262,269,270,263,0,9,9,9,9,263,270,271,264,0,9,9,9,9,264,271,272,265,0,9,9,9,9,265,272,273,266,0,9,9,9,9,266,273,274,267,0,9,9,9,9,267,274,1489,1490,0,9,9,10,10,249,250,275,268,0,9,9,9,9,268,275,276,269,0,9,9,9,9,269,276,277,270,0,9,9,9,9,270,277,278,271,0,9,9,9,9,271,278,279,272,0,9,9,9,9,272,279,280,273,0,9,9,9,9,273,280,281,274,0,9,9,9,9,274,281,1488,1489,0,9,9,10,10,250,251,282,275,0,9,9,9,9,275,282,283,276,0,9,9,9,9,276,283,284,277,0,9,9,9,9,277,284,285,278,0,9,9,9,9,278,285,286,279,0,9,9,9,9,279,286,287,280,0,9,9,9,9,280,287,288,281,0,9,9,9,9,281,288,1487,1488,0,9,9,10,10,251,252,289,282,0,9,9,9,9,282,289,290,283,0,9,9,9,9,283,290,291,284,0,9,9,9,9,284,291,292,285,0,9,9,9,9,285,292,293,286,0,9,9,9,9,286,293,294,287,0,9,9,9,9,287,294,295,288,0,9,9,9,9,288,295,1486,1487,0,9,9,10,10,252,253,296,289,0,9,9,9,9,289,296,297,290,0,9,9,9,9,290,297,298,291,0,9,9,9,9,291,298,299,292,0,9,9,9,9,292,299,300,293,0,9,9,9,9,293,300,301,294,0,9,9,9,9,294,301,302,295,0,9,9,9,9,295,302,1485,1486,0,9,9,10,10,253,1477,1476,296,0,9,11,11,9,296,1476,1475,297,0,9,11,11,9,297,1475,1474,298,0,9,11,11,9,298,1474,1473,299,0,9,11,11,9,299,1473,1472,300,0,9,11,11,9,300,1472,1471,301,0,9,11,11,9,301,1471,1470,302,0,9,11,11,9,302,1470,1534,1485,0,9,11,12,10,225,226,303,233,0,9,9,9,9,233,303,304,234,0,9,9,9,9,234,304,305,235,0,9,9,9,9,235,305,306,236,0,9,9,9,9,236,306,307,237,0,9,9,9,9,237,307,308,238,0,9,9,9,9,238,308,309,239,0,9,9,9,9,239,309,1523,1522,0,9,9,13,13,226,227,310,303,0,9,9,9,9,303,310,311,304,0,9,9,9,9,304,311,312,305,0,9,9,9,9,305,312,313,306,0,9,9,9,9,306,313,314,307,0,9,9,9,9,307,314,315,308,0,9,9,9,9,308,315,316,309,0,9,9,9,9,309,316,1524,1523,0,9,9,13,13,227,228,317,310,0,9,9,9,9,310,317,318,311,0,9,9,9,9,311,318,319,312,0,9,9,9,9,312,319,320,313,0,9,9,9,9,313,320,321,314,0,9,9,9,9,314,321,322,315,0,9,9,9,9,315,322,323,316,0,9,9,9,9,316,323,1525,1524,0,9,9,13,13,228,229,324,317,0,9,9,9,9,317,324,325,318,0,9,9,9,9,318,325,326,319,0,9,9,9,9,319,326,327,320,0,9,9,9,9,320,327,328,321,0,9,9,9,9,321,328,329,322,0,9,9,9,9,322,329,330,323,0,9,9,9,9,323,330,1526,1525,0,9,9,13,13,229,230,331,324,0,9,9,9,9,324,331,332,325,0,9,9,9,9,325,332,333,326,0,9,9,9,9,326,333,334,327,0,9,9,9,9,327,334,335,328,0,9,9,9,9,328,335,336,329,0,9,9,9,9,329,336,337,330,0,9,9,9,9,330,337,1527,1526,0,9,9,13,13,230,231,338,331,0,9,9,9,9,331,338,339,332,0,9,9,9,9,332,339,340,333,0,9,9,9,9,333,340,341,334,0,9,9,9,9,334,341,342,335,0,9,9,9,9,335,342,343,336,0,9,9,9,9,336,343,344,337,0,9,9,9,9,337,344,1528,1527,0,9,9,13,13,231,232,345,338,0,9,9,9,9,338,345,346,339,0,9,9,9,9,339,346,347,340,0,9,9,9,9,340,347,348,341,0,9,9,9,9,341,348,349,342,0,9,9,9,9,342,349,350,343,0,9,9,9,9,343,350,351,344,0,9,9,9,9,344,351,1529,1528,0,9,9,13,13,232,1492,1493,345,0,9,10,10,9,345,1493,1494,346,0,9,10,10,9,346,1494,1495,347,0,9,10,10,9,347,1495,1496,348,0,9,10,10,9,348,1496,1497,349,0,9,10,10,9,349,1497,1498,350,0,9,10,10,9,350,1498,1499,351,0,9,10,10,9,351,1499,1537,1529,0,9,10,14,13,225,233,352,240,0,9,9,9,9,240,352,353,241,0,9,9,9,9,241,353,354,242,0,9,9,9,9,242,354,355,243,0,9,9,9,9,243,355,356,244,0,9,9,9,9,244,356,357,245,0,9,9,9,9,245,357,358,246,0,9,9,9,9,246,358,1508,1507,0,9,9,15,15,233,234,359,352,0,9,9,9,9,352,359,360,353,0,9,9,9,9,353,360,361,354,0,9,9,9,9,354,361,362,355,0,9,9,9,9,355,362,363,356,0,9,9,9,9,356,363,364,357,0,9,9,9,9,357,364,365,358,0,9,9,9,9,358,365,1509,1508,0,9,9,15,15,234,235,366,359,0,9,9,9,9,359,366,367,360,0,9,9,9,9,360,367,368,361,0,9,9,9,9,361,368,369,362,0,9,9,9,9,362,369,370,363,0,9,9,9,9,363,370,371,364,0,9,9,9,9,364,371,372,365,0,9,9,9,9,365,372,1510,1509,0,9,9,15,15,235,236,373,366,0,9,9,9,9,366,373,374,367,0,9,9,9,9,367,374,375,368,0,9,9,9,9,368,375,376,369,0,9,9,9,9,369,376,377,370,0,9,9,9,9,370,377,378,371,0,9,9,9,9,371,378,379,372,0,9,9,9,9,372,379,1511,1510,0,9,9,15,15,236,237,380,373,0,9,9,9,9,373,380,381,374,0,9,9,9,9,374,381,382,375,0,9,9,9,9,375,382,383,376,0,9,9,9,9,376,383,384,377,0,9,9,9,9,377,384,385,378,0,9,9,9,9,378,385,386,379,0,9,9,9,9,379,386,1512,1511,0,9,9,15,15,237,238,387,380,0,9,9,9,9,380,387,388,381,0,9,9,9,9,381,388,389,382,0,9,9,9,9,382,389,390,383,0,9,9,9,9,383,390,391,384,0,9,9,9,9,384,391,392,385,0,9,9,9,9,385,392,393,386,0,9,9,9,9,386,393,1513,1512,0,9,9,15,15,238,239,394,387,0,9,9,9,9,387,394,395,388,0,9,9,9,9,388,395,396,389,0,9,9,9,9,389,396,397,390,0,9,9,9,9,390,397,398,391,0,9,9,9,9,391,398,399,392,0,9,9,9,9,392,399,400,393,0,9,9,9,9,393,400,1514,1513,0,9,9,15,15,239,1522,1521,394,0,9,13,13,9,394,1521,1520,395,0,9,13,13,9,395,1520,1519,396,0,9,13,13,9,396,1519,1518,397,0,9,13,13,9,397,1518,1517,398,0,9,13,13,9,398,1517,1516,399,0,9,13,13,9,399,1516,1515,400,0,9,13,13,9,400,1515,1536,1514,0,9,13,16,15,225,240,401,247,0,9,9,9,9,247,401,402,248,0,9,9,9,9,248,402,403,249,0,9,9,9,9,249,403,404,250,0,9,9,9,9,250,404,405,251,0,9,9,9,9,251,405,406,252,0,9,9,9,9,252,406,407,253,0,9,9,9,9,253,407,1478,1477,0,9,9,11,11,240,241,408,401,0,9,9,9,9,401,408,409,402,0,9,9,9,9,402,409,410,403,0,9,9,9,9,403,410,411,404,0,9,9,9,9,404,411,412,405,0,9,9,9,9,405,412,413,406,0,9,9,9,9,406,413,414,407,0,9,9,9,9,407,414,1479,1478,0,9,9,11,11,241,242,415,408,0,9,9,9,9,408,415,416,409,0,9,9,9,9,409,416,417,410,0,9,9,9,9,410,417,418,411,0,9,9,9,9,411,418,419,412,0,9,9,9,9,412,419,420,413,0,9,9,9,9,413,420,421,414,0,9,9,9,9,414,421,1480,1479,0,9,9,11,11,242,243,422,415,0,9,9,9,9,415,422,423,416,0,9,9,9,9,416,423,424,417,0,9,9,9,9,417,424,425,418,0,9,9,9,9,418,425,426,419,0,9,9,9,9,419,426,427,420,0,9,9,9,9,420,427,428,421,0,9,9,9,9,421,428,1481,1480,0,9,9,11,11,243,244,429,422,0,9,9,9,9,422,429,430,423,0,9,9,9,9,423,430,431,424,0,9,9,9,9,424,431,432,425,0,9,9,9,9,425,432,433,426,0,9,9,9,9,426,433,434,427,0,9,9,9,9,427,434,435,428,0,9,9,9,9,428,435,1482,1481,0,9,9,11,11,244,245,436,429,0,9,9,9,9,429,436,437,430,0,9,9,9,9,430,437,438,431,0,9,9,9,9,431,438,439,432,0,9,9,9,9,432,439,440,433,0,9,9,9,9,433,440,441,434,0,9,9,9,9,434,441,442,435,0,9,9,9,9,435,442,1483,1482,0,9,9,11,11,245,246,443,436,0,9,9,9,9,436,443,444,437,0,9,9,9,9,437,444,445,438,0,9,9,9,9,438,445,446,439,0,9,9,9,9,439,446,447,440,0,9,9,9,9,440,447,448,441,0,9,9,9,9,441,448,449,442,0,9,9,9,9,442,449,1484,1483,0,9,9,11,11,246,1507,1506,443,0,9,15,15,9,443,1506,1505,444,0,9,15,15,9,444,1505,1504,445,0,9,15,15,9,445,1504,1503,446,0,9,15,15,9,446,1503,1502,447,0,9,15,15,9,447,1502,1501,448,0,9,15,15,9,448,1501,1500,449,0,9,15,15,9,449,1500,1535,1484,0,9,15,17,11,450,472,479,451,0,18,18,18,18,451,479,480,452,0,18,18,18,18,452,480,481,453,0,18,18,18,18,453,481,482,454,0,18,18,18,18,454,482,483,455,0,18,18,18,18,455,483,484,456,0,18,18,18,18,456,484,485,457,0,18,18,18,18,457,485,1386,1387,0,18,18,19,19,472,473,486,479,0,18,18,18,18,479,486,487,480,0,18,18,18,18,480,487,488,481,0,18,18,18,18,481,488,489,482,0,18,18,18,18,482,489,490,483,0,18,18,18,18,483,490,491,484,0,18,18,18,18,484,491,492,485,0,18,18,18,18,485,492,1385,1386,0,18,18,19,19,473,474,493,486,0,18,18,18,18,486,493,494,487,0,18,18,18,18,487,494,495,488,0,18,18,18,18,488,495,496,489,0,18,18,18,18,489,496,497,490,0,18,18,18,18,490,497,498,491,0,18,18,18,18,491,498,499,492,0,18,18,18,18,492,499,1384,1385,0,18,18,19,19,474,475,500,493,0,18,18,18,18,493,500,501,494,0,18,18,18,18,494,501,502,495,0,18,18,18,18,495,502,503,496,0,18,18,18,18,496,503,504,497,0,18,18,18,18,497,504,505,498,0,18,18,18,18,498,505,506,499,0,18,18,18,18,499,506,1383,1384,0,18,18,19,19,475,476,507,500,0,18,18,18,18,500,507,508,501,0,18,18,18,18,501,508,509,502,0,18,18,18,18,502,509,510,503,0,18,18,18,18,503,510,511,504,0,18,18,18,18,504,511,512,505,0,18,18,18,18,505,512,513,506,0,18,18,18,18,506,513,1382,1383,0,18,18,19,19,476,477,514,507,0,18,18,18,18,507,514,515,508,0,18,18,18,18,508,515,516,509,0,18,18,18,18,509,516,517,510,0,18,18,18,18,510,517,518,511,0,18,18,18,18,511,518,519,512,0,18,18,18,18,512,519,520,513,0,18,18,18,18,513,520,1381,1382,0,18,18,19,19,477,478,521,514,0,18,18,18,18,514,521,522,515,0,18,18,18,18,515,522,523,516,0,18,18,18,18,516,523,524,517,0,18,18,18,18,517,524,525,518,0,18,18,18,18,518,525,526,519,0,18,18,18,18,519,526,527,520,0,18,18,18,18,520,527,1380,1381,0,18,18,19,19,478,1357,1356,521,0,18,1,1,18,521,1356,1355,522,0,18,1,1,18,522,1355,1354,523,0,18,1,1,18,523,1354,1353,524,0,18,1,1,18,524,1353,1352,525,0,18,1,1,18,525,1352,1351,526,0,18,1,1,18,526,1351,1350,527,0,18,1,1,18,527,1350,1530,1380,0,18,1,3,19,450,451,528,458,0,18,18,18,18,458,528,529,459,0,18,18,18,18,459,529,530,460,0,18,18,18,18,460,530,531,461,0,18,18,18,18,461,531,532,462,0,18,18,18,18,462,532,533,463,0,18,18,18,18,463,533,534,464,0,18,18,18,18,464,534,1476,1477,0,18,18,11,11,451,452,535,528,0,18,18,18,18,528,535,536,529,0,18,18,18,18,529,536,537,530,0,18,18,18,18,530,537,538,531,0,18,18,18,18,531,538,539,532,0,18,18,18,18,532,539,540,533,0,18,18,18,18,533,540,541,534,0,18,18,18,18,534,541,1475,1476,0,18,18,11,11,452,453,542,535,0,18,18,18,18,535,542,543,536,0,18,18,18,18,536,543,544,537,0,18,18,18,18,537,544,545,538,0,18,18,18,18,538,545,546,539,0,18,18,18,18,539,546,547,540,0,18,18,18,18,540,547,548,541,0,18,18,18,18,541,548,1474,1475,0,18,18,11,11,453,454,549,542,0,18,18,18,18,542,549,550,543,0,18,18,18,18,543,550,551,544,0,18,18,18,18,544,551,552,545,0,18,18,18,18,545,552,553,546,0,18,18,18,18,546,553,554,547,0,18,18,18,18,547,554,555,548,0,18,18,18,18,548,555,1473,1474,0,18,18,11,11,454,455,556,549,0,18,18,18,18,549,556,557,550,0,18,18,18,18,550,557,558,551,0,18,18,18,18,551,558,559,552,0,18,18,18,18,552,559,560,553,0,18,18,18,18,553,560,561,554,0,18,18,18,18,554,561,562,555,0,18,18,18,18,555,562,1472,1473,0,18,18,11,11,455,456,563,556,0,18,18,18,18,556,563,564,557,0,18,18,18,18,557,564,565,558,0,18,18,18,18,558,565,566,559,0,18,18,18,18,559,566,567,560,0,18,18,18,18,560,567,568,561,0,18,18,18,18,561,568,569,562,0,18,18,18,18,562,569,1471,1472,0,18,18,11,11,456,457,570,563,0,18,18,18,18,563,570,571,564,0,18,18,18,18,564,571,572,565,0,18,18,18,18,565,572,573,566,0,18,18,18,18,566,573,574,567,0,18,18,18,18,567,574,575,568,0,18,18,18,18,568,575,576,569,0,18,18,18,18,569,576,1470,1471,0,18,18,11,11,457,1387,1388,570,0,18,19,19,18,570,1388,1389,571,0,18,19,19,18,571,1389,1390,572,0,18,19,19,18,572,1390,1391,573,0,18,19,19,18,573,1391,1392,574,0,18,19,19,18,574,1392,1393,575,0,18,19,19,18,575,1393,1394,576,0,18,19,19,18,576,1394,1534,1470,0,18,19,12,11,450,458,577,465,0,18,18,18,18,465,577,578,466,0,18,18,18,18,466,578,579,467,0,18,18,18,18,467,579,580,468,0,18,18,18,18,468,580,581,469,0,18,18,18,18,469,581,582,470,0,18,18,18,18,470,582,583,471,0,18,18,18,18,471,583,1418,1417,0,18,18,20,20,458,459,584,577,0,18,18,18,18,577,584,585,578,0,18,18,18,18,578,585,586,579,0,18,18,18,18,579,586,587,580,0,18,18,18,18,580,587,588,581,0,18,18,18,18,581,588,589,582,0,18,18,18,18,582,589,590,583,0,18,18,18,18,583,590,1419,1418,0,18,18,20,20,459,460,591,584,0,18,18,18,18,584,591,592,585,0,18,18,18,18,585,592,593,586,0,18,18,18,18,586,593,594,587,0,18,18,18,18,587,594,595,588,0,18,18,18,18,588,595,596,589,0,18,18,18,18,589,596,597,590,0,18,18,18,18,590,597,1420,1419,0,18,18,20,20,460,461,598,591,0,18,18,18,18,591,598,599,592,0,18,18,18,18,592,599,600,593,0,18,18,18,18,593,600,601,594,0,18,18,18,18,594,601,602,595,0,18,18,18,18,595,602,603,596,0,18,18,18,18,596,603,604,597,0,18,18,18,18,597,604,1421,1420,0,18,18,20,20,461,462,605,598,0,18,18,18,18,598,605,606,599,0,18,18,18,18,599,606,607,600,0,18,18,18,18,600,607,608,601,0,18,18,18,18,601,608,609,602,0,18,18,18,18,602,609,610,603,0,18,18,18,18,603,610,611,604,0,18,18,18,18,604,611,1422,1421,0,18,18,20,20,462,463,612,605,0,18,18,18,18,605,612,613,606,0,18,18,18,18,606,613,614,607,0,18,18,18,18,607,614,615,608,0,18,18,18,18,608,615,616,609,0,18,18,18,18,609,616,617,610,0,18,18,18,18,610,617,618,611,0,18,18,18,18,611,618,1423,1422,0,18,18,20,20,463,464,619,612,0,18,18,18,18,612,619,620,613,0,18,18,18,18,613,620,621,614,0,18,18,18,18,614,621,622,615,0,18,18,18,18,615,622,623,616,0,18,18,18,18,616,623,624,617,0,18,18,18,18,617,624,625,618,0,18,18,18,18,618,625,1424,1423,0,18,18,20,20,464,1477,1478,619,0,18,11,11,18,619,1478,1479,620,0,18,11,11,18,620,1479,1480,621,0,18,11,11,18,621,1480,1481,622,0,18,11,11,18,622,1481,1482,623,0,18,11,11,18,623,1482,1483,624,0,18,11,11,18,624,1483,1484,625,0,18,11,11,18,625,1484,1535,1424,0,18,11,17,20,450,465,626,472,0,18,18,18,18,472,626,627,473,0,18,18,18,18,473,627,628,474,0,18,18,18,18,474,628,629,475,0,18,18,18,18,475,629,630,476,0,18,18,18,18,476,630,631,477,0,18,18,18,18,477,631,632,478,0,18,18,18,18,478,632,1358,1357,0,18,18,1,1,465,466,633,626,0,18,18,18,18,626,633,634,627,0,18,18,18,18,627,634,635,628,0,18,18,18,18,628,635,636,629,0,18,18,18,18,629,636,637,630,0,18,18,18,18,630,637,638,631,0,18,18,18,18,631,638,639,632,0,18,18,18,18,632,639,1359,1358,0,18,18,1,1,466,467,640,633,0,18,18,18,18,633,640,641,634,0,18,18,18,18,634,641,642,635,0,18,18,18,18,635,642,643,636,0,18,18,18,18,636,643,644,637,0,18,18,18,18,637,644,645,638,0,18,18,18,18,638,645,646,639,0,18,18,18,18,639,646,1360,1359,0,18,18,1,1,467,468,647,640,0,18,18,18,18,640,647,648,641,0,18,18,18,18,641,648,649,642,0,18,18,18,18,642,649,650,643,0,18,18,18,18,643,650,651,644,0,18,18,18,18,644,651,652,645,0,18,18,18,18,645,652,653,646,0,18,18,18,18,646,653,1361,1360,0,18,18,1,1,468,469,654,647,0,18,18,18,18,647,654,655,648,0,18,18,18,18,648,655,656,649,0,18,18,18,18,649,656,657,650,0,18,18,18,18,650,657,658,651,0,18,18,18,18,651,658,659,652,0,18,18,18,18,652,659,660,653,0,18,18,18,18,653,660,1362,1361,0,18,18,1,1,469,470,661,654,0,18,18,18,18,654,661,662,655,0,18,18,18,18,655,662,663,656,0,18,18,18,18,656,663,664,657,0,18,18,18,18,657,664,665,658,0,18,18,18,18,658,665,666,659,0,18,18,18,18,659,666,667,660,0,18,18,18,18,660,667,1363,1362,0,18,18,1,1,470,471,668,661,0,18,18,18,18,661,668,669,662,0,18,18,18,18,662,669,670,663,0,18,18,18,18,663,670,671,664,0,18,18,18,18,664,671,672,665,0,18,18,18,18,665,672,673,666,0,18,18,18,18,666,673,674,667,0,18,18,18,18,667,674,1364,1363,0,18,18,1,1,471,1417,1416,668,0,18,20,20,18,668,1416,1415,669,0,18,20,20,18,669,1415,1414,670,0,18,20,20,18,670,1414,1413,671,0,18,20,20,18,671,1413,1412,672,0,18,20,20,18,672,1412,1411,673,0,18,20,20,18,673,1411,1410,674,0,18,20,20,18,674,1410,1531,1364,0,18,20,5,1,675,697,704,676,0,21,21,21,21,676,704,705,677,0,21,21,21,21,677,705,706,678,0,21,21,21,21,678,706,707,679,0,21,21,21,21,679,707,708,680,0,21,21,21,21,680,708,709,681,0,21,21,21,21,681,709,710,682,0,21,21,21,21,682,710,1416,1417,0,21,21,20,20,697,698,711,704,0,21,21,21,21,704,711,712,705,0,21,21,21,21,705,712,713,706,0,21,21,21,21,706,713,714,707,0,21,21,21,21,707,714,715,708,0,21,21,21,21,708,715,716,709,0,21,21,21,21,709,716,717,710,0,21,21,21,21,710,717,1415,1416,0,21,21,20,20,698,699,718,711,0,21,21,21,21,711,718,719,712,0,21,21,21,21,712,719,720,713,0,21,21,21,21,713,720,721,714,0,21,21,21,21,714,721,722,715,0,21,21,21,21,715,722,723,716,0,21,21,21,21,716,723,724,717,0,21,21,21,21,717,724,1414,1415,0,21,21,20,20,699,700,725,718,0,21,21,21,21,718,725,726,719,0,21,21,21,21,719,726,727,720,0,21,21,21,21,720,727,728,721,0,21,21,21,21,721,728,729,722,0,21,21,21,21,722,729,730,723,0,21,21,21,21,723,730,731,724,0,21,21,21,21,724,731,1413,1414,0,21,21,20,20,700,701,732,725,0,21,21,21,21,725,732,733,726,0,21,21,21,21,726,733,734,727,0,21,21,21,21,727,734,735,728,0,21,21,21,21,728,735,736,729,0,21,21,21,21,729,736,737,730,0,21,21,21,21,730,737,738,731,0,21,21,21,21,731,738,1412,1413,0,21,21,20,20,701,702,739,732,0,21,21,21,21,732,739,740,733,0,21,21,21,21,733,740,741,734,0,21,21,21,21,734,741,742,735,0,21,21,21,21,735,742,743,736,0,21,21,21,21,736,743,744,737,0,21,21,21,21,737,744,745,738,0,21,21,21,21,738,745,1411,1412,0,21,21,20,20,702,703,746,739,0,21,21,21,21,739,746,747,740,0,21,21,21,21,740,747,748,741,0,21,21,21,21,741,748,749,742,0,21,21,21,21,742,749,750,743,0,21,21,21,21,743,750,751,744,0,21,21,21,21,744,751,752,745,0,21,21,21,21,745,752,1410,1411,0,21,21,20,20,703,1402,1401,746,0,21,4,4,21,746,1401,1400,747,0,21,4,4,21,747,1400,1399,748,0,21,4,4,21,748,1399,1398,749,0,21,4,4,21,749,1398,1397,750,0,21,4,4,21,750,1397,1396,751,0,21,4,4,21,751,1396,1395,752,0,21,4,4,21,752,1395,1531,1410,0,21,4,5,20,675,676,753,683,0,21,21,21,21,683,753,754,684,0,21,21,21,21,684,754,755,685,0,21,21,21,21,685,755,756,686,0,21,21,21,21,686,756,757,687,0,21,21,21,21,687,757,758,688,0,21,21,21,21,688,758,759,689,0,21,21,21,21,689,759,1506,1507,0,21,21,15,15,676,677,760,753,0,21,21,21,21,753,760,761,754,0,21,21,21,21,754,761,762,755,0,21,21,21,21,755,762,763,756,0,21,21,21,21,756,763,764,757,0,21,21,21,21,757,764,765,758,0,21,21,21,21,758,765,766,759,0,21,21,21,21,759,766,1505,1506,0,21,21,15,15,677,678,767,760,0,21,21,21,21,760,767,768,761,0,21,21,21,21,761,768,769,762,0,21,21,21,21,762,769,770,763,0,21,21,21,21,763,770,771,764,0,21,21,21,21,764,771,772,765,0,21,21,21,21,765,772,773,766,0,21,21,21,21,766,773,1504,1505,0,21,21,15,15,678,679,774,767,0,21,21,21,21,767,774,775,768,0,21,21,21,21,768,775,776,769,0,21,21,21,21,769,776,777,770,0,21,21,21,21,770,777,778,771,0,21,21,21,21,771,778,779,772,0,21,21,21,21,772,779,780,773,0,21,21,21,21,773,780,1503,1504,0,21,21,15,15,679,680,781,774,0,21,21,21,21,774,781,782,775,0,21,21,21,21,775,782,783,776,0,21,21,21,21,776,783,784,777,0,21,21,21,21,777,784,785,778,0,21,21,21,21,778,785,786,779,0,21,21,21,21,779,786,787,780,0,21,21,21,21,780,787,1502,1503,0,21,21,15,15,680,681,788,781,0,21,21,21,21,781,788,789,782,0,21,21,21,21,782,789,790,783,0,21,21,21,21,783,790,791,784,0,21,21,21,21,784,791,792,785,0,21,21,21,21,785,792,793,786,0,21,21,21,21,786,793,794,787,0,21,21,21,21,787,794,1501,1502,0,21,21,15,15,681,682,795,788,0,21,21,21,21,788,795,796,789,0,21,21,21,21,789,796,797,790,0,21,21,21,21,790,797,798,791,0,21,21,21,21,791,798,799,792,0,21,21,21,21,792,799,800,793,0,21,21,21,21,793,800,801,794,0,21,21,21,21,794,801,1500,1501,0,21,21,15,15,682,1417,1418,795,0,21,20,20,21,795,1418,1419,796,0,21,20,20,21,796,1419,1420,797,0,21,20,20,21,797,1420,1421,798,0,21,20,20,21,798,1421,1422,799,0,21,20,20,21,799,1422,1423,800,0,21,20,20,21,800,1423,1424,801,0,21,20,20,21,801,1424,1535,1500,0,21,20,17,15,675,683,802,690,0,21,21,21,21,690,802,803,691,0,21,21,21,21,691,803,804,692,0,21,21,21,21,692,804,805,693,0,21,21,21,21,693,805,806,694,0,21,21,21,21,694,806,807,695,0,21,21,21,21,695,807,808,696,0,21,21,21,21,696,808,1448,1447,0,21,21,22,22,683,684,809,802,0,21,21,21,21,802,809,810,803,0,21,21,21,21,803,810,811,804,0,21,21,21,21,804,811,812,805,0,21,21,21,21,805,812,813,806,0,21,21,21,21,806,813,814,807,0,21,21,21,21,807,814,815,808,0,21,21,21,21,808,815,1449,1448,0,21,21,22,22,684,685,816,809,0,21,21,21,21,809,816,817,810,0,21,21,21,21,810,817,818,811,0,21,21,21,21,811,818,819,812,0,21,21,21,21,812,819,820,813,0,21,21,21,21,813,820,821,814,0,21,21,21,21,814,821,822,815,0,21,21,21,21,815,822,1450,1449,0,21,21,22,22,685,686,823,816,0,21,21,21,21,816,823,824,817,0,21,21,21,21,817,824,825,818,0,21,21,21,21,818,825,826,819,0,21,21,21,21,819,826,827,820,0,21,21,21,21,820,827,828,821,0,21,21,21,21,821,828,829,822,0,21,21,21,21,822,829,1451,1450,0,21,21,22,22,686,687,830,823,0,21,21,21,21,823,830,831,824,0,21,21,21,21,824,831,832,825,0,21,21,21,21,825,832,833,826,0,21,21,21,21,826,833,834,827,0,21,21,21,21,827,834,835,828,0,21,21,21,21,828,835,836,829,0,21,21,21,21,829,836,1452,1451,0,21,21,22,22,687,688,837,830,0,21,21,21,21,830,837,838,831,0,21,21,21,21,831,838,839,832,0,21,21,21,21,832,839,840,833,0,21,21,21,21,833,840,841,834,0,21,21,21,21,834,841,842,835,0,21,21,21,21,835,842,843,836,0,21,21,21,21,836,843,1453,1452,0,21,21,22,22,688,689,844,837,0,21,21,21,21,837,844,845,838,0,21,21,21,21,838,845,846,839,0,21,21,21,21,839,846,847,840,0,21,21,21,21,840,847,848,841,0,21,21,21,21,841,848,849,842,0,21,21,21,21,842,849,850,843,0,21,21,21,21,843,850,1454,1453,0,21,21,22,22,689,1507,1508,844,0,21,15,15,21,844,1508,1509,845,0,21,15,15,21,845,1509,1510,846,0,21,15,15,21,846,1510,1511,847,0,21,15,15,21,847,1511,1512,848,0,21,15,15,21,848,1512,1513,849,0,21,15,15,21,849,1513,1514,850,0,21,15,15,21,850,1514,1536,1454,0,21,15,16,22,675,690,851,697,0,21,21,21,21,697,851,852,698,0,21,21,21,21,698,852,853,699,0,21,21,21,21,699,853,854,700,0,21,21,21,21,700,854,855,701,0,21,21,21,21,701,855,856,702,0,21,21,21,21,702,856,857,703,0,21,21,21,21,703,857,1403,1402,0,21,21,4,4,690,691,858,851,0,21,21,21,21,851,858,859,852,0,21,21,21,21,852,859,860,853,0,21,21,21,21,853,860,861,854,0,21,21,21,21,854,861,862,855,0,21,21,21,21,855,862,863,856,0,21,21,21,21,856,863,864,857,0,21,21,21,21,857,864,1404,1403,0,21,21,4,4,691,692,865,858,0,21,21,21,21,858,865,866,859,0,21,21,21,21,859,866,867,860,0,21,21,21,21,860,867,868,861,0,21,21,21,21,861,868,869,862,0,21,21,21,21,862,869,870,863,0,21,21,21,21,863,870,871,864,0,21,21,21,21,864,871,1405,1404,0,21,21,4,4,692,693,872,865,0,21,21,21,21,865,872,873,866,0,21,21,21,21,866,873,874,867,0,21,21,21,21,867,874,875,868,0,21,21,21,21,868,875,876,869,0,21,21,21,21,869,876,877,870,0,21,21,21,21,870,877,878,871,0,21,21,21,21,871,878,1406,1405,0,21,21,4,4,693,694,879,872,0,21,21,21,21,872,879,880,873,0,21,21,21,21,873,880,881,874,0,21,21,21,21,874,881,882,875,0,21,21,21,21,875,882,883,876,0,21,21,21,21,876,883,884,877,0,21,21,21,21,877,884,885,878,0,21,21,21,21,878,885,1407,1406,0,21,21,4,4,694,695,886,879,0,21,21,21,21,879,886,887,880,0,21,21,21,21,880,887,888,881,0,21,21,21,21,881,888,889,882,0,21,21,21,21,882,889,890,883,0,21,21,21,21,883,890,891,884,0,21,21,21,21,884,891,892,885,0,21,21,21,21,885,892,1408,1407,0,21,21,4,4,695,696,893,886,0,21,21,21,21,886,893,894,887,0,21,21,21,21,887,894,895,888,0,21,21,21,21,888,895,896,889,0,21,21,21,21,889,896,897,890,0,21,21,21,21,890,897,898,891,0,21,21,21,21,891,898,899,892,0,21,21,21,21,892,899,1409,1408,0,21,21,4,4,696,1447,1446,893,0,21,22,22,21,893,1446,1445,894,0,21,22,22,21,894,1445,1444,895,0,21,22,22,21,895,1444,1443,896,0,21,22,22,21,896,1443,1442,897,0,21,22,22,21,897,1442,1441,898,0,21,22,22,21,898,1441,1440,899,0,21,22,22,21,899,1440,1532,1409,0,21,22,7,4,900,922,929,901,0,23,23,23,23,901,929,930,902,0,23,23,23,23,902,930,931,903,0,23,23,23,23,903,931,932,904,0,23,23,23,23,904,932,933,905,0,23,23,23,23,905,933,934,906,0,23,23,23,23,906,934,935,907,0,23,23,23,23,907,935,1446,1447,0,23,23,22,22,922,923,936,929,0,23,23,23,23,929,936,937,930,0,23,23,23,23,930,937,938,931,0,23,23,23,23,931,938,939,932,0,23,23,23,23,932,939,940,933,0,23,23,23,23,933,940,941,934,0,23,23,23,23,934,941,942,935,0,23,23,23,23,935,942,1445,1446,0,23,23,22,22,923,924,943,936,0,23,23,23,23,936,943,944,937,0,23,23,23,23,937,944,945,938,0,23,23,23,23,938,945,946,939,0,23,23,23,23,939,946,947,940,0,23,23,23,23,940,947,948,941,0,23,23,23,23,941,948,949,942,0,23,23,23,23,942,949,1444,1445,0,23,23,22,22,924,925,950,943,0,23,23,23,23,943,950,951,944,0,23,23,23,23,944,951,952,945,0,23,23,23,23,945,952,953,946,0,23,23,23,23,946,953,954,947,0,23,23,23,23,947,954,955,948,0,23,23,23,23,948,955,956,949,0,23,23,23,23,949,956,1443,1444,0,23,23,22,22,925,926,957,950,0,23,23,23,23,950,957,958,951,0,23,23,23,23,951,958,959,952,0,23,23,23,23,952,959,960,953,0,23,23,23,23,953,960,961,954,0,23,23,23,23,954,961,962,955,0,23,23,23,23,955,962,963,956,0,23,23,23,23,956,963,1442,1443,0,23,23,22,22,926,927,964,957,0,23,23,23,23,957,964,965,958,0,23,23,23,23,958,965,966,959,0,23,23,23,23,959,966,967,960,0,23,23,23,23,960,967,968,961,0,23,23,23,23,961,968,969,962,0,23,23,23,23,962,969,970,963,0,23,23,23,23,963,970,1441,1442,0,23,23,22,22,927,928,971,964,0,23,23,23,23,964,971,972,965,0,23,23,23,23,965,972,973,966,0,23,23,23,23,966,973,974,967,0,23,23,23,23,967,974,975,968,0,23,23,23,23,968,975,976,969,0,23,23,23,23,969,976,977,970,0,23,23,23,23,970,977,1440,1441,0,23,23,22,22,928,1432,1431,971,0,23,6,6,23,971,1431,1430,972,0,23,6,6,23,972,1430,1429,973,0,23,6,6,23,973,1429,1428,974,0,23,6,6,23,974,1428,1427,975,0,23,6,6,23,975,1427,1426,976,0,23,6,6,23,976,1426,1425,977,0,23,6,6,23,977,1425,1532,1440,0,23,6,7,22,900,901,978,908,0,23,23,23,23,908,978,979,909,0,23,23,23,23,909,979,980,910,0,23,23,23,23,910,980,981,911,0,23,23,23,23,911,981,982,912,0,23,23,23,23,912,982,983,913,0,23,23,23,23,913,983,984,914,0,23,23,23,23,914,984,1521,1522,0,23,23,13,13,901,902,985,978,0,23,23,23,23,978,985,986,979,0,23,23,23,23,979,986,987,980,0,23,23,23,23,980,987,988,981,0,23,23,23,23,981,988,989,982,0,23,23,23,23,982,989,990,983,0,23,23,23,23,983,990,991,984,0,23,23,23,23,984,991,1520,1521,0,23,23,13,13,902,903,992,985,0,23,23,23,23,985,992,993,986,0,23,23,23,23,986,993,994,987,0,23,23,23,23,987,994,995,988,0,23,23,23,23,988,995,996,989,0,23,23,23,23,989,996,997,990,0,23,23,23,23,990,997,998,991,0,23,23,23,23,991,998,1519,1520,0,23,23,13,13,903,904,999,992,0,23,23,23,23,992,999,1000,993,0,23,23,23,23,993,1000,1001,994,0,23,23,23,23,994,1001,1002,995,0,23,23,23,23,995,1002,1003,996,0,23,23,23,23,996,1003,1004,997,0,23,23,23,23,997,1004,1005,998,0,23,23,23,23,998,1005,1518,1519,0,23,23,13,13,904,905,1006,999,0,23,23,23,23,999,1006,1007,1000,0,23,23,23,23,1000,1007,1008,1001,0,23,23,23,23,1001,1008,1009,1002,0,23,23,23,23,1002,1009,1010,1003,0,23,23,23,23,1003,1010,1011,1004,0,23,23,23,23,1004,1011,1012,1005,0,23,23,23,23,1005,1012,1517,1518,0,23,23,13,13,905,906,1013,1006,0,23,23,23,23,1006,1013,1014,1007,0,23,23,23,23,1007,1014,1015,1008,0,23,23,23,23,1008,1015,1016,1009,0,23,23,23,23,1009,1016,1017,1010,0,23,23,23,23,1010,1017,1018,1011,0,23,23,23,23,1011,1018,1019,1012,0,23,23,23,23,1012,1019,1516,1517,0,23,23,13,13,906,907,1020,1013,0,23,23,23,23,1013,1020,1021,1014,0,23,23,23,23,1014,1021,1022,1015,0,23,23,23,23,1015,1022,1023,1016,0,23,23,23,23,1016,1023,1024,1017,0,23,23,23,23,1017,1024,1025,1018,0,23,23,23,23,1018,1025,1026,1019,0,23,23,23,23,1019,1026,1515,1516,0,23,23,13,13,907,1447,1448,1020,0,23,22,22,23,1020,1448,1449,1021,0,23,22,22,23,1021,1449,1450,1022,0,23,22,22,23,1022,1450,1451,1023,0,23,22,22,23,1023,1451,1452,1024,0,23,22,22,23,1024,1452,1453,1025,0,23,22,22,23,1025,1453,1454,1026,0,23,22,22,23,1026,1454,1536,1515,0,23,22,16,13,900,908,1027,915,0,23,23,23,23,915,1027,1028,916,0,23,23,23,23,916,1028,1029,917,0,23,23,23,23,917,1029,1030,918,0,23,23,23,23,918,1030,1031,919,0,23,23,23,23,919,1031,1032,920,0,23,23,23,23,920,1032,1033,921,0,23,23,23,23,921,1033,1463,1462,0,23,23,24,24,908,909,1034,1027,0,23,23,23,23,1027,1034,1035,1028,0,23,23,23,23,1028,1035,1036,1029,0,23,23,23,23,1029,1036,1037,1030,0,23,23,23,23,1030,1037,1038,1031,0,23,23,23,23,1031,1038,1039,1032,0,23,23,23,23,1032,1039,1040,1033,0,23,23,23,23,1033,1040,1464,1463,0,23,23,24,24,909,910,1041,1034,0,23,23,23,23,1034,1041,1042,1035,0,23,23,23,23,1035,1042,1043,1036,0,23,23,23,23,1036,1043,1044,1037,0,23,23,23,23,1037,1044,1045,1038,0,23,23,23,23,1038,1045,1046,1039,0,23,23,23,23,1039,1046,1047,1040,0,23,23,23,23,1040,1047,1465,1464,0,23,23,24,24,910,911,1048,1041,0,23,23,23,23,1041,1048,1049,1042,0,23,23,23,23,1042,1049,1050,1043,0,23,23,23,23,1043,1050,1051,1044,0,23,23,23,23,1044,1051,1052,1045,0,23,23,23,23,1045,1052,1053,1046,0,23,23,23,23,1046,1053,1054,1047,0,23,23,23,23,1047,1054,1466,1465,0,23,23,24,24,911,912,1055,1048,0,23,23,23,23,1048,1055,1056,1049,0,23,23,23,23,1049,1056,1057,1050,0,23,23,23,23,1050,1057,1058,1051,0,23,23,23,23,1051,1058,1059,1052,0,23,23,23,23,1052,1059,1060,1053,0,23,23,23,23,1053,1060,1061,1054,0,23,23,23,23,1054,1061,1467,1466,0,23,23,24,24,912,913,1062,1055,0,23,23,23,23,1055,1062,1063,1056,0,23,23,23,23,1056,1063,1064,1057,0,23,23,23,23,1057,1064,1065,1058,0,23,23,23,23,1058,1065,1066,1059,0,23,23,23,23,1059,1066,1067,1060,0,23,23,23,23,1060,1067,1068,1061,0,23,23,23,23,1061,1068,1468,1467,0,23,23,24,24,913,914,1069,1062,0,23,23,23,23,1062,1069,1070,1063,0,23,23,23,23,1063,1070,1071,1064,0,23,23,23,23,1064,1071,1072,1065,0,23,23,23,23,1065,1072,1073,1066,0,23,23,23,23,1066,1073,1074,1067,0,23,23,23,23,1067,1074,1075,1068,0,23,23,23,23,1068,1075,1469,1468,0,23,23,24,24,914,1522,1523,1069,0,23,13,13,23,1069,1523,1524,1070,0,23,13,13,23,1070,1524,1525,1071,0,23,13,13,23,1071,1525,1526,1072,0,23,13,13,23,1072,1526,1527,1073,0,23,13,13,23,1073,1527,1528,1074,0,23,13,13,23,1074,1528,1529,1075,0,23,13,13,23,1075,1529,1537,1469,0,23,13,14,24,900,915,1076,922,0,23,23,23,23,922,1076,1077,923,0,23,23,23,23,923,1077,1078,924,0,23,23,23,23,924,1078,1079,925,0,23,23,23,23,925,1079,1080,926,0,23,23,23,23,926,1080,1081,927,0,23,23,23,23,927,1081,1082,928,0,23,23,23,23,928,1082,1433,1432,0,23,23,6,6,915,916,1083,1076,0,23,23,23,23,1076,1083,1084,1077,0,23,23,23,23,1077,1084,1085,1078,0,23,23,23,23,1078,1085,1086,1079,0,23,23,23,23,1079,1086,1087,1080,0,23,23,23,23,1080,1087,1088,1081,0,23,23,23,23,1081,1088,1089,1082,0,23,23,23,23,1082,1089,1434,1433,0,23,23,6,6,916,917,1090,1083,0,23,23,23,23,1083,1090,1091,1084,0,23,23,23,23,1084,1091,1092,1085,0,23,23,23,23,1085,1092,1093,1086,0,23,23,23,23,1086,1093,1094,1087,0,23,23,23,23,1087,1094,1095,1088,0,23,23,23,23,1088,1095,1096,1089,0,23,23,23,23,1089,1096,1435,1434,0,23,23,6,6,917,918,1097,1090,0,23,23,23,23,1090,1097,1098,1091,0,23,23,23,23,1091,1098,1099,1092,0,23,23,23,23,1092,1099,1100,1093,0,23,23,23,23,1093,1100,1101,1094,0,23,23,23,23,1094,1101,1102,1095,0,23,23,23,23,1095,1102,1103,1096,0,23,23,23,23,1096,1103,1436,1435,0,23,23,6,6,918,919,1104,1097,0,23,23,23,23,1097,1104,1105,1098,0,23,23,23,23,1098,1105,1106,1099,0,23,23,23,23,1099,1106,1107,1100,0,23,23,23,23,1100,1107,1108,1101,0,23,23,23,23,1101,1108,1109,1102,0,23,23,23,23,1102,1109,1110,1103,0,23,23,23,23,1103,1110,1437,1436,0,23,23,6,6,919,920,1111,1104,0,23,23,23,23,1104,1111,1112,1105,0,23,23,23,23,1105,1112,1113,1106,0,23,23,23,23,1106,1113,1114,1107,0,23,23,23,23,1107,1114,1115,1108,0,23,23,23,23,1108,1115,1116,1109,0,23,23,23,23,1109,1116,1117,1110,0,23,23,23,23,1110,1117,1438,1437,0,23,23,6,6,920,921,1118,1111,0,23,23,23,23,1111,1118,1119,1112,0,23,23,23,23,1112,1119,1120,1113,0,23,23,23,23,1113,1120,1121,1114,0,23,23,23,23,1114,1121,1122,1115,0,23,23,23,23,1115,1122,1123,1116,0,23,23,23,23,1116,1123,1124,1117,0,23,23,23,23,1117,1124,1439,1438,0,23,23,6,6,921,1462,1461,1118,0,23,24,24,23,1118,1461,1460,1119,0,23,24,24,23,1119,1460,1459,1120,0,23,24,24,23,1120,1459,1458,1121,0,23,24,24,23,1121,1458,1457,1122,0,23,24,24,23,1122,1457,1456,1123,0,23,24,24,23,1123,1456,1455,1124,0,23,24,24,23,1124,1455,1533,1439,0,23,24,8,6,1125,1147,1154,1126,0,25,25,25,25,1126,1154,1155,1127,0,25,25,25,25,1127,1155,1156,1128,0,25,25,25,25,1128,1156,1157,1129,0,25,25,25,25,1129,1157,1158,1130,0,25,25,25,25,1130,1158,1159,1131,0,25,25,25,25,1131,1159,1160,1132,0,25,25,25,25,1132,1160,1388,1387,0,25,25,19,19,1147,1148,1161,1154,0,25,25,25,25,1154,1161,1162,1155,0,25,25,25,25,1155,1162,1163,1156,0,25,25,25,25,1156,1163,1164,1157,0,25,25,25,25,1157,1164,1165,1158,0,25,25,25,25,1158,1165,1166,1159,0,25,25,25,25,1159,1166,1167,1160,0,25,25,25,25,1160,1167,1389,1388,0,25,25,19,19,1148,1149,1168,1161,0,25,25,25,25,1161,1168,1169,1162,0,25,25,25,25,1162,1169,1170,1163,0,25,25,25,25,1163,1170,1171,1164,0,25,25,25,25,1164,1171,1172,1165,0,25,25,25,25,1165,1172,1173,1166,0,25,25,25,25,1166,1173,1174,1167,0,25,25,25,25,1167,1174,1390,1389,0,25,25,19,19,1149,1150,1175,1168,0,25,25,25,25,1168,1175,1176,1169,0,25,25,25,25,1169,1176,1177,1170,0,25,25,25,25,1170,1177,1178,1171,0,25,25,25,25,1171,1178,1179,1172,0,25,25,25,25,1172,1179,1180,1173,0,25,25,25,25,1173,1180,1181,1174,0,25,25,25,25,1174,1181,1391,1390,0,25,25,19,19,1150,1151,1182,1175,0,25,25,25,25,1175,1182,1183,1176,0,25,25,25,25,1176,1183,1184,1177,0,25,25,25,25,1177,1184,1185,1178,0,25,25,25,25,1178,1185,1186,1179,0,25,25,25,25,1179,1186,1187,1180,0,25,25,25,25,1180,1187,1188,1181,0,25,25,25,25,1181,1188,1392,1391,0,25,25,19,19,1151,1152,1189,1182,0,25,25,25,25,1182,1189,1190,1183,0,25,25,25,25,1183,1190,1191,1184,0,25,25,25,25,1184,1191,1192,1185,0,25,25,25,25,1185,1192,1193,1186,0,25,25,25,25,1186,1193,1194,1187,0,25,25,25,25,1187,1194,1195,1188,0,25,25,25,25,1188,1195,1393,1392,0,25,25,19,19,1152,1153,1196,1189,0,25,25,25,25,1189,1196,1197,1190,0,25,25,25,25,1190,1197,1198,1191,0,25,25,25,25,1191,1198,1199,1192,0,25,25,25,25,1192,1199,1200,1193,0,25,25,25,25,1193,1200,1201,1194,0,25,25,25,25,1194,1201,1202,1195,0,25,25,25,25,1195,1202,1394,1393,0,25,25,19,19,1153,1492,1491,1196,0,25,10,10,25,1196,1491,1490,1197,0,25,10,10,25,1197,1490,1489,1198,0,25,10,10,25,1198,1489,1488,1199,0,25,10,10,25,1199,1488,1487,1200,0,25,10,10,25,1200,1487,1486,1201,0,25,10,10,25,1201,1486,1485,1202,0,25,10,10,25,1202,1485,1534,1394,0,25,10,12,19,1125,1126,1203,1133,0,25,25,25,25,1133,1203,1204,1134,0,25,25,25,25,1134,1204,1205,1135,0,25,25,25,25,1135,1205,1206,1136,0,25,25,25,25,1136,1206,1207,1137,0,25,25,25,25,1137,1207,1208,1138,0,25,25,25,25,1138,1208,1209,1139,0,25,25,25,25,1139,1209,1371,1372,0,25,25,2,2,1126,1127,1210,1203,0,25,25,25,25,1203,1210,1211,1204,0,25,25,25,25,1204,1211,1212,1205,0,25,25,25,25,1205,1212,1213,1206,0,25,25,25,25,1206,1213,1214,1207,0,25,25,25,25,1207,1214,1215,1208,0,25,25,25,25,1208,1215,1216,1209,0,25,25,25,25,1209,1216,1370,1371,0,25,25,2,2,1127,1128,1217,1210,0,25,25,25,25,1210,1217,1218,1211,0,25,25,25,25,1211,1218,1219,1212,0,25,25,25,25,1212,1219,1220,1213,0,25,25,25,25,1213,1220,1221,1214,0,25,25,25,25,1214,1221,1222,1215,0,25,25,25,25,1215,1222,1223,1216,0,25,25,25,25,1216,1223,1369,1370,0,25,25,2,2,1128,1129,1224,1217,0,25,25,25,25,1217,1224,1225,1218,0,25,25,25,25,1218,1225,1226,1219,0,25,25,25,25,1219,1226,1227,1220,0,25,25,25,25,1220,1227,1228,1221,0,25,25,25,25,1221,1228,1229,1222,0,25,25,25,25,1222,1229,1230,1223,0,25,25,25,25,1223,1230,1368,1369,0,25,25,2,2,1129,1130,1231,1224,0,25,25,25,25,1224,1231,1232,1225,0,25,25,25,25,1225,1232,1233,1226,0,25,25,25,25,1226,1233,1234,1227,0,25,25,25,25,1227,1234,1235,1228,0,25,25,25,25,1228,1235,1236,1229,0,25,25,25,25,1229,1236,1237,1230,0,25,25,25,25,1230,1237,1367,1368,0,25,25,2,2,1130,1131,1238,1231,0,25,25,25,25,1231,1238,1239,1232,0,25,25,25,25,1232,1239,1240,1233,0,25,25,25,25,1233,1240,1241,1234,0,25,25,25,25,1234,1241,1242,1235,0,25,25,25,25,1235,1242,1243,1236,0,25,25,25,25,1236,1243,1244,1237,0,25,25,25,25,1237,1244,1366,1367,0,25,25,2,2,1131,1132,1245,1238,0,25,25,25,25,1238,1245,1246,1239,0,25,25,25,25,1239,1246,1247,1240,0,25,25,25,25,1240,1247,1248,1241,0,25,25,25,25,1241,1248,1249,1242,0,25,25,25,25,1242,1249,1250,1243,0,25,25,25,25,1243,1250,1251,1244,0,25,25,25,25,1244,1251,1365,1366,0,25,25,2,2,1132,1387,1386,1245,0,25,19,19,25,1245,1386,1385,1246,0,25,19,19,25,1246,1385,1384,1247,0,25,19,19,25,1247,1384,1383,1248,0,25,19,19,25,1248,1383,1382,1249,0,25,19,19,25,1249,1382,1381,1250,0,25,19,19,25,1250,1381,1380,1251,0,25,19,19,25,1251,1380,1530,1365,0,25,19,3,2,1125,1133,1252,1140,0,25,25,25,25,1140,1252,1253,1141,0,25,25,25,25,1141,1253,1254,1142,0,25,25,25,25,1142,1254,1255,1143,0,25,25,25,25,1143,1255,1256,1144,0,25,25,25,25,1144,1256,1257,1145,0,25,25,25,25,1145,1257,1258,1146,0,25,25,25,25,1146,1258,1461,1462,0,25,25,24,24,1133,1134,1259,1252,0,25,25,25,25,1252,1259,1260,1253,0,25,25,25,25,1253,1260,1261,1254,0,25,25,25,25,1254,1261,1262,1255,0,25,25,25,25,1255,1262,1263,1256,0,25,25,25,25,1256,1263,1264,1257,0,25,25,25,25,1257,1264,1265,1258,0,25,25,25,25,1258,1265,1460,1461,0,25,25,24,24,1134,1135,1266,1259,0,25,25,25,25,1259,1266,1267,1260,0,25,25,25,25,1260,1267,1268,1261,0,25,25,25,25,1261,1268,1269,1262,0,25,25,25,25,1262,1269,1270,1263,0,25,25,25,25,1263,1270,1271,1264,0,25,25,25,25,1264,1271,1272,1265,0,25,25,25,25,1265,1272,1459,1460,0,25,25,24,24,1135,1136,1273,1266,0,25,25,25,25,1266,1273,1274,1267,0,25,25,25,25,1267,1274,1275,1268,0,25,25,25,25,1268,1275,1276,1269,0,25,25,25,25,1269,1276,1277,1270,0,25,25,25,25,1270,1277,1278,1271,0,25,25,25,25,1271,1278,1279,1272,0,25,25,25,25,1272,1279,1458,1459,0,25,25,24,24,1136,1137,1280,1273,0,25,25,25,25,1273,1280,1281,1274,0,25,25,25,25,1274,1281,1282,1275,0,25,25,25,25,1275,1282,1283,1276,0,25,25,25,25,1276,1283,1284,1277,0,25,25,25,25,1277,1284,1285,1278,0,25,25,25,25,1278,1285,1286,1279,0,25,25,25,25,1279,1286,1457,1458,0,25,25,24,24,1137,1138,1287,1280,0,25,25,25,25,1280,1287,1288,1281,0,25,25,25,25,1281,1288,1289,1282,0,25,25,25,25,1282,1289,1290,1283,0,25,25,25,25,1283,1290,1291,1284,0,25,25,25,25,1284,1291,1292,1285,0,25,25,25,25,1285,1292,1293,1286,0,25,25,25,25,1286,1293,1456,1457,0,25,25,24,24,1138,1139,1294,1287,0,25,25,25,25,1287,1294,1295,1288,0,25,25,25,25,1288,1295,1296,1289,0,25,25,25,25,1289,1296,1297,1290,0,25,25,25,25,1290,1297,1298,1291,0,25,25,25,25,1291,1298,1299,1292,0,25,25,25,25,1292,1299,1300,1293,0,25,25,25,25,1293,1300,1455,1456,0,25,25,24,24,1139,1372,1373,1294,0,25,2,2,25,1294,1373,1374,1295,0,25,2,2,25,1295,1374,1375,1296,0,25,2,2,25,1296,1375,1376,1297,0,25,2,2,25,1297,1376,1377,1298,0,25,2,2,25,1298,1377,1378,1299,0,25,2,2,25,1299,1378,1379,1300,0,25,2,2,25,1300,1379,1533,1455,0,25,2,8,24,1125,1140,1301,1147,0,25,25,25,25,1147,1301,1302,1148,0,25,25,25,25,1148,1302,1303,1149,0,25,25,25,25,1149,1303,1304,1150,0,25,25,25,25,1150,1304,1305,1151,0,25,25,25,25,1151,1305,1306,1152,0,25,25,25,25,1152,1306,1307,1153,0,25,25,25,25,1153,1307,1493,1492,0,25,25,10,10,1140,1141,1308,1301,0,25,25,25,25,1301,1308,1309,1302,0,25,25,25,25,1302,1309,1310,1303,0,25,25,25,25,1303,1310,1311,1304,0,25,25,25,25,1304,1311,1312,1305,0,25,25,25,25,1305,1312,1313,1306,0,25,25,25,25,1306,1313,1314,1307,0,25,25,25,25,1307,1314,1494,1493,0,25,25,10,10,1141,1142,1315,1308,0,25,25,25,25,1308,1315,1316,1309,0,25,25,25,25,1309,1316,1317,1310,0,25,25,25,25,1310,1317,1318,1311,0,25,25,25,25,1311,1318,1319,1312,0,25,25,25,25,1312,1319,1320,1313,0,25,25,25,25,1313,1320,1321,1314,0,25,25,25,25,1314,1321,1495,1494,0,25,25,10,10,1142,1143,1322,1315,0,25,25,25,25,1315,1322,1323,1316,0,25,25,25,25,1316,1323,1324,1317,0,25,25,25,25,1317,1324,1325,1318,0,25,25,25,25,1318,1325,1326,1319,0,25,25,25,25,1319,1326,1327,1320,0,25,25,25,25,1320,1327,1328,1321,0,25,25,25,25,1321,1328,1496,1495,0,25,25,10,10,1143,1144,1329,1322,0,25,25,25,25,1322,1329,1330,1323,0,25,25,25,25,1323,1330,1331,1324,0,25,25,25,25,1324,1331,1332,1325,0,25,25,25,25,1325,1332,1333,1326,0,25,25,25,25,1326,1333,1334,1327,0,25,25,25,25,1327,1334,1335,1328,0,25,25,25,25,1328,1335,1497,1496,0,25,25,10,10,1144,1145,1336,1329,0,25,25,25,25,1329,1336,1337,1330,0,25,25,25,25,1330,1337,1338,1331,0,25,25,25,25,1331,1338,1339,1332,0,25,25,25,25,1332,1339,1340,1333,0,25,25,25,25,1333,1340,1341,1334,0,25,25,25,25,1334,1341,1342,1335,0,25,25,25,25,1335,1342,1498,1497,0,25,25,10,10,1145,1146,1343,1336,0,25,25,25,25,1336,1343,1344,1337,0,25,25,25,25,1337,1344,1345,1338,0,25,25,25,25,1338,1345,1346,1339,0,25,25,25,25,1339,1346,1347,1340,0,25,25,25,25,1340,1347,1348,1341,0,25,25,25,25,1341,1348,1349,1342,0,25,25,25,25,1342,1349,1499,1498,0,25,25,10,10,1146,1462,1463,1343,0,25,24,24,25,1343,1463,1464,1344,0,25,24,24,25,1344,1464,1465,1345,0,25,24,24,25,1345,1465,1466,1346,0,25,24,24,25,1346,1466,1467,1347,0,25,24,24,25,1347,1467,1468,1348,0,25,24,24,25,1348,1468,1469,1349,0,25,24,24,25,1349,1469,1537,1499,0,25,24,14,10], + 'quads_uv': [], + 'quads_n_uv': [], + + 'end': (new Date).getTime() + +} + +postMessage( model ); diff --git a/src/extras/io/Loader.js b/src/extras/io/Loader.js index 74f4df54..c9c51441 100644 --- a/src/extras/io/Loader.js +++ b/src/extras/io/Loader.js @@ -766,7 +766,7 @@ THREE.Loader.prototype = { function init_vertices() { - var i, l, x, y, z; + var i, l, x, y, z, r, g, b; for( i = 0, l = data.vertices.length; i < l; i += 3 ) { @@ -777,6 +777,20 @@ THREE.Loader.prototype = { THREE.Loader.prototype.v( scope, x, y, z ); } + + if ( data.colors ) { + + for( i = 0, l = data.colors.length; i < l; i += 3 ) { + + r = data.colors[ i ]; + g = data.colors[ i + 1 ]; + b = data.colors[ i + 2 ]; + + THREE.Loader.prototype.vc( scope, r, g, b ); + + } + + } } @@ -1004,6 +1018,14 @@ THREE.Loader.prototype = { }, + vc: function( scope, r, g, b ) { + + var color = new THREE.Color( 0xffffff ); + color.setRGB( r, g, b ); + scope.colors.push( color ); + + }, + f3: function( scope, a, b, c, mi ) { var material = scope.materials[ mi ]; @@ -1147,39 +1169,49 @@ THREE.Loader.prototype = { } - var material, texture, color; + var material, mtype, mpars, texture, color; + // defaults + + mtype = "MeshLambertMaterial"; + mpars = { color: 0xeeeeee, opacity: 1.0, map: null, light_map: null, vertex_colors: m.vertex_colors }; + + // parameters from model file + + if ( m.shading ) { + + if ( m.shading == "Phong" ) mtype = "MeshPhongMaterial"; + + } + if ( m.map_diffuse && texture_path ) { texture = document.createElement( 'canvas' ); - material = new THREE.MeshLambertMaterial( { map: new THREE.Texture( texture ) } ); - - load_image( material.map, texture_path + "/" + m.map_diffuse ); - + mpars.map = new THREE.Texture( texture ); + load_image( mpars.map, texture_path + "/" + m.map_diffuse ); } else if ( m.col_diffuse ) { - color = (m.col_diffuse[0]*255 << 16) + (m.col_diffuse[1]*255 << 8) + m.col_diffuse[2]*255; - material = new THREE.MeshLambertMaterial( { color: color, opacity: m.transparency } ); + color = ( m.col_diffuse[0] * 255 << 16 ) + ( m.col_diffuse[1] * 255 << 8 ) + m.col_diffuse[2] * 255; + mpars.color = color; + mpars.opacity = m.transparency; } else if ( m.a_dbg_color ) { - material = new THREE.MeshLambertMaterial( { color: m.a_dbg_color } ); - - } else { - - material = new THREE.MeshLambertMaterial( { color: 0xeeeeee } ); + mpars.color = m.a_dbg_color; } - + if ( m.map_lightmap && texture_path ) { texture = document.createElement( 'canvas' ); - material.light_map = new THREE.Texture( texture ); + mpars.light_map = new THREE.Texture( texture ); - load_image( material.light_map, texture_path + "/" + m.map_lightmap ); + load_image( mpars.light_map, texture_path + "/" + m.map_lightmap ); } + + material = new THREE[ mtype ]( mpars ); return material; diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index a63da84a..0c122a0b 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -26,7 +26,8 @@ THREE.WebGLRenderer = function ( parameters ) { // gl state cache - _cullEnabled, + _oldDoubleSided = null, + _oldFlipSided = null, _oldBlending = null, // camera matrices caches @@ -531,7 +532,7 @@ THREE.WebGLRenderer = function ( parameters ) { c1 = obj_colors[ face.a ]; c2 = obj_colors[ face.b ]; c3 = obj_colors[ face.c ]; - c3 = obj_colors[ face.d ]; + c4 = obj_colors[ face.d ]; colorArray[ offset_color ] = c1.r; colorArray[ offset_color + 1 ] = c1.g; @@ -1364,34 +1365,35 @@ THREE.WebGLRenderer = function ( parameters ) { function setObjectFaces( object ) { - if( object.doubleSided ) { - - if ( _cullEnabled ) { + if ( _oldDoubleSided != object.doubleSided ) { - _gl.disable( _gl.CULL_FACE ); - _cullEnabled = false; + if( object.doubleSided ) { - } + _gl.disable( _gl.CULL_FACE ); - } else { + } else { - if ( ! _cullEnabled ) { - _gl.enable( _gl.CULL_FACE ); - _cullEnabled = true; } - + + _oldDoubleSided = object.doubleSided; + + } + + if ( _oldFlipSided != object.flipSided ) { + if( object.flipSided ) { _gl.frontFace( _gl.CW ); - } - else { + } else { _gl.frontFace( _gl.CCW ); } + + _oldFlipSided = object.flipSided; } diff --git a/utils/exporters/blender/2.55/scripts/op/io_mesh_threejs/__init__.py b/utils/exporters/blender/2.55/scripts/op/io_mesh_threejs/__init__.py index 9da4ddc9..c85f3e21 100644 --- a/utils/exporters/blender/2.55/scripts/op/io_mesh_threejs/__init__.py +++ b/utils/exporters/blender/2.55/scripts/op/io_mesh_threejs/__init__.py @@ -36,6 +36,7 @@ class ExportTHREEJS(bpy.types.Operator, ExportHelper): use_modifiers = BoolProperty(name="Apply Modifiers", description="Apply modifiers to the exported mesh", default=True) use_normals = BoolProperty(name="Normals", description="Export normals", default=True) + use_colors = BoolProperty(name="Colors", description="Export vertex colors", default=True) use_uv_coords = BoolProperty(name="UVs", description="Export texture coordinates", default=True) align_types = [("None","None","None"), ("Center","Center","Center"), ("Bottom","Bottom","Bottom"), ("Top","Top","Top")] @@ -63,6 +64,8 @@ class ExportTHREEJS(bpy.types.Operator, ExportHelper): row = layout.row() row.prop(self.properties, "use_normals") row = layout.row() + row.prop(self.properties, "use_colors") + row = layout.row() row.prop(self.properties, "use_uv_coords") row = layout.row() row.prop(self.properties, "align_model") diff --git a/utils/exporters/blender/2.55/scripts/op/io_mesh_threejs/export_threejs.py b/utils/exporters/blender/2.55/scripts/op/io_mesh_threejs/export_threejs.py index 1ee74c82..9256088a 100644 --- a/utils/exporters/blender/2.55/scripts/op/io_mesh_threejs/export_threejs.py +++ b/utils/exporters/blender/2.55/scripts/op/io_mesh_threejs/export_threejs.py @@ -63,25 +63,27 @@ TEMPLATE_FILE_ASCII = """\ var model = { - 'materials': [%(materials)s], + 'materials': [%(materials)s], - 'normals': [%(normals)s], + 'normals': [%(normals)s], - 'vertices': [%(vertices)s], + 'vertices': [%(vertices)s], - 'uvs': [%(uvs)s], + 'colors': [%(colors)s], - 'triangles': [%(triangles)s], - 'triangles_n': [%(triangles_n)s], - 'triangles_uv': [%(triangles_uv)s], - 'triangles_n_uv': [%(triangles_n_uv)s], + 'uvs': [%(uvs)s], - 'quads': [%(quads)s], - 'quads_n': [%(quads_n)s], - 'quads_uv': [%(quads_uv)s], - 'quads_n_uv': [%(quads_n_uv)s], + 'triangles': [%(triangles)s], + 'triangles_n': [%(triangles_n)s], + 'triangles_uv': [%(triangles_uv)s], + 'triangles_n_uv': [%(triangles_n_uv)s], - 'end': (new Date).getTime() + 'quads': [%(quads)s], + 'quads_n': [%(quads_n)s], + 'quads_uv': [%(quads_uv)s], + 'quads_n_uv': [%(quads_n_uv)s], + + 'end': (new Date).getTime() } @@ -106,6 +108,7 @@ TEMPLATE_TRI_N_UV = "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d" TEMPLATE_QUAD_N_UV = "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d" TEMPLATE_N = "%f,%f,%f" +TEMPLATE_C = "%f,%f,%f" TEMPLATE_UV = "%f,%f" # ##################################################### @@ -219,6 +222,9 @@ def generate_vertex(v): def generate_normal(n): return TEMPLATE_N % (n[0], n[1], n[2]) +def generate_vertex_color(c): + return TEMPLATE_C % (c[0], c[1], c[2]) + def generate_uv(uv): return TEMPLATE_UV % (uv[0], 1.0 - uv[1]) @@ -363,6 +369,45 @@ def generate_normals(normals, use_normals): return ",".join(generate_normal(n) for n in chunks) +# ##################################################### +# Vertex colors +# ##################################################### +def extract_vertex_colors(mesh, use_colors): + if not use_colors: + return {} + + colors = {} + + color_layer = mesh.vertex_colors.active.data + + for face_index, face in enumerate(mesh.faces): + + face_colors = color_layer[face_index] + face_colors = face_colors.color1, face_colors.color2, face_colors.color3, face_colors.color4 + + for i, vertex_index in enumerate(face.vertices): + + if vertex_index not in colors: + fc = face_colors[i] + colors[vertex_index] = fc[0], fc[1], fc[2] + + # make sure all vertices have some color + for i in range(len(mesh.vertices)): + if i not in colors: + colors[i] = (0,0,0) + + return colors + +def generate_vertex_colors(colors, use_colors): + if not use_colors: + return "" + + chunks = [] + for vertex_index, color in sorted(colors.items(), key=operator.itemgetter(0)): + chunks.append(color) + + return ",".join(generate_vertex_color(c) for c in chunks) + # ##################################################### # UVs # ##################################################### @@ -421,16 +466,19 @@ def generate_mtl(materials): mtl[m] = { 'a_dbg_name': m, 'a_dbg_index': index, - 'a_dbg_color': generate_color(index) + 'a_dbg_color': generate_color(index), + 'vertex_colors' : False } return mtl def value2string(v): - if type(v)==str and v[0] != "0": + if type(v) == str and v[0] != "0": return '"%s"' % v + elif type(v) == bool: + return str(v).lower() return str(v) -def generate_materials(mtl, materials): +def generate_materials(mtl, materials, use_colors): """Generate JS array of materials objects """ @@ -445,6 +493,7 @@ def generate_materials(mtl, materials): mtl[m]['a_dbg_name'] = m mtl[m]['a_dbg_index'] = index mtl[m]['a_dbg_color'] = generate_color(index) + mtl[m]['vertex_colors'] = use_colors mtl_raw = ",\n".join(['\t"%s" : %s' % (n, value2string(v)) for n,v in sorted(mtl[m].items())]) mtl_string = "\t{\n%s\n\t}" % mtl_raw @@ -459,34 +508,41 @@ def extract_materials(mesh, scene): for m in mesh.materials: if m: materials[m.name] = {} - materials[m.name]['col_diffuse'] = [m.diffuse_intensity * m.diffuse_color[0], - m.diffuse_intensity * m.diffuse_color[1], - m.diffuse_intensity * m.diffuse_color[2]] + material = materials[m.name] + + material['col_diffuse'] = [m.diffuse_intensity * m.diffuse_color[0], + m.diffuse_intensity * m.diffuse_color[1], + m.diffuse_intensity * m.diffuse_color[2]] - materials[m.name]['col_specular'] = [m.specular_intensity * m.specular_color[0], - m.specular_intensity * m.specular_color[1], - m.specular_intensity * m.specular_color[2]] + material['col_specular'] = [m.specular_intensity * m.specular_color[0], + m.specular_intensity * m.specular_color[1], + m.specular_intensity * m.specular_color[2]] - materials[m.name]['col_ambient'] = [m.ambient * world.ambient_color[0], - m.ambient * world.ambient_color[1], - m.ambient * world.ambient_color[2]] + material['col_ambient'] = [m.ambient * world.ambient_color[0], + m.ambient * world.ambient_color[1], + m.ambient * world.ambient_color[2]] - materials[m.name]['transparency'] = m.alpha + material['transparency'] = m.alpha # not sure about mapping values to Blinn-Phong shader # Blender uses INT from [1,511] with default 0 # http://www.blender.org/documentation/blender_python_api_2_54_0/bpy.types.Material.html#bpy.types.Material.specular_hardness - materials[m.name]["specular_coef"] = m.specular_hardness + material["specular_coef"] = m.specular_hardness if m.active_texture and m.active_texture.type == 'IMAGE': fn = bpy.path.abspath(m.active_texture.image.filepath) fn = os.path.normpath(fn) fn_strip = os.path.basename(fn) - materials[m.name]['map_diffuse'] = fn_strip + material['map_diffuse'] = fn_strip + + if m.specular_intensity > 0.0 and (m.specular_color[0] > 0 or m.specular_color[1] > 0 or m.specular_color[2] > 0): + material['shading'] = "Phong" + else: + material['shading'] = "Lambert" return materials -def generate_materials_string(mesh, scene): +def generate_materials_string(mesh, scene, use_colors): random.seed(42) # to get well defined color order for debug materials @@ -508,12 +564,12 @@ def generate_materials_string(mesh, scene): # extract real materials from the mesh mtl.update(extract_materials(mesh, scene)) - return generate_materials(mtl, materials) + return generate_materials(mtl, materials, use_colors) # ##################################################### # ASCII exporter # ##################################################### -def generate_ascii_model(mesh, scene, use_normals, use_uv_coords, align_model): +def generate_ascii_model(mesh, scene, use_normals, use_colors, use_uv_coords, align_model): vertices = mesh.vertices[:] @@ -527,6 +583,7 @@ def generate_ascii_model(mesh, scene, use_normals, use_uv_coords, align_model): sfaces = sort_faces(mesh.faces, use_normals, use_uv_coords) normals = extract_vertex_normals(mesh, use_normals) + colors = extract_vertex_colors(mesh, use_colors) uvs = extract_uvs(mesh, use_uv_coords) text = TEMPLATE_FILE_ASCII % { @@ -544,8 +601,9 @@ def generate_ascii_model(mesh, scene, use_normals, use_uv_coords, align_model): "uvs" : generate_uvs(uvs, use_uv_coords), "normals" : generate_normals(normals, use_normals), + "colors" : generate_vertex_colors(colors, use_colors), - "materials" : generate_materials_string(mesh, scene), + "materials" : generate_materials_string(mesh, scene, use_colors), "nvertex" : len(mesh.vertices), "nface" : len(mesh.faces), @@ -557,7 +615,7 @@ def generate_ascii_model(mesh, scene, use_normals, use_uv_coords, align_model): # ##################################################### # Main # ##################################################### -def save(operator, context, filepath="", use_modifiers=True, use_normals=True, use_uv_coords=True, align_model=1): +def save(operator, context, filepath="", use_modifiers=True, use_normals=True, use_colors=True, use_uv_coords=True, align_model=1): def rvec3d(v): return round(v[0], 6), round(v[1], 6), round(v[2], 6) @@ -594,6 +652,10 @@ def save(operator, context, filepath="", use_modifiers=True, use_normals=True, u faceUV = (len(mesh.uv_textures) > 0) vertexUV = (len(mesh.sticky) > 0) + vertexColors = len(mesh.vertex_colors) > 0 + + if not vertexColors: + use_colors = False if (not faceUV) and (not vertexUV): use_uv_coords = False @@ -603,7 +665,12 @@ def save(operator, context, filepath="", use_modifiers=True, use_normals=True, u if not active_uv_layer: use_uv_coords = False - text = generate_ascii_model(mesh, scene, use_normals, use_uv_coords, align_model) + if vertexColors: + active_col_layer = mesh.vertex_colors.active + if not active_col_layer: + use_colors = False + + text = generate_ascii_model(mesh, scene, use_normals, use_colors, use_uv_coords, align_model) file = open(filepath, 'w') file.write(text) file.close()