diff --git a/.gitignore b/.gitignore index 0090cc7..85760b4 100644 --- a/.gitignore +++ b/.gitignore @@ -173,3 +173,5 @@ dist # Finder (MacOS) folder config .DS_Store + +*.blend? \ No newline at end of file diff --git a/hack/convert-meshes.ts b/hack/convert-meshes.ts index 2fbb286..2fa1600 100644 --- a/hack/convert-meshes.ts +++ b/hack/convert-meshes.ts @@ -1,5 +1,6 @@ import chalk from "chalk"; import { globSync } from "glob"; +import { relative, resolve, dirname } from "node:path"; const w = 1; @@ -49,8 +50,13 @@ type Triangle = { // ...vertToArray(t.c), // ]; +const meshAbsolutePath = resolve("./src/renderer/mesh.ts"); + +const getMeshImportPath = (thisFile: string) => + relative(dirname(thisFile), meshAbsolutePath).replace(/\.ts$/g, ""); + export const convertMeshes = async () => { - const meshes = globSync("src/meshes/*.ply"); + const meshes = globSync("src/meshes/**/*.ply"); for (const file of meshes) { const ply = await Bun.file(file).text(); @@ -222,7 +228,7 @@ export const convertMeshes = async () => { facesMaxValue <= 0xff ? 8 : facesMaxValue <= 0xffff ? 16 : 32; const outFile = file.replace(".ply", ".ts"); - const outString = `import { Mesh } from "../renderer/mesh"; + const outString = `import { Mesh } from "${getMeshImportPath(outFile)}"; // prettier-ignore export default new Mesh({ diff --git a/html/003-scene/main.js b/html/003-scene/main.js index 93e3f20..6b0c3cc 100644 --- a/html/003-scene/main.js +++ b/html/003-scene/main.js @@ -1,3 +1,6 @@ -var V6=Object.defineProperty;var C0=(C,V)=>{for(var M in V)V6(C,M,{get:V[M],enumerable:!0,configurable:!0,set:(Q)=>V[M]=()=>Q})};var J=0.000001,k=typeof Float32Array!=="undefined"?Float32Array:Array,n=Math.random,B5=Math.PI/180;if(!Math.hypot)Math.hypot=function(){var C=0,V=arguments.length;while(V--)C+=arguments[V]*arguments[V];return Math.sqrt(C)};function X0(){var C=new k(9);if(k!=Float32Array)C[1]=0,C[2]=0,C[3]=0,C[5]=0,C[6]=0,C[7]=0;return C[0]=1,C[4]=1,C[8]=1,C}var g={};C0(g,{transpose:()=>{{return Y6}},translate:()=>{{return Z6}},targetTo:()=>{{return n6}},subtract:()=>{{return G0}},sub:()=>{{return s6}},str:()=>{{return f6}},set:()=>{{return N6}},scale:()=>{{return K6}},rotateZ:()=>{{return D6}},rotateY:()=>{{return U6}},rotateX:()=>{{return $6}},rotate:()=>{{return O6}},perspectiveZO:()=>{{return p6}},perspectiveNO:()=>{{return U0}},perspectiveFromFieldOfView:()=>{{return g6}},perspective:()=>{{return q6}},orthoZO:()=>{{return w6}},orthoNO:()=>{{return D0}},ortho:()=>{{return v6}},multiplyScalarAndAdd:()=>{{return z6}},multiplyScalar:()=>{{return c6}},multiply:()=>{{return K0}},mul:()=>{{return x6}},lookAt:()=>{{return i6}},invert:()=>{{return B6}},identity:()=>{{return Z0}},getTranslation:()=>{{return k6}},getScaling:()=>{{return $0}},getRotation:()=>{{return _6}},frustum:()=>{{return h6}},fromZRotation:()=>{{return L6}},fromYRotation:()=>{{return J6}},fromXRotation:()=>{{return H6}},fromValues:()=>{{return I6}},fromTranslation:()=>{{return G6}},fromScaling:()=>{{return P6}},fromRotationTranslationScaleOrigin:()=>{{return j6}},fromRotationTranslationScale:()=>{{return T6}},fromRotationTranslation:()=>{{return O0}},fromRotation:()=>{{return F6}},fromQuat2:()=>{{return R6}},fromQuat:()=>{{return S6}},frob:()=>{{return d6}},exactEquals:()=>{{return y6}},equals:()=>{{return r6}},determinant:()=>{{return X6}},create:()=>{{return Q6}},copy:()=>{{return E6}},clone:()=>{{return A6}},adjoint:()=>{{return W6}},add:()=>{{return l6}}});function Q6(){var C=new k(16);if(k!=Float32Array)C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[11]=0,C[12]=0,C[13]=0,C[14]=0;return C[0]=1,C[5]=1,C[10]=1,C[15]=1,C}function A6(C){var V=new k(16);return V[0]=C[0],V[1]=C[1],V[2]=C[2],V[3]=C[3],V[4]=C[4],V[5]=C[5],V[6]=C[6],V[7]=C[7],V[8]=C[8],V[9]=C[9],V[10]=C[10],V[11]=C[11],V[12]=C[12],V[13]=C[13],V[14]=C[14],V[15]=C[15],V}function E6(C,V){return C[0]=V[0],C[1]=V[1],C[2]=V[2],C[3]=V[3],C[4]=V[4],C[5]=V[5],C[6]=V[6],C[7]=V[7],C[8]=V[8],C[9]=V[9],C[10]=V[10],C[11]=V[11],C[12]=V[12],C[13]=V[13],C[14]=V[14],C[15]=V[15],C}function I6(C,V,M,Q,A,E,I,N,Y,B,W,Z,O,K,U,$){var X=new k(16);return X[0]=C,X[1]=V,X[2]=M,X[3]=Q,X[4]=A,X[5]=E,X[6]=I,X[7]=N,X[8]=Y,X[9]=B,X[10]=W,X[11]=Z,X[12]=O,X[13]=K,X[14]=U,X[15]=$,X}function N6(C,V,M,Q,A,E,I,N,Y,B,W,Z,O,K,U,$,X){return C[0]=V,C[1]=M,C[2]=Q,C[3]=A,C[4]=E,C[5]=I,C[6]=N,C[7]=Y,C[8]=B,C[9]=W,C[10]=Z,C[11]=O,C[12]=K,C[13]=U,C[14]=$,C[15]=X,C}function Z0(C){return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=1,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C}function Y6(C,V){if(C===V){var M=V[1],Q=V[2],A=V[3],E=V[6],I=V[7],N=V[11];C[1]=V[4],C[2]=V[8],C[3]=V[12],C[4]=M,C[6]=V[9],C[7]=V[13],C[8]=Q,C[9]=E,C[11]=V[14],C[12]=A,C[13]=I,C[14]=N}else C[0]=V[0],C[1]=V[4],C[2]=V[8],C[3]=V[12],C[4]=V[1],C[5]=V[5],C[6]=V[9],C[7]=V[13],C[8]=V[2],C[9]=V[6],C[10]=V[10],C[11]=V[14],C[12]=V[3],C[13]=V[7],C[14]=V[11],C[15]=V[15];return C}function B6(C,V){var M=V[0],Q=V[1],A=V[2],E=V[3],I=V[4],N=V[5],Y=V[6],B=V[7],W=V[8],Z=V[9],O=V[10],K=V[11],U=V[12],$=V[13],X=V[14],D=V[15],L=M*N-Q*I,H=M*Y-A*I,F=M*B-E*I,G=Q*Y-A*N,P=Q*B-E*N,S=A*B-E*Y,_=W*$-Z*U,T=W*X-O*U,j=W*D-K*U,h=Z*X-O*$,q=Z*D-K*$,p=O*D-K*X,R=L*p-H*q+F*h+G*j-P*T+S*_;if(!R)return null;return R=1/R,C[0]=(N*p-Y*q+B*h)*R,C[1]=(A*q-Q*p-E*h)*R,C[2]=($*S-X*P+D*G)*R,C[3]=(O*P-Z*S-K*G)*R,C[4]=(Y*j-I*p-B*T)*R,C[5]=(M*p-A*j+E*T)*R,C[6]=(X*F-U*S-D*H)*R,C[7]=(W*S-O*F+K*H)*R,C[8]=(I*q-N*j+B*_)*R,C[9]=(Q*j-M*q-E*_)*R,C[10]=(U*P-$*F+D*L)*R,C[11]=(Z*F-W*P-K*L)*R,C[12]=(N*T-I*h-Y*_)*R,C[13]=(M*h-Q*T+A*_)*R,C[14]=($*H-U*G-X*L)*R,C[15]=(W*G-Z*H+O*L)*R,C}function W6(C,V){var M=V[0],Q=V[1],A=V[2],E=V[3],I=V[4],N=V[5],Y=V[6],B=V[7],W=V[8],Z=V[9],O=V[10],K=V[11],U=V[12],$=V[13],X=V[14],D=V[15];return C[0]=N*(O*D-K*X)-Z*(Y*D-B*X)+$*(Y*K-B*O),C[1]=-(Q*(O*D-K*X)-Z*(A*D-E*X)+$*(A*K-E*O)),C[2]=Q*(Y*D-B*X)-N*(A*D-E*X)+$*(A*B-E*Y),C[3]=-(Q*(Y*K-B*O)-N*(A*K-E*O)+Z*(A*B-E*Y)),C[4]=-(I*(O*D-K*X)-W*(Y*D-B*X)+U*(Y*K-B*O)),C[5]=M*(O*D-K*X)-W*(A*D-E*X)+U*(A*K-E*O),C[6]=-(M*(Y*D-B*X)-I*(A*D-E*X)+U*(A*B-E*Y)),C[7]=M*(Y*K-B*O)-I*(A*K-E*O)+W*(A*B-E*Y),C[8]=I*(Z*D-K*$)-W*(N*D-B*$)+U*(N*K-B*Z),C[9]=-(M*(Z*D-K*$)-W*(Q*D-E*$)+U*(Q*K-E*Z)),C[10]=M*(N*D-B*$)-I*(Q*D-E*$)+U*(Q*B-E*N),C[11]=-(M*(N*K-B*Z)-I*(Q*K-E*Z)+W*(Q*B-E*N)),C[12]=-(I*(Z*X-O*$)-W*(N*X-Y*$)+U*(N*O-Y*Z)),C[13]=M*(Z*X-O*$)-W*(Q*X-A*$)+U*(Q*O-A*Z),C[14]=-(M*(N*X-Y*$)-I*(Q*X-A*$)+U*(Q*Y-A*N)),C[15]=M*(N*O-Y*Z)-I*(Q*O-A*Z)+W*(Q*Y-A*N),C}function X6(C){var V=C[0],M=C[1],Q=C[2],A=C[3],E=C[4],I=C[5],N=C[6],Y=C[7],B=C[8],W=C[9],Z=C[10],O=C[11],K=C[12],U=C[13],$=C[14],X=C[15],D=V*I-M*E,L=V*N-Q*E,H=V*Y-A*E,F=M*N-Q*I,G=M*Y-A*I,P=Q*Y-A*N,S=B*U-W*K,_=B*$-Z*K,T=B*X-O*K,j=W*$-Z*U,h=W*X-O*U,q=Z*X-O*$;return D*q-L*h+H*j+F*T-G*_+P*S}function K0(C,V,M){var Q=V[0],A=V[1],E=V[2],I=V[3],N=V[4],Y=V[5],B=V[6],W=V[7],Z=V[8],O=V[9],K=V[10],U=V[11],$=V[12],X=V[13],D=V[14],L=V[15],H=M[0],F=M[1],G=M[2],P=M[3];return C[0]=H*Q+F*N+G*Z+P*$,C[1]=H*A+F*Y+G*O+P*X,C[2]=H*E+F*B+G*K+P*D,C[3]=H*I+F*W+G*U+P*L,H=M[4],F=M[5],G=M[6],P=M[7],C[4]=H*Q+F*N+G*Z+P*$,C[5]=H*A+F*Y+G*O+P*X,C[6]=H*E+F*B+G*K+P*D,C[7]=H*I+F*W+G*U+P*L,H=M[8],F=M[9],G=M[10],P=M[11],C[8]=H*Q+F*N+G*Z+P*$,C[9]=H*A+F*Y+G*O+P*X,C[10]=H*E+F*B+G*K+P*D,C[11]=H*I+F*W+G*U+P*L,H=M[12],F=M[13],G=M[14],P=M[15],C[12]=H*Q+F*N+G*Z+P*$,C[13]=H*A+F*Y+G*O+P*X,C[14]=H*E+F*B+G*K+P*D,C[15]=H*I+F*W+G*U+P*L,C}function Z6(C,V,M){var Q=M[0],A=M[1],E=M[2],I,N,Y,B,W,Z,O,K,U,$,X,D;if(V===C)C[12]=V[0]*Q+V[4]*A+V[8]*E+V[12],C[13]=V[1]*Q+V[5]*A+V[9]*E+V[13],C[14]=V[2]*Q+V[6]*A+V[10]*E+V[14],C[15]=V[3]*Q+V[7]*A+V[11]*E+V[15];else I=V[0],N=V[1],Y=V[2],B=V[3],W=V[4],Z=V[5],O=V[6],K=V[7],U=V[8],$=V[9],X=V[10],D=V[11],C[0]=I,C[1]=N,C[2]=Y,C[3]=B,C[4]=W,C[5]=Z,C[6]=O,C[7]=K,C[8]=U,C[9]=$,C[10]=X,C[11]=D,C[12]=I*Q+W*A+U*E+V[12],C[13]=N*Q+Z*A+$*E+V[13],C[14]=Y*Q+O*A+X*E+V[14],C[15]=B*Q+K*A+D*E+V[15];return C}function K6(C,V,M){var Q=M[0],A=M[1],E=M[2];return C[0]=V[0]*Q,C[1]=V[1]*Q,C[2]=V[2]*Q,C[3]=V[3]*Q,C[4]=V[4]*A,C[5]=V[5]*A,C[6]=V[6]*A,C[7]=V[7]*A,C[8]=V[8]*E,C[9]=V[9]*E,C[10]=V[10]*E,C[11]=V[11]*E,C[12]=V[12],C[13]=V[13],C[14]=V[14],C[15]=V[15],C}function O6(C,V,M,Q){var A=Q[0],E=Q[1],I=Q[2],N=Math.hypot(A,E,I),Y,B,W,Z,O,K,U,$,X,D,L,H,F,G,P,S,_,T,j,h,q,p,R,v;if(N0)M[0]=(N*I+W*Q+Y*E-B*A)*2/Z,M[1]=(Y*I+W*A+B*Q-N*E)*2/Z,M[2]=(B*I+W*E+N*A-Y*Q)*2/Z;else M[0]=(N*I+W*Q+Y*E-B*A)*2,M[1]=(Y*I+W*A+B*Q-N*E)*2,M[2]=(B*I+W*E+N*A-Y*Q)*2;return O0(C,V,M),C}function k6(C,V){return C[0]=V[12],C[1]=V[13],C[2]=V[14],C}function $0(C,V){var M=V[0],Q=V[1],A=V[2],E=V[4],I=V[5],N=V[6],Y=V[8],B=V[9],W=V[10];return C[0]=Math.hypot(M,Q,A),C[1]=Math.hypot(E,I,N),C[2]=Math.hypot(Y,B,W),C}function _6(C,V){var M=new k(3);$0(M,V);var Q=1/M[0],A=1/M[1],E=1/M[2],I=V[0]*Q,N=V[1]*A,Y=V[2]*E,B=V[4]*Q,W=V[5]*A,Z=V[6]*E,O=V[8]*Q,K=V[9]*A,U=V[10]*E,$=I+W+U,X=0;if($>0)X=Math.sqrt($+1)*2,C[3]=0.25*X,C[0]=(Z-K)/X,C[1]=(O-Y)/X,C[2]=(N-B)/X;else if(I>W&&I>U)X=Math.sqrt(1+I-W-U)*2,C[3]=(Z-K)/X,C[0]=0.25*X,C[1]=(N+B)/X,C[2]=(O+Y)/X;else if(W>U)X=Math.sqrt(1+W-I-U)*2,C[3]=(O-Y)/X,C[0]=(N+B)/X,C[1]=0.25*X,C[2]=(Z+K)/X;else X=Math.sqrt(1+U-I-W)*2,C[3]=(N-B)/X,C[0]=(O+Y)/X,C[1]=(Z+K)/X,C[2]=0.25*X;return C}function T6(C,V,M,Q){var A=V[0],E=V[1],I=V[2],N=V[3],Y=A+A,B=E+E,W=I+I,Z=A*Y,O=A*B,K=A*W,U=E*B,$=E*W,X=I*W,D=N*Y,L=N*B,H=N*W,F=Q[0],G=Q[1],P=Q[2];return C[0]=(1-(U+X))*F,C[1]=(O+H)*F,C[2]=(K-L)*F,C[3]=0,C[4]=(O-H)*G,C[5]=(1-(Z+X))*G,C[6]=($+D)*G,C[7]=0,C[8]=(K+L)*P,C[9]=($-D)*P,C[10]=(1-(Z+U))*P,C[11]=0,C[12]=M[0],C[13]=M[1],C[14]=M[2],C[15]=1,C}function j6(C,V,M,Q,A){var E=V[0],I=V[1],N=V[2],Y=V[3],B=E+E,W=I+I,Z=N+N,O=E*B,K=E*W,U=E*Z,$=I*W,X=I*Z,D=N*Z,L=Y*B,H=Y*W,F=Y*Z,G=Q[0],P=Q[1],S=Q[2],_=A[0],T=A[1],j=A[2],h=(1-($+D))*G,q=(K+F)*G,p=(U-H)*G,R=(K-F)*P,v=(1-(O+D))*P,c=(X+L)*P,z=(U+H)*S,B0=(X-L)*S,W0=(1-(O+$))*S;return C[0]=h,C[1]=q,C[2]=p,C[3]=0,C[4]=R,C[5]=v,C[6]=c,C[7]=0,C[8]=z,C[9]=B0,C[10]=W0,C[11]=0,C[12]=M[0]+_-(h*_+R*T+z*j),C[13]=M[1]+T-(q*_+v*T+B0*j),C[14]=M[2]+j-(p*_+c*T+W0*j),C[15]=1,C}function S6(C,V){var M=V[0],Q=V[1],A=V[2],E=V[3],I=M+M,N=Q+Q,Y=A+A,B=M*I,W=Q*I,Z=Q*N,O=A*I,K=A*N,U=A*Y,$=E*I,X=E*N,D=E*Y;return C[0]=1-Z-U,C[1]=W+D,C[2]=O-X,C[3]=0,C[4]=W-D,C[5]=1-B-U,C[6]=K+$,C[7]=0,C[8]=O+X,C[9]=K-$,C[10]=1-B-Z,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C}function h6(C,V,M,Q,A,E,I){var N=1/(M-V),Y=1/(A-Q),B=1/(E-I);return C[0]=E*2*N,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=E*2*Y,C[6]=0,C[7]=0,C[8]=(M+V)*N,C[9]=(A+Q)*Y,C[10]=(I+E)*B,C[11]=-1,C[12]=0,C[13]=0,C[14]=I*E*2*B,C[15]=0,C}function U0(C,V,M,Q,A){var E=1/Math.tan(V/2),I;if(C[0]=E/M,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=E,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[11]=-1,C[12]=0,C[13]=0,C[15]=0,A!=null&&A!==Infinity)I=1/(Q-A),C[10]=(A+Q)*I,C[14]=2*A*Q*I;else C[10]=-1,C[14]=-2*Q;return C}function p6(C,V,M,Q,A){var E=1/Math.tan(V/2),I;if(C[0]=E/M,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=E,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[11]=-1,C[12]=0,C[13]=0,C[15]=0,A!=null&&A!==Infinity)I=1/(Q-A),C[10]=A*I,C[14]=A*Q*I;else C[10]=-1,C[14]=-Q;return C}function g6(C,V,M,Q){var A=Math.tan(V.upDegrees*Math.PI/180),E=Math.tan(V.downDegrees*Math.PI/180),I=Math.tan(V.leftDegrees*Math.PI/180),N=Math.tan(V.rightDegrees*Math.PI/180),Y=2/(I+N),B=2/(A+E);return C[0]=Y,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=B,C[6]=0,C[7]=0,C[8]=-((I-N)*Y*0.5),C[9]=(A-E)*B*0.5,C[10]=Q/(M-Q),C[11]=-1,C[12]=0,C[13]=0,C[14]=Q*M/(M-Q),C[15]=0,C}function D0(C,V,M,Q,A,E,I){var N=1/(V-M),Y=1/(Q-A),B=1/(E-I);return C[0]=-2*N,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=-2*Y,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=2*B,C[11]=0,C[12]=(V+M)*N,C[13]=(A+Q)*Y,C[14]=(I+E)*B,C[15]=1,C}function w6(C,V,M,Q,A,E,I){var N=1/(V-M),Y=1/(Q-A),B=1/(E-I);return C[0]=-2*N,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=-2*Y,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=B,C[11]=0,C[12]=(V+M)*N,C[13]=(A+Q)*Y,C[14]=E*B,C[15]=1,C}function i6(C,V,M,Q){var A,E,I,N,Y,B,W,Z,O,K,U=V[0],$=V[1],X=V[2],D=Q[0],L=Q[1],H=Q[2],F=M[0],G=M[1],P=M[2];if(Math.abs(U-F)0)K=1/Math.sqrt(K),W*=K,Z*=K,O*=K;var U=Y*O-B*Z,$=B*W-N*O,X=N*Z-Y*W;if(K=U*U+$*$+X*X,K>0)K=1/Math.sqrt(K),U*=K,$*=K,X*=K;return C[0]=U,C[1]=$,C[2]=X,C[3]=0,C[4]=Z*X-O*$,C[5]=O*U-W*X,C[6]=W*$-Z*U,C[7]=0,C[8]=W,C[9]=Z,C[10]=O,C[11]=0,C[12]=A,C[13]=E,C[14]=I,C[15]=1,C}function f6(C){return"mat4("+C[0]+", "+C[1]+", "+C[2]+", "+C[3]+", "+C[4]+", "+C[5]+", "+C[6]+", "+C[7]+", "+C[8]+", "+C[9]+", "+C[10]+", "+C[11]+", "+C[12]+", "+C[13]+", "+C[14]+", "+C[15]+")"}function d6(C){return Math.hypot(C[0],C[1],C[2],C[3],C[4],C[5],C[6],C[7],C[8],C[9],C[10],C[11],C[12],C[13],C[14],C[15])}function l6(C,V,M){return C[0]=V[0]+M[0],C[1]=V[1]+M[1],C[2]=V[2]+M[2],C[3]=V[3]+M[3],C[4]=V[4]+M[4],C[5]=V[5]+M[5],C[6]=V[6]+M[6],C[7]=V[7]+M[7],C[8]=V[8]+M[8],C[9]=V[9]+M[9],C[10]=V[10]+M[10],C[11]=V[11]+M[11],C[12]=V[12]+M[12],C[13]=V[13]+M[13],C[14]=V[14]+M[14],C[15]=V[15]+M[15],C}function G0(C,V,M){return C[0]=V[0]-M[0],C[1]=V[1]-M[1],C[2]=V[2]-M[2],C[3]=V[3]-M[3],C[4]=V[4]-M[4],C[5]=V[5]-M[5],C[6]=V[6]-M[6],C[7]=V[7]-M[7],C[8]=V[8]-M[8],C[9]=V[9]-M[9],C[10]=V[10]-M[10],C[11]=V[11]-M[11],C[12]=V[12]-M[12],C[13]=V[13]-M[13],C[14]=V[14]-M[14],C[15]=V[15]-M[15],C}function c6(C,V,M){return C[0]=V[0]*M,C[1]=V[1]*M,C[2]=V[2]*M,C[3]=V[3]*M,C[4]=V[4]*M,C[5]=V[5]*M,C[6]=V[6]*M,C[7]=V[7]*M,C[8]=V[8]*M,C[9]=V[9]*M,C[10]=V[10]*M,C[11]=V[11]*M,C[12]=V[12]*M,C[13]=V[13]*M,C[14]=V[14]*M,C[15]=V[15]*M,C}function z6(C,V,M,Q){return C[0]=V[0]+M[0]*Q,C[1]=V[1]+M[1]*Q,C[2]=V[2]+M[2]*Q,C[3]=V[3]+M[3]*Q,C[4]=V[4]+M[4]*Q,C[5]=V[5]+M[5]*Q,C[6]=V[6]+M[6]*Q,C[7]=V[7]+M[7]*Q,C[8]=V[8]+M[8]*Q,C[9]=V[9]+M[9]*Q,C[10]=V[10]+M[10]*Q,C[11]=V[11]+M[11]*Q,C[12]=V[12]+M[12]*Q,C[13]=V[13]+M[13]*Q,C[14]=V[14]+M[14]*Q,C[15]=V[15]+M[15]*Q,C}function y6(C,V){return C[0]===V[0]&&C[1]===V[1]&&C[2]===V[2]&&C[3]===V[3]&&C[4]===V[4]&&C[5]===V[5]&&C[6]===V[6]&&C[7]===V[7]&&C[8]===V[8]&&C[9]===V[9]&&C[10]===V[10]&&C[11]===V[11]&&C[12]===V[12]&&C[13]===V[13]&&C[14]===V[14]&&C[15]===V[15]}function r6(C,V){var M=C[0],Q=C[1],A=C[2],E=C[3],I=C[4],N=C[5],Y=C[6],B=C[7],W=C[8],Z=C[9],O=C[10],K=C[11],U=C[12],$=C[13],X=C[14],D=C[15],L=V[0],H=V[1],F=V[2],G=V[3],P=V[4],S=V[5],_=V[6],T=V[7],j=V[8],h=V[9],q=V[10],p=V[11],R=V[12],v=V[13],c=V[14],z=V[15];return Math.abs(M-L)<=J*Math.max(1,Math.abs(M),Math.abs(L))&&Math.abs(Q-H)<=J*Math.max(1,Math.abs(Q),Math.abs(H))&&Math.abs(A-F)<=J*Math.max(1,Math.abs(A),Math.abs(F))&&Math.abs(E-G)<=J*Math.max(1,Math.abs(E),Math.abs(G))&&Math.abs(I-P)<=J*Math.max(1,Math.abs(I),Math.abs(P))&&Math.abs(N-S)<=J*Math.max(1,Math.abs(N),Math.abs(S))&&Math.abs(Y-_)<=J*Math.max(1,Math.abs(Y),Math.abs(_))&&Math.abs(B-T)<=J*Math.max(1,Math.abs(B),Math.abs(T))&&Math.abs(W-j)<=J*Math.max(1,Math.abs(W),Math.abs(j))&&Math.abs(Z-h)<=J*Math.max(1,Math.abs(Z),Math.abs(h))&&Math.abs(O-q)<=J*Math.max(1,Math.abs(O),Math.abs(q))&&Math.abs(K-p)<=J*Math.max(1,Math.abs(K),Math.abs(p))&&Math.abs(U-R)<=J*Math.max(1,Math.abs(U),Math.abs(R))&&Math.abs($-v)<=J*Math.max(1,Math.abs($),Math.abs(v))&&Math.abs(X-c)<=J*Math.max(1,Math.abs(X),Math.abs(c))&&Math.abs(D-z)<=J*Math.max(1,Math.abs(D),Math.abs(z))}var q6=U0,v6=D0,x6=K0,s6=G0;var w={};C0(w,{str:()=>{{return z7}},squaredLength:()=>{{return m0}},sqrLen:()=>{{return o7}},sqlerp:()=>{{return V5}},slerp:()=>{{return u}},setAxisAngle:()=>{{return d0}},setAxes:()=>{{return M5}},set:()=>{{return s7}},scale:()=>{{return r0}},rotationTo:()=>{{return C5}},rotateZ:()=>{{return w7}},rotateY:()=>{{return v7}},rotateX:()=>{{return g7}},random:()=>{{return f7}},pow:()=>{{return n7}},normalize:()=>{{return A0}},multiply:()=>{{return l0}},mul:()=>{{return e7}},ln:()=>{{return z0}},lerp:()=>{{return b7}},length:()=>{{return s0}},len:()=>{{return u7}},invert:()=>{{return d7}},identity:()=>{{return h7}},getAxisAngle:()=>{{return q7}},getAngle:()=>{{return p7}},fromValues:()=>{{return r7}},fromMat3:()=>{{return y0}},fromEuler:()=>{{return c7}},exp:()=>{{return c0}},exactEquals:()=>{{return t7}},equals:()=>{{return a7}},dot:()=>{{return x0}},create:()=>{{return Q0}},copy:()=>{{return x7}},conjugate:()=>{{return l7}},clone:()=>{{return y7}},calculateW:()=>{{return i7}},add:()=>{{return m7}}});var l={};C0(l,{zero:()=>{{return D7}},transformQuat:()=>{{return Z7}},transformMat4:()=>{{return W7}},transformMat3:()=>{{return X7}},subtract:()=>{{return F0}},sub:()=>{{return H7}},str:()=>{{return G7}},squaredLength:()=>{{return k0}},squaredDistance:()=>{{return R0}},sqrLen:()=>{{return _7}},sqrDist:()=>{{return k7}},set:()=>{{return b6}},scaleAndAdd:()=>{{return Q7}},scale:()=>{{return M7}},round:()=>{{return V7}},rotateZ:()=>{{return $7}},rotateY:()=>{{return O7}},rotateX:()=>{{return K7}},random:()=>{{return B7}},normalize:()=>{{return V0}},negate:()=>{{return A7}},multiply:()=>{{return H0}},mul:()=>{{return J7}},min:()=>{{return a6}},max:()=>{{return C7}},lerp:()=>{{return I7}},length:()=>{{return P0}},len:()=>{{return M0}},inverse:()=>{{return E7}},hermite:()=>{{return N7}},fromValues:()=>{{return e}},forEach:()=>{{return T7}},floor:()=>{{return t6}},exactEquals:()=>{{return P7}},equals:()=>{{return F7}},dot:()=>{{return b}},divide:()=>{{return J0}},div:()=>{{return L7}},distance:()=>{{return L0}},dist:()=>{{return R7}},cross:()=>{{return r}},create:()=>{{return m}},copy:()=>{{return e6}},clone:()=>{{return m6}},ceil:()=>{{return o6}},bezier:()=>{{return Y7}},angle:()=>{{return U7}},add:()=>{{return u6}}});function m(){var C=new k(3);if(k!=Float32Array)C[0]=0,C[1]=0,C[2]=0;return C}function m6(C){var V=new k(3);return V[0]=C[0],V[1]=C[1],V[2]=C[2],V}function P0(C){var V=C[0],M=C[1],Q=C[2];return Math.hypot(V,M,Q)}function e(C,V,M){var Q=new k(3);return Q[0]=C,Q[1]=V,Q[2]=M,Q}function e6(C,V){return C[0]=V[0],C[1]=V[1],C[2]=V[2],C}function b6(C,V,M,Q){return C[0]=V,C[1]=M,C[2]=Q,C}function u6(C,V,M){return C[0]=V[0]+M[0],C[1]=V[1]+M[1],C[2]=V[2]+M[2],C}function F0(C,V,M){return C[0]=V[0]-M[0],C[1]=V[1]-M[1],C[2]=V[2]-M[2],C}function H0(C,V,M){return C[0]=V[0]*M[0],C[1]=V[1]*M[1],C[2]=V[2]*M[2],C}function J0(C,V,M){return C[0]=V[0]/M[0],C[1]=V[1]/M[1],C[2]=V[2]/M[2],C}function o6(C,V){return C[0]=Math.ceil(V[0]),C[1]=Math.ceil(V[1]),C[2]=Math.ceil(V[2]),C}function t6(C,V){return C[0]=Math.floor(V[0]),C[1]=Math.floor(V[1]),C[2]=Math.floor(V[2]),C}function a6(C,V,M){return C[0]=Math.min(V[0],M[0]),C[1]=Math.min(V[1],M[1]),C[2]=Math.min(V[2],M[2]),C}function C7(C,V,M){return C[0]=Math.max(V[0],M[0]),C[1]=Math.max(V[1],M[1]),C[2]=Math.max(V[2],M[2]),C}function V7(C,V){return C[0]=Math.round(V[0]),C[1]=Math.round(V[1]),C[2]=Math.round(V[2]),C}function M7(C,V,M){return C[0]=V[0]*M,C[1]=V[1]*M,C[2]=V[2]*M,C}function Q7(C,V,M,Q){return C[0]=V[0]+M[0]*Q,C[1]=V[1]+M[1]*Q,C[2]=V[2]+M[2]*Q,C}function L0(C,V){var M=V[0]-C[0],Q=V[1]-C[1],A=V[2]-C[2];return Math.hypot(M,Q,A)}function R0(C,V){var M=V[0]-C[0],Q=V[1]-C[1],A=V[2]-C[2];return M*M+Q*Q+A*A}function k0(C){var V=C[0],M=C[1],Q=C[2];return V*V+M*M+Q*Q}function A7(C,V){return C[0]=-V[0],C[1]=-V[1],C[2]=-V[2],C}function E7(C,V){return C[0]=1/V[0],C[1]=1/V[1],C[2]=1/V[2],C}function V0(C,V){var M=V[0],Q=V[1],A=V[2],E=M*M+Q*Q+A*A;if(E>0)E=1/Math.sqrt(E);return C[0]=V[0]*E,C[1]=V[1]*E,C[2]=V[2]*E,C}function b(C,V){return C[0]*V[0]+C[1]*V[1]+C[2]*V[2]}function r(C,V,M){var Q=V[0],A=V[1],E=V[2],I=M[0],N=M[1],Y=M[2];return C[0]=A*Y-E*N,C[1]=E*I-Q*Y,C[2]=Q*N-A*I,C}function I7(C,V,M,Q){var A=V[0],E=V[1],I=V[2];return C[0]=A+Q*(M[0]-A),C[1]=E+Q*(M[1]-E),C[2]=I+Q*(M[2]-I),C}function N7(C,V,M,Q,A,E){var I=E*E,N=I*(2*E-3)+1,Y=I*(E-2)+E,B=I*(E-1),W=I*(3-2*E);return C[0]=V[0]*N+M[0]*Y+Q[0]*B+A[0]*W,C[1]=V[1]*N+M[1]*Y+Q[1]*B+A[1]*W,C[2]=V[2]*N+M[2]*Y+Q[2]*B+A[2]*W,C}function Y7(C,V,M,Q,A,E){var I=1-E,N=I*I,Y=E*E,B=N*I,W=3*E*N,Z=3*Y*I,O=Y*E;return C[0]=V[0]*B+M[0]*W+Q[0]*Z+A[0]*O,C[1]=V[1]*B+M[1]*W+Q[1]*Z+A[1]*O,C[2]=V[2]*B+M[2]*W+Q[2]*Z+A[2]*O,C}function B7(C,V){V=V||1;var M=n()*2*Math.PI,Q=n()*2-1,A=Math.sqrt(1-Q*Q)*V;return C[0]=Math.cos(M)*A,C[1]=Math.sin(M)*A,C[2]=Q*V,C}function W7(C,V,M){var Q=V[0],A=V[1],E=V[2],I=M[3]*Q+M[7]*A+M[11]*E+M[15];return I=I||1,C[0]=(M[0]*Q+M[4]*A+M[8]*E+M[12])/I,C[1]=(M[1]*Q+M[5]*A+M[9]*E+M[13])/I,C[2]=(M[2]*Q+M[6]*A+M[10]*E+M[14])/I,C}function X7(C,V,M){var Q=V[0],A=V[1],E=V[2];return C[0]=Q*M[0]+A*M[3]+E*M[6],C[1]=Q*M[1]+A*M[4]+E*M[7],C[2]=Q*M[2]+A*M[5]+E*M[8],C}function Z7(C,V,M){var Q=M[0],A=M[1],E=M[2],I=M[3],N=V[0],Y=V[1],B=V[2],W=A*B-E*Y,Z=E*N-Q*B,O=Q*Y-A*N,K=A*O-E*Z,U=E*W-Q*O,$=Q*Z-A*W,X=I*2;return W*=X,Z*=X,O*=X,K*=2,U*=2,$*=2,C[0]=N+W+K,C[1]=Y+Z+U,C[2]=B+O+$,C}function K7(C,V,M,Q){var A=[],E=[];return A[0]=V[0]-M[0],A[1]=V[1]-M[1],A[2]=V[2]-M[2],E[0]=A[0],E[1]=A[1]*Math.cos(Q)-A[2]*Math.sin(Q),E[2]=A[1]*Math.sin(Q)+A[2]*Math.cos(Q),C[0]=E[0]+M[0],C[1]=E[1]+M[1],C[2]=E[2]+M[2],C}function O7(C,V,M,Q){var A=[],E=[];return A[0]=V[0]-M[0],A[1]=V[1]-M[1],A[2]=V[2]-M[2],E[0]=A[2]*Math.sin(Q)+A[0]*Math.cos(Q),E[1]=A[1],E[2]=A[2]*Math.cos(Q)-A[0]*Math.sin(Q),C[0]=E[0]+M[0],C[1]=E[1]+M[1],C[2]=E[2]+M[2],C}function $7(C,V,M,Q){var A=[],E=[];return A[0]=V[0]-M[0],A[1]=V[1]-M[1],A[2]=V[2]-M[2],E[0]=A[0]*Math.cos(Q)-A[1]*Math.sin(Q),E[1]=A[0]*Math.sin(Q)+A[1]*Math.cos(Q),E[2]=A[2],C[0]=E[0]+M[0],C[1]=E[1]+M[1],C[2]=E[2]+M[2],C}function U7(C,V){var M=C[0],Q=C[1],A=C[2],E=V[0],I=V[1],N=V[2],Y=Math.sqrt(M*M+Q*Q+A*A),B=Math.sqrt(E*E+I*I+N*N),W=Y*B,Z=W&&b(C,V)/W;return Math.acos(Math.min(Math.max(Z,-1),1))}function D7(C){return C[0]=0,C[1]=0,C[2]=0,C}function G7(C){return"vec3("+C[0]+", "+C[1]+", "+C[2]+")"}function P7(C,V){return C[0]===V[0]&&C[1]===V[1]&&C[2]===V[2]}function F7(C,V){var M=C[0],Q=C[1],A=C[2],E=V[0],I=V[1],N=V[2];return Math.abs(M-E)<=J*Math.max(1,Math.abs(M),Math.abs(E))&&Math.abs(Q-I)<=J*Math.max(1,Math.abs(Q),Math.abs(I))&&Math.abs(A-N)<=J*Math.max(1,Math.abs(A),Math.abs(N))}var H7=F0,J7=H0,L7=J0,R7=L0,k7=R0,M0=P0,_7=k0,T7=function(){var C=m();return function(V,M,Q,A,E,I){var N,Y;if(!M)M=3;if(!Q)Q=0;if(A)Y=Math.min(A*M+Q,V.length);else Y=V.length;for(N=Q;N0)I=1/Math.sqrt(I);return C[0]=M*I,C[1]=Q*I,C[2]=A*I,C[3]=E*I,C}function w0(C,V){return C[0]*V[0]+C[1]*V[1]+C[2]*V[2]+C[3]*V[3]}function i0(C,V,M,Q){var A=V[0],E=V[1],I=V[2],N=V[3];return C[0]=A+Q*(M[0]-A),C[1]=E+Q*(M[1]-E),C[2]=I+Q*(M[2]-I),C[3]=N+Q*(M[3]-N),C}function n0(C,V){return C[0]===V[0]&&C[1]===V[1]&&C[2]===V[2]&&C[3]===V[3]}function f0(C,V){var M=C[0],Q=C[1],A=C[2],E=C[3],I=V[0],N=V[1],Y=V[2],B=V[3];return Math.abs(M-I)<=J*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(Q-N)<=J*Math.max(1,Math.abs(Q),Math.abs(N))&&Math.abs(A-Y)<=J*Math.max(1,Math.abs(A),Math.abs(Y))&&Math.abs(E-B)<=J*Math.max(1,Math.abs(E),Math.abs(B))}var W5=function(){var C=j7();return function(V,M,Q,A,E,I){var N,Y;if(!M)M=4;if(!Q)Q=0;if(A)Y=Math.min(A*M+Q,V.length);else Y=V.length;for(N=Q;NJ)C[0]=V[0]/Q,C[1]=V[1]/Q,C[2]=V[2]/Q;else C[0]=1,C[1]=0,C[2]=0;return M}function p7(C,V){var M=x0(C,V);return Math.acos(2*M*M-1)}function l0(C,V,M){var Q=V[0],A=V[1],E=V[2],I=V[3],N=M[0],Y=M[1],B=M[2],W=M[3];return C[0]=Q*W+I*N+A*B-E*Y,C[1]=A*W+I*Y+E*N-Q*B,C[2]=E*W+I*B+Q*Y-A*N,C[3]=I*W-Q*N-A*Y-E*B,C}function g7(C,V,M){M*=0.5;var Q=V[0],A=V[1],E=V[2],I=V[3],N=Math.sin(M),Y=Math.cos(M);return C[0]=Q*Y+I*N,C[1]=A*Y+E*N,C[2]=E*Y-A*N,C[3]=I*Y-Q*N,C}function v7(C,V,M){M*=0.5;var Q=V[0],A=V[1],E=V[2],I=V[3],N=Math.sin(M),Y=Math.cos(M);return C[0]=Q*Y-E*N,C[1]=A*Y+I*N,C[2]=E*Y+Q*N,C[3]=I*Y-A*N,C}function w7(C,V,M){M*=0.5;var Q=V[0],A=V[1],E=V[2],I=V[3],N=Math.sin(M),Y=Math.cos(M);return C[0]=Q*Y+A*N,C[1]=A*Y-Q*N,C[2]=E*Y+I*N,C[3]=I*Y-E*N,C}function i7(C,V){var M=V[0],Q=V[1],A=V[2];return C[0]=M,C[1]=Q,C[2]=A,C[3]=Math.sqrt(Math.abs(1-M*M-Q*Q-A*A)),C}function c0(C,V){var M=V[0],Q=V[1],A=V[2],E=V[3],I=Math.sqrt(M*M+Q*Q+A*A),N=Math.exp(E),Y=I>0?N*Math.sin(I)/I:0;return C[0]=M*Y,C[1]=Q*Y,C[2]=A*Y,C[3]=N*Math.cos(I),C}function z0(C,V){var M=V[0],Q=V[1],A=V[2],E=V[3],I=Math.sqrt(M*M+Q*Q+A*A),N=I>0?Math.atan2(I,E)/I:0;return C[0]=M*N,C[1]=Q*N,C[2]=A*N,C[3]=0.5*Math.log(M*M+Q*Q+A*A+E*E),C}function n7(C,V,M){return z0(C,V),r0(C,C,M),c0(C,C),C}function u(C,V,M,Q){var A=V[0],E=V[1],I=V[2],N=V[3],Y=M[0],B=M[1],W=M[2],Z=M[3],O,K,U,$,X;if(K=A*Y+E*B+I*W+N*Z,K<0)K=-K,Y=-Y,B=-B,W=-W,Z=-Z;if(1-K>J)O=Math.acos(K),U=Math.sin(O),$=Math.sin((1-Q)*O)/U,X=Math.sin(Q*O)/U;else $=1-Q,X=Q;return C[0]=$*A+X*Y,C[1]=$*E+X*B,C[2]=$*I+X*W,C[3]=$*N+X*Z,C}function f7(C){var V=n(),M=n(),Q=n(),A=Math.sqrt(1-V),E=Math.sqrt(V);return C[0]=A*Math.sin(2*Math.PI*M),C[1]=A*Math.cos(2*Math.PI*M),C[2]=E*Math.sin(2*Math.PI*Q),C[3]=E*Math.cos(2*Math.PI*Q),C}function d7(C,V){var M=V[0],Q=V[1],A=V[2],E=V[3],I=M*M+Q*Q+A*A+E*E,N=I?1/I:0;return C[0]=-M*N,C[1]=-Q*N,C[2]=-A*N,C[3]=E*N,C}function l7(C,V){return C[0]=-V[0],C[1]=-V[1],C[2]=-V[2],C[3]=V[3],C}function y0(C,V){var M=V[0]+V[4]+V[8],Q;if(M>0)Q=Math.sqrt(M+1),C[3]=0.5*Q,Q=0.5/Q,C[0]=(V[5]-V[7])*Q,C[1]=(V[6]-V[2])*Q,C[2]=(V[1]-V[3])*Q;else{var A=0;if(V[4]>V[0])A=1;if(V[8]>V[A*3+A])A=2;var E=(A+1)%3,I=(A+2)%3;Q=Math.sqrt(V[A*3+A]-V[E*3+E]-V[I*3+I]+1),C[A]=0.5*Q,Q=0.5/Q,C[3]=(V[E*3+I]-V[I*3+E])*Q,C[E]=(V[E*3+A]+V[A*3+E])*Q,C[I]=(V[I*3+A]+V[A*3+I])*Q}return C}function c7(C,V,M,Q){var A=0.5*Math.PI/180;V*=A,M*=A,Q*=A;var E=Math.sin(V),I=Math.cos(V),N=Math.sin(M),Y=Math.cos(M),B=Math.sin(Q),W=Math.cos(Q);return C[0]=E*Y*W-I*N*B,C[1]=I*N*W+E*Y*B,C[2]=I*Y*B-E*N*W,C[3]=I*Y*W+E*N*B,C}function z7(C){return"quat("+C[0]+", "+C[1]+", "+C[2]+", "+C[3]+")"}var y7=_0,r7=T0,x7=j0,s7=S0,m7=h0,e7=l0,r0=q0,x0=w0,b7=i0,s0=p0,u7=s0,m0=g0,o7=m0,A0=v0,t7=n0,a7=f0,C5=function(){var C=m(),V=e(1,0,0),M=e(0,1,0);return function(Q,A,E){var I=b(A,E);if(I<-0.999999){if(r(C,V,A),M0(C)<0.000001)r(C,M,A);return V0(C,C),d0(Q,C,Math.PI),Q}else if(I>0.999999)return Q[0]=0,Q[1]=0,Q[2]=0,Q[3]=1,Q;else return r(C,A,E),Q[0]=C[0],Q[1]=C[1],Q[2]=C[2],Q[3]=1+I,A0(Q,Q)}}(),V5=function(){var C=Q0(),V=Q0();return function(M,Q,A,E,I,N){return u(C,Q,I,N),u(V,A,E,N),u(M,C,V,2*N*(1-N)),M}}(),M5=function(){var C=X0();return function(V,M,Q,A){return C[0]=Q[0],C[3]=Q[1],C[6]=Q[2],C[1]=A[0],C[4]=A[1],C[7]=A[2],C[2]=-M[0],C[5]=-M[1],C[8]=-M[2],A0(V,y0(V,C))}}();class d{C;constructor(C){this.app=C;this.onStart&&C.onStart(this.onStart.bind(this)),this.onUpdate&&C.onUpdate(this.onUpdate.bind(this)),this.onAfterUpdate&&C.onAfterUpdate(this.onAfterUpdate.bind(this)),this.onBeforeUpdate&&C.onBeforeUpdate(this.onBeforeUpdate.bind(this)),this.onDraw&&C.onDraw(this.onDraw.bind(this))}}class i{C;V;M;constructor(C=l.create(),V=w.create(),M=l.fromValues(1,1,1)){this.position=C;this.rotation=V;this.scale=M}rotateEuler(C,V,M){return w.fromEuler(this.rotation,C,V,M),this}toMat4(){const C=g.create();return g.fromRotationTranslationScale(C,this.rotation,this.position,this.scale),C}}var o=(C)=>w.fromEuler(w.create(),C[0],C[1],C[2]),e0=(C)=>[C,C,C];class t extends d{C;V;M;Q;A;E;projectionMatrix=g.create();buffers={};faceDataType;colorDataType;constructor(C,V,M,Q=new i([0,0,-6]),A=new i([100,100,0]),E={}){super(C);this.app=C;this.mesh=V;this.shader=M;this.camera=Q;this.light=A;this.config=E;this.faceDataType=this.getDataType(V.config.faces),this.colorDataType=V.config.colors?this.getDataType(V.config.colors):null}getDataType(C){switch(C.BYTES_PER_ELEMENT){case 1:return 5121;case 2:return 5123;case 4:return 5125;default:return 5126}}configure(C){return this.config=C,this}makeBuffer(C,V=34962){const M=this.app.gl,Q=M.createBuffer();if(!Q)throw new Error("failed to create a buffer");return M.bindBuffer(V,Q),M.bufferData(V,C,M.STATIC_DRAW),M.bindBuffer(V,null),Q}initializeBuffers(){const C=this.app.gl.createVertexArray();if(!C)throw new Error("VAO creation failed");this.buffers.vao=C,this.app.gl.bindVertexArray(C),this.buffers.faces=this.makeBuffer(this.mesh.config.faces,this.app.gl.ELEMENT_ARRAY_BUFFER);const V=this.shader.mappings;if(this.buffers.position=this.makeBuffer(this.mesh.config.positions),this.bindAttrib(this.buffers.position,V.attributes.vertex,3,this.app.gl.FLOAT),this.mesh.config.normals)this.buffers.normal=this.makeBuffer(this.mesh.config.normals),this.bindAttrib(this.buffers.normal,V.attributes.normal,3,this.app.gl.FLOAT,!0);if(this.mesh.config.colors)this.buffers.color=this.makeBuffer(this.mesh.config.colors),this.bindAttrib(this.buffers.color,V.attributes.vertexColor,4,this.colorDataType||this.app.gl.UNSIGNED_BYTE);if(this.mesh.config.uvs)this.buffers.uv=this.makeBuffer(this.mesh.config.uvs),this.bindAttrib(this.buffers.uv,V.attributes.uv0,2,this.app.gl.FLOAT);this.app.gl.bindVertexArray(null)}bindAttrib(C,V,M,Q,A=!1){const E=this.app.gl;E.bindBuffer(E.ARRAY_BUFFER,C);const I=Number.isSafeInteger(V)?V:this.shader.attrib(V);if(I!==-1)E.vertexAttribPointer(I,M,Q,A,0,0),E.enableVertexAttribArray(I);E.bindBuffer(E.ARRAY_BUFFER,null)}initializeShader(C,V){const M=g.invert(g.create(),this.camera.toMat4()),Q=this.app.gl,{uniforms:A}=this.shader.mappings;this.shader.use(),Q.uniform1f(A.time,C),Q.uniform4fv(A.light0Color,[1,1,1,1]),Q.uniformMatrix4fv(A.view,!1,M),Q.uniformMatrix4fv(A.projection,!1,this.projectionMatrix),Q.uniform3fv(A.light0,this.light.position),Q.uniformMatrix4fv(A.objectToWorld,!1,V.toMat4()),Q.uniformMatrix4fv(A.objectToWorldInv,!1,g.invert(g.create(),V.toMat4()))}onStart(C,V){V.loading("baking vectors"),V.telemetry?.addRenderers(1),V.telemetry?.addTriangles(this.mesh.config.faces.length),V.telemetry?.addVertexes(this.mesh.config.vertexCount),g.perspective(this.projectionMatrix,this.app.config.fov||45,this.app.aspect,this.app.config.zNear||0.1,this.app.config.zFar||100),this.shader.compile(),this.shader.link(),this.initializeBuffers(),this.shader.link()}onRenderableUpdate(C,V){const M=this.app.gl;M.bindVertexArray(this.buffers.vao||null),M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,this.buffers.faces||null),M.bindBuffer(M.ARRAY_BUFFER,this.buffers.position||null),this.initializeShader(C,V),M.drawElements(this.config.drawMode??M.TRIANGLES,this.mesh.config.faces.length,this.faceDataType,0);const Q=M.getError();if(Q!==0)throw console.log({err:Q}),new Error(`(MeshRenderer) webgl failure: ${Q}`);M.bindVertexArray(null),M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,null),M.bindBuffer(M.ARRAY_BUFFER,null)}}class E0 extends d{C;el;frameTimes=[];maxFrameTimes=100;lastFrameTime=0;activeTriangles=0;activeVertexes=0;activeRenderers=0;constructor(C,V="#telemetry"){super(C);this.app=C;if(this.el=document.querySelector(V),this.el&&location.search.includes("telemetry"))this.el.style.display="block"}insertTime(C){if(this.frameTimes.push(C),this.frameTimes.length>this.maxFrameTimes)this.frameTimes.shift()}async onStart(){this.lastFrameTime=0,this.frameTimes=[],setTimeout(()=>this.setText(),0),setInterval(()=>{this.setText()},1001)}setText(){const C=this.frameTimes.reduce((M,Q)=>M+Q,0)/this.frameTimes.length,V=1000/C;this.el.innerHTML=`${V.toFixed(1)} FPS (${C.toFixed(3)} ms)
update :: b: ${this.app.registry.onBeforeUpdate.length} | u: ${this.app.registry.onUpdate.length} | a: ${this.app.registry.onAfterUpdate.length} | d: ${this.app.registry.onDraw.length}
render :: mr: ${this.activeRenderers} | v: ${this.activeVertexes} | t: ${this.activeTriangles}`}onAfterUpdate(C){const V=C-this.lastFrameTime;this.insertTime(V),this.lastFrameTime=C}addTriangles(C){this.activeTriangles+=C}addVertexes(C){this.activeVertexes+=C}addRenderers(C){this.activeRenderers+=C}}class I0{C;canvas;telemetry;gl;loadingMessages=new Set(["[noeidelon] [stage 2]"]);registry={onBeforeUpdate:[],onAfterUpdate:[],onUpdate:[],onStart:[],onDraw:[]};constructor(C={}){this.config=C;try{this.canvas=document.querySelector("canvas"),this.canvas.width=window.innerWidth,this.canvas.height=window.innerHeight;const V=this.canvas.getContext("webgl2");if(!V)throw new Error("Canvas was unable to get a webgl2 context");const M=this.gl=V;if(M.viewport(0,0,M.drawingBufferWidth,M.drawingBufferHeight),location.search.includes("telemetry"))this.telemetry=new E0(this)}catch(V){const M=document.querySelector("main");if(M)M.innerHTML="
your browser didn't let me set up webgl.
";throw new Error(`Unable to initialize WebGL. Your browser or machine may not support it.\n -> ${V}`)}}get aspect(){return this.canvas.clientWidth/this.canvas.clientHeight}clear(){const C=this.gl;C.clearColor(0,0,0,1),C.clearDepth(1),C.enable(C.DEPTH_TEST),C.depthFunc(C.LEQUAL),C.clear(C.COLOR_BUFFER_BIT|C.DEPTH_BUFFER_BIT)}loading(C){this.loadingMessages.add(C.toLowerCase()),document.querySelector("#loading-text").innerHTML=[...this.loadingMessages].join("
")}ready(){document.querySelector("#loading")?.classList.remove("loading-active")}onBeforeUpdate(C){this.registry.onBeforeUpdate.push(C)}onAfterUpdate(C){this.registry.onAfterUpdate.push(C)}onUpdate(C){this.registry.onUpdate.push(C)}onStart(C){this.registry.onStart.push(C)}onDraw(C){this.registry.onDraw.push(C)}doUpdate(C){this.registry.onBeforeUpdate.forEach((V)=>V(C,this)),this.registry.onUpdate.forEach((V)=>V(C,this)),this.registry.onAfterUpdate.forEach((V)=>V(C,this)),this.registry.onDraw.forEach((V)=>V(C,this))}async doStart(C=0){this.loading("setting launch parameters"),this.clear();try{for(let V of this.registry.onStart)await V(C,this)}catch(V){if(this.loading('[panic] failed to start noeidelon'),this.telemetry)this.loading(`${V}`);return}this.ready()}async oneShot(C=0){await this.doStart(C),this.doUpdate(C)}async start(){await this.doStart();const C=(V)=>{this.doUpdate(V),requestAnimationFrame(C)};requestAnimationFrame(C)}}class a extends d{C;V;M;constructor(C,V,M){super(C);this.app=C;this.transform=V;this.renderer=M}onDraw(C){this.renderer.onRenderableUpdate(C,this.transform)}}class x{C;constructor(C){this.config=C}get name(){return this.config.name}}var b0=new x({colors:new Uint8Array([0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255]),faces:new Uint8Array([0,1,2,1,3,4,5,6,7,8,7,9,10,9,4,1,4,11,2,1,12,7,6,13,9,7,14,4,9,15,1,11,12,2,12,16,7,13,14,9,14,15,4,15,11,12,11,17,16,12,18,14,13,19,15,14,20,11,15,21,22,23,24,24,23,25,26,27,28,25,23,29,29,23,22,26,30,27]),name:"src/meshes/trianglething.ply",normals:new Float32Array([0,-1,0.00000083803394,-0.5257306,-0.44721383,0.723607,-0.8506533,-0.44721213,-0.2763879,0,-1,0.00000083803394,0.5257306,-0.4472139,0.723607,0,-1,0.00000083803394,-0.8506533,-0.44721213,-0.2763879,0,-0.44721153,-0.89442825,0,-1,0.00000083803394,0.8506533,-0.4472122,-0.27638793,0,-1,0.00000083803394,0,0.44721153,0.89442825,-0.8506533,0.44721216,0.27638793,-0.5257306,0.4472139,-0.72360694,0.5257306,0.4472139,-0.72360694,0.85065323,0.4472122,0.2763879,-0.5257306,0.4472139,-0.72360694,0,1,-0.0000008165459,0,1,-0.0000008165459,0,1,-0.0000008165459,0,1,-0.0000008165459,0,1,-0.0000008165459,0.8999471,-0.43599886,0.00000024163015,-0.00000005150958,1,0,-0.000000030203772,-0.4359989,0.8999472,-0.8999471,-0.4359989,-0.00000024291313,-0.000000030203772,-0.4359989,0.8999472,0,-0.43599886,-0.8999471,0.8999471,-0.43599886,0.00000024163015,0,-0.43599886,-0.8999471,-0.8999471,-0.4359989,-0.00000024291313]),positions:new Float32Array([0,2.609,0,-0.368004,2.9959495,0.50652,-0.595448,2.9959495,-0.19346951,0,2.609,0,0.368004,2.9959495,0.50652,0,2.609,0,-0.595448,2.9959495,-0.19346951,0,2.9959495,-0.6260975,0,2.609,0,0.595448,2.9959495,-0.19346951,0,2.609,0,0,3.6220505,0.6260975,-0.595448,3.6220505,0.19346951,-0.368004,3.6220505,-0.50652,0.368004,3.6220505,-0.50652,0.595448,3.6220505,0.19346951,-0.368004,3.6220505,-0.50652,0,4.0090003,0,0,4.0090003,0,0,4.0090003,0,0,4.0090003,0,0,4.0090003,0,1,0,0,0,2.5,0,-0.000000043711392,0,1,-1,0,-0.000000087422784,-0.000000043711392,0,1,0.0000000119248815,0,-1,1,0,0,0.0000000119248815,0,-1,-1,0,-0.000000087422784]),uvs:new Float32Array([0.00013659838,0.8180941,0.15755458,0.7272099,0.1575546,0.9089782,0.00013659043,0.6363257,0.15755458,0.54544157,0.0001365666,0.09102075,0.15755455,0.00013656964,0.15755457,0.18190491,0.00013657454,0.2727891,0.15755457,0.36367324,0.00013658249,0.45455742,0.31497157,0.6363257,0.31497157,0.8180941,0.31497154,0.09102073,0.31497154,0.27278906,0.31497154,0.45455742,0.31497157,0.9998634,0.47238955,0.72720987,0.47238958,0.9089782,0.47238955,0.1819049,0.47238955,0.36367324,0.47238955,0.54544157,0.8119813,0.33945516,0.642322,0.16979587,0.8119813,0.00013659486,0.47266275,0.00013660162,0.81198126,0.6790469,0.47266275,0.33972836,0.47266272,0.6790469,0.47266275,0.33945513,0.81198126,0.3397284]),vertexCount:31});var u0=new x({colors:null,faces:new Uint16Array([0,1,2,2,3,0,2,4,3,5,2,1,6,7,4,4,2,6,2,5,8,9,10,7,7,6,9,11,6,2,2,8,11,12,9,6,6,11,12,13,14,9,4,15,3,10,9,14,7,16,15,15,4,7,17,8,5,14,13,18,10,19,16,16,7,10,20,11,8,8,17,20,9,12,13,3,21,0,22,12,11,11,20,22,23,13,12,24,14,18,14,25,10,21,3,15,26,1,0,27,5,1,13,23,18,18,28,24,19,10,25,16,29,21,21,15,16,1,26,27,27,17,5,28,18,23,24,28,30,30,31,24,19,32,29,29,16,19,33,0,21,34,20,17,17,27,34,12,22,23,35,30,28,21,36,33,37,22,20,20,34,37,38,23,22,39,40,31,31,30,39,25,41,19,21,42,36,43,27,26,44,39,30,30,35,44,14,24,45,45,25,14,32,19,41,29,46,42,42,21,29,27,43,47,38,48,28,28,23,38,31,49,45,45,24,31,32,50,46,46,29,32,51,34,27,27,47,51,22,37,38,52,35,28,28,48,52,53,37,34,34,51,53,54,38,37,55,56,40,40,39,55,40,57,49,49,31,40,41,25,58,41,58,32,42,59,36,60,44,35,35,52,60,61,55,39,39,44,61,49,62,45,45,58,25,50,32,58,46,63,59,59,42,46,64,47,43,38,54,65,48,38,65,66,45,62,58,67,50,50,68,63,63,46,50,69,51,47,47,64,69,37,53,54,70,52,48,71,72,56,56,55,71,57,73,62,62,49,57,58,45,66,36,74,33,75,53,51,51,69,75,76,54,53,77,71,55,55,61,77,78,79,71,56,80,57,57,40,56,81,67,58,74,36,59,33,26,0,74,43,26,54,76,65,65,82,48,83,60,52,52,70,83,84,61,44,44,60,84,85,78,71,72,71,79,62,86,66,66,81,58,68,50,67,63,87,74,74,59,63,26,33,74,74,64,43,82,65,76,48,82,70,71,77,85,79,88,72,67,89,68,68,90,87,87,63,68,87,69,64,64,74,87,53,75,76,91,70,82,92,85,77,72,93,80,80,56,72,80,94,73,73,57,80,73,95,86,86,62,73,81,89,67,90,75,69,69,87,90,96,76,75,97,77,61,61,84,97,88,98,72,99,83,70,70,91,99,100,84,60,60,83,100,101,92,77,93,72,98,98,102,93,86,103,104,104,66,86,81,66,104,81,105,89,90,68,89,106,76,96,106,107,82,82,76,106,108,97,84,97,101,77,102,109,93,93,110,94,94,80,93,105,81,104,89,105,90,75,90,96,111,91,82,82,107,111,94,112,95,95,73,94,95,113,103,103,86,95,105,96,90,114,108,84,84,100,114,97,108,115,97,115,101,110,93,109,110,116,94,117,99,91,91,111,117,118,100,83,83,99,118,103,119,104,106,96,105,120,115,108,108,114,120,110,109,121,110,121,116,116,122,112,112,94,116,107,104,119,119,111,107,121,123,116,112,124,113,113,95,112,113,125,119,119,103,113,105,104,107,107,106,105,126,114,100,100,118,126,127,120,114,122,116,123,125,117,111,111,119,125,128,118,99,99,117,128,123,129,122,130,127,114,114,126,130,122,131,124,124,112,122,129,132,122,124,133,125,125,113,124,134,126,118,118,128,134,135,130,126,131,122,132,133,128,117,117,125,133,132,136,131,137,135,126,126,134,137,131,138,133,133,124,131,136,132,139,136,139,131,138,134,128,128,133,138,140,137,134,138,131,139,141,140,134,139,142,138,134,138,141,142,141,138,143,144,145,146,143,147,143,145,147,148,149,146,146,147,148,147,145,148,149,150,146,151,148,145,143,146,152,153,146,150,154,152,146,144,155,156,144,143,155,144,151,145,150,157,153,154,158,159,160,158,154,152,161,143,155,162,163,163,156,155,151,144,164,160,153,157,165,159,158,152,154,166,161,167,155,155,143,161,162,168,163,144,169,170,170,164,144,149,148,171,171,172,149,150,149,172,173,165,158,158,174,173,175,166,154,161,152,176,162,155,167,168,177,178,178,163,168,156,163,179,157,180,160,172,181,157,157,150,172,182,173,174,160,183,184,158,160,184,166,176,152,177,185,178,186,171,148,183,160,180,187,182,174,174,188,187,174,158,189,189,190,174,184,189,158,166,175,191,192,193,161,161,176,192,167,194,162,185,195,196,196,178,185,163,178,197,197,179,163,198,156,179,199,183,180,180,157,181,200,187,188,159,165,201,202,192,176,176,166,202,193,203,167,167,161,193,168,162,194,195,204,196,205,156,206,169,144,156,205,169,156,169,205,207,207,170,169,148,151,208,208,186,148,209,210,171,172,171,210,210,211,172,181,172,211,181,212,180,213,200,188,188,214,213,188,174,190,190,215,188,216,201,165,165,173,216,217,202,166,166,191,217,203,218,194,194,167,203,194,219,177,177,168,194,204,220,221,221,196,204,178,196,222,222,197,178,206,156,198,164,208,151,223,213,214,173,182,216,224,225,201,226,227,189,203,193,228,218,229,194,185,177,219,220,230,221,231,222,196,171,186,209,180,232,199,199,233,234,234,183,199,235,223,214,214,236,235,214,188,215,215,237,214,238,216,182,182,187,238,239,224,201,201,216,239,190,189,227,227,240,190,189,184,226,217,241,202,228,242,203,229,243,219,219,194,229,219,244,195,195,185,219,230,245,246,246,221,230,196,221,231,179,247,198,197,248,247,247,179,197,233,207,205,205,234,233,208,164,249,250,209,186,232,180,212,251,235,236,187,200,238,252,239,216,206,226,184,241,217,253,254,255,192,192,255,256,242,228,257,218,203,242,243,258,219,204,195,244,245,259,260,260,246,245,261,231,221,170,207,262,164,170,263,263,249,164,186,208,250,232,264,233,233,199,232,210,209,265,265,266,210,211,210,266,266,267,211,181,211,267,267,268,181,212,181,268,269,251,236,236,270,269,236,214,237,237,271,236,272,238,200,200,213,272,273,252,216,216,238,273,215,190,240,240,274,215,275,253,217,217,276,275,253,277,241,255,228,256,257,228,278,278,279,257,257,280,242,242,281,229,229,218,242,258,282,244,244,219,258,244,283,220,220,204,244,259,284,285,285,260,259,221,246,261,248,197,222,286,206,198,233,262,207,249,250,208,212,287,232,288,289,212,290,269,270,270,291,290,213,223,272,292,273,238,227,274,240,224,239,293,277,253,294,257,279,295,280,296,242,243,229,281,282,297,244,230,220,283,284,298,285,260,261,246,231,299,222,222,300,248,301,263,170,302,265,209,264,232,287,264,303,262,262,233,264,268,288,212,287,212,289,304,290,291,291,305,304,270,236,271,271,306,270,307,272,223,223,235,307,308,292,238,238,272,308,237,215,274,274,309,237,310,293,239,239,252,310,311,312,227,313,294,253,253,275,313,226,206,286,227,226,314,314,311,227,277,295,279,255,254,315,315,316,255,228,255,317,317,318,228,280,257,295,296,319,281,281,242,296,281,320,258,258,243,281,297,321,283,283,244,297,283,322,245,245,230,283,298,323,324,324,285,298,260,285,325,300,222,299,286,198,247,209,250,302,287,326,264,288,327,289,289,328,287,329,304,305,291,270,306,235,251,307,330,308,272,309,331,237,252,273,310,274,227,312,332,333,293,334,226,286,334,314,226,335,254,336,336,337,335,317,255,316,228,318,278,278,318,338,278,338,339,319,340,281,282,258,320,321,341,283,259,245,322,323,342,324,261,343,299,299,231,261,303,301,262,170,262,301,344,249,263,303,264,326,266,265,345,345,346,266,267,266,346,328,289,327,347,329,305,305,348,347,305,291,306,306,349,305,350,307,251,251,269,350,351,330,272,272,307,351,271,237,331,352,310,273,273,292,352,309,274,353,353,274,312,354,332,293,293,310,354,286,355,334,295,277,294,356,357,358,358,357,241,359,335,337,337,241,359,316,360,317,278,339,279,361,362,280,280,295,361,340,363,320,320,281,340,320,364,297,297,282,320,341,365,322,322,283,341,322,366,284,284,259,322,342,367,368,368,324,342,285,324,369,369,325,285,260,343,261,370,286,247,326,287,328,326,371,303,372,347,348,269,290,350,373,351,307,331,374,271,292,308,352,353,375,309,376,354,310,377,378,294,241,357,379,359,241,379,335,315,254,360,380,317,338,318,381,381,382,338,296,280,362,363,383,320,321,297,364,365,384,322,298,284,366,367,385,368,260,386,343,263,301,344,302,250,387,302,345,265,328,388,326,301,303,371,346,389,267,268,267,389,389,390,268,288,268,390,327,288,391,391,392,327,327,393,328,394,372,348,348,395,394,348,305,349,349,396,348,397,350,290,290,304,397,398,373,307,307,350,398,306,271,374,399,352,308,308,330,399,400,376,310,310,352,400,312,311,401,401,402,312,294,313,377,355,286,370,311,314,403,403,401,311,378,361,295,295,294,378,318,317,380,362,404,319,319,296,362,383,405,364,364,320,383,364,406,341,341,321,364,384,407,366,366,322,384,366,408,323,323,298,366,385,409,410,410,368,385,324,368,411,411,369,324,260,325,386,371,326,388,393,327,392,412,394,395,304,329,397,413,398,350,374,414,306,330,351,399,309,415,331,375,416,309,417,400,352,418,377,313,313,419,418,401,403,402,247,420,370,314,334,403,339,356,279,358,279,356,379,421,359,421,422,359,422,315,335,316,315,423,423,360,316,381,318,380,339,338,382,382,424,339,340,319,404,405,425,364,365,341,406,407,426,366,342,323,408,409,427,410,428,386,325,429,299,343,247,430,420,430,247,248,430,248,300,300,431,430,431,300,299,299,429,431,371,344,301,249,387,250,328,432,388,345,302,433,346,345,434,390,435,288,391,288,435,436,412,395,395,437,436,395,348,396,396,438,395,439,397,329,329,347,439,440,413,350,350,397,440,349,306,414,441,399,351,351,373,441,374,331,415,415,442,374,415,309,416,443,417,352,352,399,443,353,312,402,402,444,353,332,354,445,446,132,129,403,141,142,446,402,132,402,139,132,403,142,139,402,403,139,355,447,403,403,334,355,447,448,403,356,339,424,357,356,449,449,450,357,379,357,450,335,359,422,451,423,315,423,452,360,380,360,452,381,453,382,404,454,363,363,340,404,425,455,406,406,364,425,406,456,384,384,365,406,426,457,408,408,366,426,408,458,367,367,342,408,427,459,460,460,410,427,368,410,461,461,411,368,325,369,428,343,462,429,463,433,302,432,328,393,344,371,388,433,434,345,435,464,391,392,465,393,393,466,432,467,436,437,347,372,439,468,440,397,414,469,349,373,398,441,442,470,374,471,443,399,375,353,444,472,445,354,354,376,472,444,402,446,403,140,141,473,135,137,403,448,140,448,137,140,448,473,137,424,449,356,474,475,362,362,361,474,383,363,454,455,476,406,407,384,456,457,477,408,385,367,458,459,478,460,479,428,369,462,343,386,386,480,462,388,249,344,302,387,463,432,481,388,389,346,482,392,391,464,464,483,392,465,392,483,466,393,465,484,467,437,437,395,438,438,485,437,486,439,372,372,394,486,487,468,397,397,439,487,396,349,469,488,441,398,398,413,488,414,374,470,470,489,414,490,471,399,399,441,490,444,446,375,376,400,472,446,129,123,491,109,102,492,446,123,491,121,109,492,123,121,491,492,121,416,375,446,493,473,448,135,473,130,370,448,447,447,355,370,378,377,494,452,423,434,453,495,424,424,382,453,449,424,495,454,496,405,405,383,454,476,497,456,456,406,476,456,498,426,426,407,456,477,499,458,458,408,477,458,500,409,409,385,458,501,460,478,410,460,502,502,461,410,369,411,503,503,479,369,386,428,504,505,429,462,387,249,506,506,463,387,249,388,481,434,482,346,466,507,481,481,432,466,394,412,486,508,487,439,413,440,488,489,509,414,510,490,441,415,511,442,512,472,400,400,417,512,513,79,514,491,102,98,513,88,79,513,491,98,513,98,88,515,492,491,511,446,492,415,416,446,446,511,415,448,370,420,448,420,430,430,493,448,516,494,377,494,474,361,361,378,494,422,451,315,517,518,475,475,474,517,475,519,404,404,362,475,425,405,496,497,520,456,457,426,498,499,521,458,427,409,500,479,504,428,504,480,386,507,506,249,249,481,507,483,522,465,467,484,523,484,437,485,485,524,484,525,486,412,412,436,525,526,508,439,439,486,526,438,396,469,469,527,438,528,488,440,440,468,528,469,414,509,529,510,441,441,488,529,470,442,511,417,443,512,377,418,516,513,514,530,531,491,513,532,533,515,515,491,532,489,470,492,511,492,470,493,430,431,431,473,493,473,127,130,534,101,115,473,535,127,535,120,127,534,115,120,535,534,120,450,449,536,536,537,450,379,450,537,423,451,482,482,434,423,434,433,452,433,463,452,380,452,463,463,506,380,381,380,506,506,507,381,381,538,453,495,453,538,538,522,495,495,536,449,496,539,455,455,425,496,520,540,498,498,456,520,498,541,477,477,457,498,521,542,500,500,458,521,500,543,459,459,427,500,544,545,501,460,501,546,546,502,460,411,461,547,547,503,411,389,482,451,451,422,389,435,390,421,435,537,464,483,464,537,537,536,483,522,538,465,465,548,507,507,466,465,549,523,484,549,484,524,436,467,525,550,526,486,468,487,528,509,533,469,551,529,488,552,512,443,443,471,552,553,554,445,555,556,513,513,530,555,556,557,513,531,513,557,558,532,491,491,531,558,533,509,515,509,489,492,492,515,509,505,535,473,514,78,85,534,92,101,534,559,92,559,514,85,559,85,92,560,561,494,494,516,560,561,517,474,474,494,561,421,379,435,507,548,381,538,381,548,518,517,562,518,563,519,519,475,518,519,564,454,454,404,519,476,455,539,540,565,498,499,477,541,542,566,500,543,567,478,478,459,543,568,501,545,501,568,546,569,504,479,480,504,534,422,421,390,390,389,422,522,483,536,548,465,538,568,549,524,524,546,568,523,525,467,570,550,486,486,525,570,485,438,527,527,571,485,572,528,487,487,508,572,533,532,469,573,551,488,488,528,573,471,490,552,445,472,553,574,575,514,530,514,575,557,558,531,78,514,79,473,431,429,429,505,473,535,462,480,576,559,534,577,514,559,537,435,379,536,495,522,539,578,497,497,476,539,565,579,541,541,498,565,541,580,521,521,499,541,566,581,543,543,500,566,461,502,547,479,503,582,525,523,583,584,570,525,571,585,485,508,526,572,527,469,532,586,573,528,587,552,490,490,510,587,588,553,472,589,590,554,554,553,589,591,574,514,514,577,591,555,530,592,462,535,505,534,535,480,504,569,576,576,534,504,593,594,577,577,559,593,561,560,595,595,562,517,517,561,595,562,596,563,563,518,562,563,597,564,564,519,563,564,598,496,496,454,564,520,497,578,579,599,541,542,521,580,581,600,567,567,543,581,545,544,601,478,567,602,568,545,603,604,547,502,582,569,479,549,568,603,549,603,605,523,549,605,605,606,523,583,523,606,583,584,525,524,485,585,607,572,526,526,550,607,571,527,558,558,527,532,608,586,528,528,572,608,609,587,510,510,529,609,472,512,588,594,591,577,575,592,530,569,582,576,582,593,559,559,576,582,578,610,540,540,520,578,599,611,580,580,541,599,580,612,566,566,542,580,502,546,604,582,503,593,585,613,524,584,583,614,550,570,607,558,557,571,615,608,572,529,551,609,616,588,512,617,589,553,553,588,617,618,595,560,560,619,618,555,571,556,557,556,571,562,620,596,597,563,596,597,621,598,598,564,597,598,622,539,539,496,598,565,540,610,611,623,580,581,566,612,581,624,600,601,625,626,626,545,601,613,604,546,503,547,593,627,628,605,603,627,605,546,524,613,605,628,629,629,606,605,630,614,583,630,631,614,632,607,570,570,584,632,633,615,572,572,607,633,634,609,551,551,573,634,512,552,616,613,585,555,555,592,613,571,555,585,562,595,635,620,562,635,610,636,579,579,565,610,623,637,612,612,580,623,612,638,624,624,581,612,567,639,640,640,602,567,626,603,545,626,627,603,547,604,591,594,593,547,606,629,641,641,583,606,584,614,632,642,633,607,573,586,634,643,616,552,644,617,588,588,616,644,589,617,645,595,618,646,604,613,575,575,574,604,592,575,613,596,647,621,621,597,596,621,648,622,622,598,621,622,649,578,578,539,622,599,579,636,637,650,612,638,651,624,638,652,651,567,653,639,654,626,625,626,654,655,655,627,626,574,591,604,591,594,547,627,655,656,656,628,627,628,656,629,632,631,657,632,614,631,658,642,607,607,632,658,659,634,586,586,608,659,552,587,643,646,635,595,635,660,620,636,661,611,611,599,636,650,662,638,638,612,650,638,663,652,653,664,639,583,641,665,665,630,583,632,657,666,667,658,632,608,615,659,668,643,587,587,609,668,669,644,616,616,643,669,670,645,617,617,644,670,671,660,635,647,596,620,648,621,647,648,672,649,649,622,648,649,673,610,610,578,649,623,611,661,663,638,662,674,675,676,677,678,676,678,674,676,679,653,600,600,624,679,653,567,600,653,680,664,625,681,682,682,654,625,625,683,681,683,625,684,655,654,682,685,629,656,630,665,686,676,666,657,687,677,676,687,676,657,666,667,632,688,659,615,615,633,688,635,646,671,620,689,647,661,690,637,637,623,661,679,624,651,651,691,679,680,653,679,692,655,682,692,656,655,629,685,641,686,631,630,631,686,693,633,642,688,694,668,609,609,634,694,695,669,643,643,668,695,644,669,670,670,696,645,647,697,672,672,648,647,672,698,673,673,649,672,673,699,636,636,610,673,650,637,690,691,651,652,656,692,700,656,700,685,686,665,701,667,666,702,703,688,642,642,658,703,696,670,704,689,620,660,690,705,662,662,650,690,662,706,707,707,663,662,691,652,708,678,709,710,710,711,712,712,713,714,714,715,716,717,681,683,718,692,682,682,717,718,693,657,631,701,693,686,666,676,702,658,667,703,719,694,634,634,659,719,720,695,668,668,694,720,721,670,669,669,695,721,698,672,697,698,722,699,699,673,698,699,723,661,661,636,699,677,724,709,709,678,677,711,710,709,713,712,711,715,714,713,713,725,715,717,682,681,684,726,683,726,684,716,727,685,700,657,693,724,724,687,657,724,677,687,728,703,667,667,702,728,729,671,646,697,647,689,705,730,706,706,662,705,711,709,724,724,731,711,711,732,713,713,733,725,685,727,641,693,701,734,735,719,659,659,688,735,719,720,694,695,720,721,697,736,722,722,698,697,722,737,723,723,699,722,723,738,690,690,661,723,724,734,731,732,711,731,733,713,732,715,739,726,726,716,715,740,665,641,740,701,665,734,724,693,670,721,704,732,731,734,734,741,732,732,742,733,725,743,739,739,715,725,744,735,688,688,703,744,719,735,745,746,721,720,720,719,746,697,747,736,737,722,736,737,748,738,738,723,737,738,749,705,705,690,738,742,732,741,743,725,733,733,750,743,751,717,683,752,683,726,718,751,753,751,718,717,753,692,718,692,753,754,754,700,692,754,727,700,755,641,727,741,734,701,701,740,756,747,697,689,741,756,742,742,757,750,750,733,742,683,752,751,756,741,701,758,744,703,703,728,758,759,745,735,735,744,759,719,745,746,721,746,760,736,761,748,748,737,736,748,762,749,749,738,748,749,763,730,730,705,749,739,764,726,765,727,754,727,765,755,641,755,766,766,740,641,760,704,721,689,660,747,756,767,757,757,742,756,751,768,769,769,753,751,767,756,740,770,759,744,744,758,770,771,746,745,745,759,771,761,736,747,762,748,761,762,772,763,763,749,762,764,739,743,726,773,752,773,726,764,764,774,773,750,775,764,764,743,750,753,769,754,704,760,776,747,777,761,757,778,775,775,750,757,751,752,768,740,766,767,759,770,771,771,760,746,761,779,772,772,762,761,778,757,767,767,780,778,775,781,774,774,764,775,752,773,782,783,773,774,774,784,783,778,785,781,781,775,778,765,754,769,766,755,786,760,771,787,777,747,660,766,786,767,780,788,785,785,778,780,784,774,781,768,782,789,768,789,790,790,769,768,782,768,752,780,767,786,781,791,784,791,781,785,785,792,791,769,790,793,793,765,769,765,793,794,794,755,765,777,671,795,779,761,777,788,780,786,792,785,788,788,796,792,797,791,792,788,786,755,755,794,798,788,798,796,799,790,789,660,671,777,798,788,755,800,790,799,773,801,802,801,773,783,802,782,773,803,792,796,800,793,790,793,800,794,782,802,789,801,783,784,791,804,784,804,791,797,792,803,797,798,805,796,805,798,794,796,805,803,784,804,801,799,789,802,799,806,800,807,802,801,797,808,804,808,797,803,794,800,805,802,807,809,809,799,802,799,809,806,810,800,806,811,801,804,801,812,807,803,813,808,813,803,805,805,814,813,800,815,805,800,810,815,816,809,807,801,811,812,814,805,815,817,808,813,806,809,810,804,818,811,818,804,808,811,818,819,819,812,811,808,817,818,812,819,820,820,807,812,814,821,817,817,813,814,821,814,815,810,822,821,821,815,810,820,816,807,820,809,816,809,820,822,822,810,809,819,818,817,817,821,819,819,821,822,822,820,819,153,160,154,146,153,154,234,205,206,206,184,234,184,183,234,193,192,256,228,193,256,202,337,192,202,241,337,337,336,192,336,254,192,277,358,241,277,279,358]),name:"src/meshes/teapot.ply",normals:new Float32Array([0.0568927,0.9963135,0.06420743,-0.0799326,0.9941669,0.07240759,-0.12358398,0.8280825,0.5468148,0.16515216,0.9512132,0.2606115,0.18880455,0.7516897,0.63191414,-0.26532406,0.94982946,0.1656113,-0.19603758,0.18551922,0.9628873,0.31580678,0.15921263,0.9353702,-0.43467745,0.75106066,0.4969541,-0.17107923,-0.4452516,0.87891006,0.2905992,-0.44421753,0.84748024,-0.6487634,0.16213906,0.74351656,-0.5879791,-0.44476756,0.67561996,-0.27674997,-0.62449604,0.7303521,0.2358193,-0.42483014,0.8740186,0.49695557,0.7510595,0.43467775,0.7435171,0.16213848,0.64876306,-0.6319153,0.75168955,0.18880102,-0.20482819,-0.26208463,0.9430573,0.67565376,-0.44470808,0.5879853,-0.9353683,0.15921454,0.3158116,0.54587257,0.82860136,0.124269575,-0.8474803,-0.44421813,0.2905984,-0.655661,-0.44749412,0.60815924,0.10755416,0.316445,0.94249386,0.6087708,-0.44502082,0.6567759,-0.07176643,0.9943648,-0.07802775,-0.5470333,0.8279137,-0.12374764,-0.5860273,0.3307474,0.739715,0.96288687,0.18551841,0.19604005,-0.11087169,0.8464678,0.52076846,0.19153932,0.8446995,0.49979553,0.88023216,-0.44247022,0.17149743,0.07892639,0.9941629,-0.07355772,-0.9628871,0.18552043,-0.19603696,-0.35559997,0.8422419,0.40518793,0.2653233,0.94982976,-0.16561094,-0.87890965,-0.44525272,-0.17107858,-0.8740171,-0.4248306,0.23582417,-0.04412791,0.9740091,0.22216877,0.07273095,0.9740669,0.21425168,0.6665567,-0.6451215,0.37352404,0.6319164,0.7516886,-0.18880096,-0.16561036,0.9498298,-0.2653234,-0.14883141,0.9741497,0.16994546,0.7390099,0.32275876,0.5913468,0.9353688,0.15920955,-0.3158124,-0.49695373,0.7510587,-0.43468118,-0.9424942,0.31644404,0.10755316,0.40518782,0.8422419,0.3556001,0.84570974,-0.44714823,-0.29126188,-0.7435199,0.16213731,-0.6487601,-0.49979565,0.8446998,0.1915378,-0.6756196,-0.44476625,-0.5879805,-0.73035246,-0.62449574,-0.27674958,-0.038720626,0.9802991,0.19368611,0.063005276,0.98030907,0.18714827,0.16994497,0.9741499,0.14883141,0.89001334,-0.41327643,0.19255881,0.4346789,0.7510582,-0.4969565,-0.21425173,0.97406685,0.07273215,-0.13100335,0.98024756,0.14816482,0.5207663,0.8464689,0.110872634,0.6487612,0.16213807,-0.7435188,-0.18880336,0.75168747,-0.6319171,-0.94305664,-0.26208672,-0.20482866,0.927822,0.35810852,-0.10442601,0.74960953,-0.58988744,-0.30019733,0.58641934,-0.44965163,-0.67373997,-0.3158121,0.15920925,-0.93536896,-0.5207683,0.8464675,-0.11087459,-0.09214917,0.89951503,0.42706114,0.13593124,0.9032904,0.4069266,0.22216831,0.9740093,0.044125848,0.12374541,0.8279141,-0.5470333,-0.28963035,-0.44636554,-0.84668297,-0.60316056,-0.44652066,-0.660921,-0.29100645,0.8999372,0.32469702,-0.06529754,0.941149,0.33162448,0.0150432745,0.9696322,0.24410492,0.14827539,0.98033655,0.13021009,0.8491187,-0.31183332,-0.42632988,-0.73799974,0.33206502,-0.5874429,-0.22216895,0.9740091,-0.04412647,-0.19106235,0.97922087,0.067983545,-0.11515666,0.96360004,0.24127544,0.49979365,0.84470016,-0.19154097,0.19604,0.18552105,-0.96288645,0.08195558,0.9361994,0.34178054,0.5105226,-0.61432433,-0.60164136,0.17159176,-0.4463835,-0.8782357,-0.40519148,0.84224117,-0.35559756,-0.22821908,0.93927765,0.25626835,0.32816982,0.89590144,0.29944128,0.1975296,0.9792445,0.045413945,0.21425161,0.97406685,-0.07273223,-0.15752232,-0.6019658,-0.7828307,-0.64037937,0.7020605,0.31148887,0.13905965,0.9677601,0.21000648,-0.16994499,0.97414994,-0.14883073,-0.19368784,0.98029894,-0.038718842,-0.7531385,-0.27243838,0.59879863,0.2311729,0.94583035,0.22795625,0.35559824,0.8422407,-0.40519187,0.59211653,0.34975803,-0.72599393,0.34693137,-0.4197221,-0.83873236,-0.22816393,-0.24784744,-0.9415481,-0.10603079,0.3418128,-0.9337674,-0.41045263,0.9100289,0.05810424,0.26046315,0.9538541,0.14940341,0.66324204,0.70797217,0.24266315,-0.19154151,0.8446996,-0.49979421,0.18488625,0.9806092,-0.06498178,0.14883095,0.97414994,-0.16994493,-0.44652867,0.8897225,-0.09490019,-0.29479906,0.95335644,0.06484548,0.42767462,0.90370363,0.020352375,-0.07273271,0.9740667,-0.21425195,-0.1482752,0.9803365,-0.13021062,0.11087301,0.8464686,-0.5207667,-0.28433686,0.95869786,-0.007141059,0.32448876,0.9447116,0.047191318,0.4279118,0.8934629,-0.13643934,0.29161766,0.95610714,-0.028606733,0.13020985,0.9803366,-0.14827532,0.044125937,0.97400904,-0.22216941,-0.33558717,0.8937264,-0.29771492,-0.2702287,0.9562008,-0.112500936,-0.06300514,0.98030907,-0.18714845,0.28017506,0.9526421,-0.11821659,-0.22911097,0.9642257,-0.13333002,0.27159607,0.91634977,-0.2941745,0.220297,0.96315503,-0.15427755,0.03871876,0.980299,-0.19368725,-0.14345643,0.89244264,-0.42774576,-0.19300526,0.9457528,-0.2613439,0.6438041,0.16508555,-0.74717,-0.13398604,0.9638022,-0.23050606,0.08083865,0.90355885,-0.42076907,0.11614376,0.96613634,-0.23041533,-0.05823296,0.94927675,-0.30900225,-0.015903335,0.96565497,-0.25934052,0.10609722,0.936394,-0.33452925,-0.11303801,0.37131402,-0.921601,-0.6073066,0.4466621,-0.65701723,-0.6287273,-0.01988204,-0.77737164,0.16192104,-0.49644288,-0.8528341,-0.27315903,-0.4509954,-0.8496984,-0.34677228,-0.93581283,0.06327186,0.0624638,-0.9958382,0.06636646,0.4291102,-0.9016674,0.053481903,-0.84010273,-0.54110277,0.037883993,0.000033328535,0.32010022,-0.9473837,0.5705572,-0.19284672,-0.79829484,0.12458854,0.37519276,-0.9185358,-0.24489552,0.37535915,-0.89394164,-0.16807152,0.5414624,-0.8237538,0.8355659,-0.5486128,0.029217526,0.3030873,0.41261315,-0.85900426,0.23757592,0.32127005,-0.9167024,0.69009066,0.28463605,-0.6654,-0.12938234,0.22760966,-0.9651186,-0.35548154,0.32174394,-0.8775613,-0.40686584,0.41495034,-0.8138036,-0.9772298,0.21190935,-0.010794063,0.37442914,0.3181547,-0.8709653,0.13511828,0.22292574,-0.9654258,-0.25837418,0.22079034,-0.9404757,-0.4846586,0.31808934,-0.8148161,-0.34721985,0.7038826,-0.6196674,-0.61502546,0.786133,-0.061144456,-0.06999321,-0.9749556,0.21109822,0.34029248,-0.9196074,0.19627312,0.4661976,0.31828693,-0.8254411,0.50688547,0.41306433,-0.75660104,0.23757592,0.32127005,-0.9167024,-0.0022349653,0.17242128,-0.98502076,-0.569519,0.31818825,-0.75789475,-0.6001163,0.4117828,-0.68578094,-0.3449401,0.61892354,-0.7056558,0.9692294,0.24369162,-0.034765996,0.88955164,-0.40996432,0.20156175,0.5862451,0.31831607,-0.7449776,0.4199348,0.637634,-0.64581555,0.10910918,0.6037591,-0.7896645,-0.67768383,0.3183623,-0.6628649,-0.4440786,-0.871485,0.20810601,0.66286516,0.31836423,-0.6776829,0.68473256,0.4132006,-0.60033876,0.26002446,0.6310335,-0.73087895,0.44219097,0.6021347,-0.6647564,0.32458493,0.1773824,-0.92907494,-0.15207665,0.8484287,-0.50699246,-0.13621426,0.024309358,-0.990381,-0.4424219,0.17716533,-0.8791333,-0.744977,0.31831685,-0.58624536,-0.7567828,0.4090529,-0.50985813,-0.5086223,0.61625963,-0.6012716,-0.17220406,0.80270594,-0.5709719,0.6370755,0.7689299,-0.05368111,0.75789464,0.3181883,-0.56951904,0.32458493,0.1773824,-0.92907494,0.1326088,0.018059323,-0.99100393,-0.25677392,-0.06652102,-0.9641796,-0.8254329,0.31820318,-0.4662696,-0.10136998,0.8075103,-0.58107764,-0.013309714,0.7443602,-0.66764575,-0.16676837,0.9856542,-0.025962915,-0.77460724,-0.6032929,0.18979272,-0.28326458,-0.83178055,0.4773912,0.089326374,-0.8624186,0.49825203,0.49384397,-0.7118854,0.49933687,0.9342529,0.30316672,-0.18778028,0.814816,0.31809175,-0.48465708,0.81656945,0.41303498,-0.40325734,0.60063404,0.6128854,-0.51342994,0.5474521,0.18045183,-0.8171495,0.2564565,-0.07427342,-0.9636979,-0.38624382,-0.076836735,-0.91919076,-0.64866,0.1805916,-0.7393423,-0.87103516,0.31803873,-0.37436515,-0.86113894,0.40805468,-0.30320138,-0.5812343,0.67319137,-0.45714337,0.8794617,0.3177003,-0.35442027,0.38061017,-0.07632841,-0.92158,0.2564565,-0.07427342,-0.9636979,0.00592411,0.99356157,-0.11313795,0.009151153,0.9996958,-0.022905637,-0.65795285,-0.22420235,-0.71890986,-0.49865997,-0.076390184,-0.863425,-0.91880125,0.31459275,-0.23840229,-0.70152295,0.6216766,-0.3484018,0.66472954,0.72054803,-0.19734564,0.22654732,0.97000825,-0.08809251,0.15571941,0.7931232,-0.5888184,0.9127222,0.31749925,-0.25716233,0.8923693,0.41150168,-0.1853199,0.6948445,0.63072336,-0.34551302,0.7393419,0.18059178,-0.64866036,0.5013318,-0.076273024,-0.86188686,0.23737372,0.90702415,-0.34779435,0.60123914,-0.3145745,-0.73454356,-0.3021015,-0.39865646,-0.8659143,-0.61028993,-0.076691985,-0.78845716,-0.81714857,0.18045281,-0.5474533,-0.9388901,0.3193567,-0.12843937,-0.91549164,0.39307147,-0.08584715,-0.03370434,0.9992675,0.018122032,0.07265752,0.99673235,0.03529114,-0.9377702,0.1965707,-0.2862638,-0.8476745,-0.42073518,0.323156,0.9416219,0.3171567,-0.112959385,0.60549426,-0.07648694,-0.79216564,0.25024083,-0.39775956,-0.8827043,-0.0031387366,0.84861845,0.52899617,-0.35348126,0.7938304,0.49485782,-0.607254,0.40940168,-0.6809059,-0.11951341,-0.5197567,-0.8459134,-0.7039729,-0.07633587,-0.7061127,-0.9461909,0.32353407,0.0069617,-0.8019823,0.5973176,-0.00600709,-0.76444167,0.6208708,-0.1736326,-0.16607542,0.9776404,-0.12898931,-0.8555783,0.4976877,-0.14245196,0.2500902,0.9238363,-0.2897952,-0.104858786,-0.5076317,0.85516936,0.2819893,-0.47212288,0.83521366,0.6185565,-0.28166273,0.73352164,0.9385148,-0.11205244,0.32654887,0.94834495,0.3170913,-0.009754637,0.9152297,0.40272892,-0.012810119,0.76089084,0.6310293,-0.15115221,0.88168555,0.18049638,-0.43594906,0.70611215,-0.07633663,-0.70397335,0.15685886,0.9720634,-0.17460783,0.41048655,-0.39970005,-0.8195979,0.38061017,-0.07632841,-0.92158,0.10566444,-0.5358142,-0.83769804,-0.2623624,-0.59641486,-0.7585877,0.033179097,-0.7136528,-0.69971347,-0.19073243,-0.6605752,-0.72612774,-0.510398,-0.4008934,-0.76077485,-0.79216594,-0.07648588,-0.605494,-0.93106586,0.18015763,-0.31726903,-0.94162226,0.3171557,0.11295923,-0.89497656,0.4086997,0.17883374,0.0663958,0.98723555,0.14476712,0.48941252,0.68227893,-0.54311216,0.94115216,0.06587937,-0.33150053,0.6861239,0.37766856,-0.62177205,0.9398365,0.3152334,0.1316633,0.90392065,0.40694627,0.13161427,0.7884571,-0.07669112,-0.61028993,0.41048655,-0.39970005,-0.8195979,0.16158944,-0.6697055,-0.72483337,-0.029519957,-0.6780582,-0.7344152,-0.30348128,-0.6507821,-0.6959754,-0.86188686,-0.07627245,-0.50133187,-0.91272295,0.3174962,0.2571634,-0.06969765,0.99727255,-0.024285067,0.14684993,0.97897154,0.14159726,-0.4488461,0.85128504,-0.27175522,-0.5188946,-0.29918793,0.8007715,-0.08009979,0.94682115,-0.3116305,0.9187996,0.31459683,0.23840332,0.8589238,0.41467944,0.3004842,0.7727502,0.63237756,0.05436729,0.9646935,0.18017855,-0.19209892,0.863425,-0.07638879,-0.49866015,0.0022519769,0.99939305,-0.03476365,0.60372174,-0.40108934,-0.68894655,-0.27618033,0.15091555,0.9491832,-0.5412319,-0.12412039,0.83166224,0.28476608,-0.65459013,-0.7002999,-0.12599292,0.21462484,0.96853596,0.14528479,0.7110604,0.68795747,-0.22671466,0.71308583,0.6634072,-0.7379689,0.53414774,0.4124172,-0.965222,-0.21938927,-0.14217912,-0.37134373,-0.6511029,-0.66194326,-0.6889468,-0.401088,-0.60372245,-0.9215801,-0.07632891,-0.3806101,-0.9815208,0.17998163,-0.0649896,-0.87946194,0.31769958,0.3544201,-0.81656957,0.41303408,0.4032578,-0.7533562,0.63851786,0.15731965,0.098535605,0.7634281,-0.63833237,0.5222951,0.10876507,-0.8458003,0.19933788,0.37108737,-0.9069501,0.8710348,0.3180395,0.37436515,0.91919065,-0.07683615,-0.38624445,0.24613649,0.9669457,-0.06657969,0.38470134,-0.65110654,-0.6542669,0.28476608,-0.65459013,-0.7002999,0.035242617,-0.08891843,0.9954153,0.41595146,0.7168372,0.559579,0.13932231,0.64942926,0.74754995,0.65248007,0.41793174,-0.6321414,-0.63705295,-0.66872,-0.38337576,-0.17679265,-0.85809755,-0.48209226,-0.47235027,-0.6512968,-0.5938835,-0.9624097,-0.0762164,-0.26068887,-0.81481636,0.31808951,0.48465797,-0.052266106,0.99852407,0.014765209,-0.68047464,0.57544297,-0.45367366,-0.07217364,0.009945293,0.99734247,0.2649408,0.0798971,0.960949,0.8254323,0.31820524,0.46626922,0.7564821,0.41311368,0.5070227,0.7256235,0.63976055,0.25333145,0.98152053,0.17998332,0.064988986,0.9632319,-0.07645694,-0.2575626,0.7607763,-0.40089202,-0.51039696,-0.6134942,0.49237242,0.6174093,0.45762283,-0.65118486,-0.6054252,0.14230624,0.16314223,0.9762856,0.24676883,-0.8162543,-0.52233523,0.7565897,-0.55339444,-0.3483197,0.26354837,-0.5978047,-0.7570811,0.79550844,0.5012649,0.34044054,-0.5896707,0.57853526,0.5635473,-0.0577113,-0.5379457,-0.84100163,-0.26975495,-0.5369161,-0.7993456,-0.52895707,-0.6514096,-0.54393935,-0.821488,-0.40078744,-0.40561908,-0.9888783,-0.076404184,-0.1276013,-0.964694,0.1801763,0.19209902,-0.7578948,0.31818843,0.56951874,-0.6847328,0.41319945,0.6003394,-0.69484633,0.6307211,0.34551325,0.33176392,0.18595974,0.92485225,-0.27789447,0.7568023,-0.591629,0.74497753,0.3183167,0.5862449,0.9880374,-0.07682274,-0.13371718,0.24896204,0.9684981,-0.0054061743,-0.7942945,0.17510648,0.58175075,0.5396305,-0.6514862,-0.53325856,0.26433992,-0.5935468,-0.760149,0.07599004,-0.57183886,-0.81683886,0.96934986,-0.17911702,-0.16816027,-0.9881642,0.10289019,0.11377657,-0.8553196,-0.3622972,-0.37036347,-0.56167305,-0.66720396,-0.4892467,-0.6090764,-0.6511836,-0.45275345,-0.99707425,-0.07642164,-0.0016692313,-0.6628653,0.3183633,0.67768306,0.0062100366,0.999895,-0.013092021,-0.8740984,-0.039710097,0.4841229,-0.3430281,0.44582027,-0.8267866,0.71217304,0.18423882,0.6773961,0.9541309,0.086973324,0.28647837,0.72849303,-0.1267787,-0.67322,0.2905741,-0.19713351,-0.9363253,0.07305205,-0.026999103,-0.99696267,0.677683,0.31836408,0.6628651,0.60033923,0.4132003,0.6847323,0.63291126,0.6325709,0.44640476,0.93106616,0.18015833,0.3172677,0.9970742,-0.07642196,0.001669381,0.86720574,-0.40029845,-0.29616794,0.59770006,-0.6512723,-0.4675456,-0.28357622,0.56277436,0.7764468,-0.45501956,0.58612734,0.670382,-0.06511579,0.58439684,0.80885124,-0.46759528,-0.5372656,-0.7019262,-0.65118486,-0.65104514,-0.3899982,-0.8989264,-0.40009323,-0.17848445,-0.9880374,-0.07682402,0.13371672,-0.88168603,0.18049748,0.43594766,-0.586245,0.31831536,0.74497795,-0.50702333,0.41311258,0.75648224,-0.5969534,0.6146739,0.51557976,0.56951845,0.31818923,0.75789464,0.9888785,-0.07640335,0.1276006,0.21566948,0.97552216,0.0429322,-0.8545147,0.46449488,0.23248467,-0.9355284,-0.08246132,0.3434922,0.6587962,-0.651212,-0.3767102,0.44872537,-0.58936906,-0.671781,0.38470134,-0.65110654,-0.6542669,0.5119284,0.19139077,0.8374359,0.9332855,0.22927499,0.27642536,0.6637491,0.4517646,0.596109,-0.11455723,0.5922031,0.7976039,-0.08912172,-0.79848486,-0.59538174,-0.70596814,-0.6504781,-0.28015566,-0.9632319,-0.07645643,0.25756273,-0.46626976,0.31820208,0.8254332,-0.1913724,0.9785611,0.07612405,0.9268485,0.21421269,0.30832574,0.63793784,0.07977822,0.76594436,0.8211981,0.048709583,0.5685604,-0.30401585,0.11435825,-0.9457783,-0.39313543,0.22452794,0.89164555,-0.08601123,0.36519384,0.9269495,0.9720044,-0.091856085,-0.21626358,0.48465738,0.31809112,0.8148161,0.40909263,0.41595185,0.8121744,0.51557803,0.6146738,0.5969551,0.8171496,0.18045238,0.5474518,0.96241,-0.07621669,0.2606881,0.9145783,-0.3997602,-0.061141793,-0.78029895,0.62236094,0.061648514,0.6985244,-0.6507318,-0.29767725,-0.6301238,0.5626794,0.53510344,0.44872537,-0.58936906,-0.671781,-0.74074525,0.56552815,0.36259407,0.1595758,0.5564255,0.81543005,0.37361875,0.5445601,0.7509083,0.25525808,-0.7312859,-0.63250625,0.6424904,-0.572907,-0.50890434,0.2774148,0.5184833,0.8088362,-0.5735225,0.40979612,0.70932287,-0.4462423,-0.61444926,-0.6506303,-0.6326444,-0.537364,-0.5576746,-0.73065263,-0.650157,-0.2084289,-0.91457903,-0.3997585,0.06114216,-0.9191904,-0.07683627,0.38624474,-0.7393426,0.18059081,0.64865977,-0.37037706,0.31799647,0.8727538,-0.29924813,0.41621774,0.8586113,-0.44640455,0.63256955,0.6329129,0.9455975,0.30330303,0.11769665,-0.74734837,0.17486478,0.6410091,0.694849,-0.30526525,-0.6511512,-0.1915997,-0.32965392,-0.92445546,-0.32587445,-0.16963114,-0.9300705,0.3573786,0.3208679,0.8771113,0.92157966,-0.07632585,0.38061163,0.068837434,0.9967834,0.0410425,-0.8973028,0.44138545,0.005144538,0.73470587,-0.6503604,-0.1929728,0.6068192,-0.5889496,-0.5337684,0.70968485,0.51610595,0.47956452,-0.059610605,-0.52306193,-0.85020745,-0.27784815,-0.5232454,-0.80561453,-0.7553407,-0.64960384,-0.08645968,-0.86342525,-0.07638958,0.49865976,-0.24447371,0.3137911,0.9174791,-0.021071695,0.9980633,0.058529653,0.9579049,0.26509196,-0.11020215,-0.79886484,0.0796449,-0.5962145,0.24305792,0.42355347,0.87265414,0.2890374,-0.41016114,-0.8650001,0.25191274,0.39037988,0.88551885,0.3457385,0.6310644,0.6944225,0.64866006,0.1805922,0.7393421,0.8618871,-0.076270916,0.50133175,0.8989263,-0.4000934,0.17848478,-0.901067,0.41502446,-0.12582895,0.7539355,-0.6480573,-0.10771732,-0.67212546,0.5862709,-0.45225394,-0.80567294,0.58959603,-0.057163894,0.56716686,0.49883437,0.6553518,0.17322753,-0.48622125,-0.8564935,-0.09063972,-0.69379455,-0.7144463,-0.7552487,-0.5372017,-0.37551793,-0.7603337,-0.6494285,-0.011636602,-0.867206,-0.40029785,0.2961683,-0.7884563,-0.07669505,0.6102905,-0.55302626,0.18154295,0.81314456,-0.13563862,0.39050275,0.91055465,-0.25333068,0.639761,0.7256235,-0.1541273,0.96959203,0.19009499,0.825119,0.47493875,-0.3059604,0.7936305,0.5596947,0.23852164,-0.9953851,0.01983485,0.09388793,-0.8173281,-0.13822408,-0.5593468,0.7921663,-0.07648689,0.6054934,-0.87690204,0.40906972,-0.25239813,0.75985515,-0.65001833,0.009810083,-0.7878318,0.5975274,0.14927198,0.7233115,-0.5900535,-0.35868827,-0.35775718,0.5692737,-0.7402279,0.06512692,0.58801156,-0.8062263,-0.7738933,0.56644154,-0.28325444,0.39476693,-0.45568284,-0.7978172,-0.0278585,-0.8857905,-0.46324837,-0.16059536,-0.88539493,-0.43621668,-0.4767875,-0.52369964,-0.70598334,-0.7516553,-0.6499023,0.1124336,-0.7061125,-0.07633618,0.70397294,-0.08805917,-0.53848773,-0.8380195,0.2594672,0.2643199,0.92887664,0.14881657,0.62863576,0.7633286,0.44210073,0.17889428,0.87894464,0.70397294,-0.07633589,0.7061126,0.1900975,0.96959114,0.15412949,0.8214877,-0.4007865,0.4056207,0.7553415,-0.6496028,0.086459786,-0.14927296,0.5975252,-0.7878333,-0.53510404,0.56267655,-0.63012606,-0.80193037,0.24422896,-0.54521555,-0.9249085,0.04579585,-0.37742138,0.7584057,0.6139537,-0.21881904,0.8317092,0.5551332,0.009322383,0.27489418,-0.59582376,-0.75460404,0.7147256,-0.4233568,-0.5567193,-0.48250148,-0.48867595,-0.7269031,-0.827133,-0.53669876,-0.16674994,-0.73643166,-0.6502296,0.18673468,-0.76077497,-0.40089354,0.5103978,-0.60549456,-0.07648573,0.7921655,-0.38066542,0.18328202,0.9063671,-0.24447371,0.3137911,0.9174791,-0.3989486,0.75241303,0.5241324,-0.05235144,0.6291649,0.7755069,-0.041041452,0.9967831,0.06884103,-0.71432,-0.30211282,-0.6312487,0.122228935,0.36528826,0.9228351,0.61029047,-0.07669198,0.7884566,0.7306542,-0.6501548,0.2084302,0.7882368,-0.5935703,-0.16234875,0.58640903,-0.45781326,-0.66823006,0.39476693,-0.45568284,-0.7978172,-0.2324854,0.4644979,-0.854513,-0.3434935,-0.082457274,-0.93552816,-0.5817501,0.17510433,-0.79429555,-0.6174096,0.4923722,-0.61349416,0.45708394,0.58794796,-0.66737664,0.20767291,-0.8857861,-0.41503608,0.07909864,-0.88510203,-0.45862585,-0.039413672,-0.9817992,-0.18578738,-0.25546017,-0.8850025,-0.38924384,-0.6424488,-0.5238506,-0.55932117,-0.6959757,-0.6507815,0.30348167,-0.5044349,-0.08161278,0.8595841,-0.74769914,0.19260174,0.6354925,-0.0034968064,0.36224008,0.93207824,0.81732136,0.13847801,-0.559294,0.4988722,-0.07608865,0.86332905,0.03476506,0.99939305,0.002249302,0.68894637,-0.40108898,0.6037222,0.7059685,-0.6504775,0.28015587,0.12582701,0.41502208,-0.9010683,-0.0051446613,0.4413751,-0.897308,0.6740702,0.54330504,-0.5004488,0.2832615,0.5664472,-0.77388656,-0.8422995,-0.53636956,0.053284034,-0.66194224,-0.6511037,0.3713442,-0.60372293,-0.40108803,0.6889462,-0.36214146,-0.08990027,0.92777777,0.6031099,0.52215004,-0.6030073,0.7594776,0.21847361,0.6127504,0.38746458,-0.07664855,0.9186927,0.066579446,0.96694547,0.24613766,0.65118474,-0.6510455,0.38999775,0.8299473,-0.5574951,0.019664947,0.7389591,-0.45695427,-0.4951083,0.29829386,-0.8842896,-0.3592388,0.20767291,-0.8857861,-0.41503608,0.252398,0.40907076,-0.8769016,-0.06165332,0.62234724,-0.78030944,0.54521364,0.2442346,-0.80192983,0.37742057,0.04578843,-0.92490923,0.059723653,-0.98194623,-0.17948414,-0.14278756,-0.97664493,-0.1605502,-0.35923785,-0.8842905,-0.2982926,-0.7652233,-0.5235699,-0.3745769,-0.5938839,-0.6512967,0.47235006,-0.70149463,-0.15060677,0.69657934,-0.613081,0.53109765,0.5848649,-0.613081,0.53109765,0.5848649,-0.086276144,0.8588921,0.50483733,-0.04293235,0.97552204,0.21567005,0.30958048,0.78875923,0.5310545,0.60573775,0.5309248,0.5926219,0.51003546,-0.4010711,0.76092434,0.6090757,-0.65118456,0.45275295,0.8271196,-0.5344722,0.17381765,-0.7993451,-0.53691685,0.26975495,-0.543939,-0.6514099,0.52895683,-0.40723163,-0.39826483,0.8219169,0.0054060225,0.9684998,0.24895594,0.24990632,-0.09694528,0.96340466,0.5289571,-0.6514102,0.54393846,0.8436938,-0.45338723,-0.28743818,0.38924524,-0.8850015,-0.25546142,0.16055058,-0.9766448,-0.14278778,0.29829386,-0.8842896,-0.3592388,-0.049939163,-0.997203,-0.055607144,-0.41503373,-0.88578707,-0.20767337,-0.8365695,-0.52304375,-0.1630235,-0.45275304,-0.65118414,0.60907614,-0.57844615,-0.38761654,0.7177419,-0.7574206,0.6064358,-0.24197035,-0.35042202,0.88275445,-0.312968,0.015965637,0.93062675,-0.3656216,0.35170946,0.8858485,-0.30260992,0.67326033,0.6983603,-0.24292646,0.77710396,-0.04378903,0.62784714,0.5027922,-0.44275767,0.7424053,0.30233395,-0.39084107,0.86938924,0.47235066,-0.6512959,0.5938843,0.7535136,-0.5386016,0.3769955,0.0021595194,-0.9984392,-0.05580811,-0.7019278,-0.53726125,0.46759796,-0.38999805,-0.6510452,0.65118486,-0.2685397,-0.37256968,0.8883007,-0.96313137,0.26849186,-0.017036166,-0.7574206,0.6064358,-0.24197035,0.96805775,0.21774086,0.12431079,0.37134337,-0.65110403,0.6619423,0.87150615,-0.4864577,-0.06193376,0.4362134,-0.8853963,-0.16059661,0.16055058,-0.9766448,-0.14278778,0.056622326,-0.9970706,-0.05142218,-0.17948449,-0.9819463,-0.05972348,-0.4586208,-0.885105,-0.079096034,-0.85020524,-0.52306545,0.059611905,-0.27881098,-0.6542879,0.70297354,-0.45738187,-0.5154124,0.7246736,-0.27769044,-0.65801114,0.6999353,-0.9754545,-0.11510383,0.18772174,-0.3482694,0.7846437,-0.5128768,-0.018545028,0.7704709,-0.6372054,0.3461242,0.7269931,-0.5930254,0.29381034,-0.6531096,0.6979422,0.30367562,-0.6481849,0.69831043,0.6222849,-0.5593877,0.5475829,-0.014826651,-0.99988675,0.0025810385,-0.557676,-0.53736377,0.63264334,-0.16118349,-0.67230684,0.7225118,-0.10342326,-0.5610246,0.821313,-0.95986694,0.063469894,0.27317932,0.95260024,-0.04406177,0.30101737,0.113713086,-0.5518254,0.8261707,0.1922566,-0.65990055,0.7263393,0.8336552,-0.5261227,0.16797003,0.46325153,-0.8857888,-0.027860155,0.18578757,-0.9817992,-0.039414044,0.015259005,-0.9998801,-0.0026702227,-0.46325004,-0.88578975,0.027857272,-0.80561197,-0.52324826,0.27784994,-0.27769044,-0.65801114,0.6999353,-0.10342326,-0.5610246,0.821313,-0.007495285,-0.5606672,0.8280073,-0.0024945622,-0.7214028,0.69251114,-0.16268705,-0.7141415,0.680834,-0.7435987,-0.46765542,0.47786975,-0.83365804,-0.21651146,0.50807196,-0.5484398,0.6116161,-0.5702101,-0.28193444,0.60136694,-0.74757665,-0.71058565,0.46169123,-0.53095126,-0.96313137,0.26849186,-0.017036166,0.7580732,0.49962223,-0.419169,0.8811482,-0.3578383,0.30907845,0.17091094,-0.72518474,0.66700584,0.46759787,-0.5372592,0.7019293,-0.058667447,-0.9982712,-0.0035690207,-0.37528303,-0.5370112,0.75550085,-0.53545296,-0.7190021,0.44308704,0.1137618,0.47988096,-0.86992675,0.5305283,-0.710462,0.4623674,0.7682774,-0.51965165,0.3737807,0.45862043,-0.8851053,0.07909467,0.056622326,-0.9970706,-0.05142218,-0.18578702,-0.98179924,0.03941407,-0.4362125,-0.88539696,0.16059557,-0.7059868,-0.5236949,0.47678736,0.3942839,0.48989397,-0.77752435,0.6722502,-0.3985169,0.6239102,0.040959552,-0.72129446,0.69141644,0.26975363,-0.5369171,0.79934543,0.058859013,-0.9982597,0.0036215517,-0.16643573,-0.53591985,0.8277011,0.040959552,-0.72129446,0.69141644,-0.007495285,-0.5606672,0.8280073,-0.16268705,-0.7141415,0.680834,-0.19089821,-0.8373103,0.5123175,-0.53545296,-0.7190021,0.44308704,-0.2981791,-0.66078454,0.6888056,-0.7435987,-0.46765542,0.47786975,-0.47440672,-0.42741844,0.76957893,-0.83365804,-0.21651146,0.50807196,-0.8112236,-0.053253315,0.58230597,-0.95986694,0.063469894,0.27317932,-0.4808207,0.417548,-0.7710157,-0.116383865,0.3788277,-0.9181201,0.5569627,-0.68479425,0.46994612,0.41459462,-0.8870803,0.20297733,0.17948453,-0.98194623,0.059723217,-0.389244,-0.88500243,0.25545996,-0.55932015,-0.5238506,0.6424496,0.1136213,-0.84909356,0.5158781,-0.55017525,-0.23986265,0.79985815,-0.9806211,0.19528137,0.015733398,0.72265047,0.39150146,-0.5696515,0.053417124,-0.5391922,0.84048706,0.058859013,-0.9982597,0.0036215517,0.053417124,-0.5391922,0.84048706,-0.0043023974,-0.7040536,0.7101339,-0.08344183,-0.5230442,0.84821117,-0.24533775,-0.3265284,0.9127917,0.29877883,-0.65574056,0.6933509,0.4744638,-0.521518,0.7091565,-0.16054972,-0.976645,0.14278765,-0.2982918,-0.88429075,0.35923794,-0.37457377,-0.5235713,0.7652239,-0.90707225,-0.0075176666,0.42090788,0.8022419,-0.07237982,0.59259516,0.2667997,-0.49315006,0.82802224,0.08201508,-0.35124153,0.93268585,-0.63644016,-0.21659233,0.74029166,0.27785155,-0.5232476,0.8056118,0.25019524,-0.88658875,0.3890535,0.15361488,-0.9741731,0.16549683,-0.056561127,-0.9970781,0.05134228,-0.20767131,-0.8857876,0.41503373,-0.1630221,-0.52304363,0.8365699,-0.32236737,-0.33986393,0.8834997,-0.4605093,0.44202393,-0.7697701,-0.8251584,0.42552376,-0.37154135,0.10782897,0.39809215,-0.910986,0.5435823,0.42694983,-0.72265625,0.9622954,0.24859825,-0.11039245,0.45068246,-0.27716884,0.84856516,0.102536045,-0.38795987,0.91595495,0.05961242,-0.52305984,0.8502087,0.16059598,-0.8853962,0.43621388,0.049951337,-0.997201,0.05563205,-0.059722867,-0.98194635,0.17948428,-0.07909461,-0.8851043,0.45862246,0.05961242,-0.52305984,0.8502087,-0.82100654,-0.28240198,0.49618283,0.6941628,0.5188444,-0.49893734,0.88830954,0.050359752,0.45647576,0.5534558,-0.25927168,0.7914954,-0.36891752,0.60290545,-0.70739293,0.14934604,0.60427624,-0.7826532,0.027859287,-0.88578963,0.46324998,0.039414313,-0.98179924,0.185787,0.027859287,-0.88578963,0.46324998,-0.9330978,0.35961676,0.0020848594,-0.8139494,-0.40681753,0.414712,-0.40283307,-0.55008656,0.7315261,0.015259005,-0.9998801,-0.0026702227,-0.0021773847,-0.9984397,0.055797476,0.11844444,-0.6104027,0.7831854,0.039414313,-0.98179924,0.185787,0.5804413,-0.47744548,0.65964675,-0.3419636,-0.7632996,0.548119,-0.65817714,0.68104106,-0.32091418,-0.9669006,0.082957454,0.24129081,-0.81168526,0.11497714,0.5726669,0.14244813,-0.8093766,0.56975275,0.93979883,-0.041933786,0.33914548,-0.0021773847,-0.9984397,0.055797476,0.78608865,-0.45581526,0.41748908,-0.2777247,0.8586703,-0.4307599,0.14775084,0.78869987,-0.5967598,-0.37684715,-0.5498762,0.74540085,0.38708767,-0.63448757,0.6690208,0.5728922,0.705167,-0.41777274,0.6899195,0.7097548,-0.14233533,0.049951337,-0.997201,0.05563205,0.9196396,-0.02230809,0.39212936,0.1109336,0.15195152,0.98214275,0.9653483,0.2470969,0.083938986,-0.015702538,0.97643965,-0.21521866,0.15239777,0.97695476,-0.14944725,-0.29387432,0.9558123,0.0078054564,-0.30025354,0.94874126,-0.09868107,0.66442573,0.5007882,0.5547519,-0.3585756,0.767221,0.5317852,0.36082104,0.931945,0.035868943,-0.08874891,0.9646178,0.24826646,0.80905527,0.5159834,0.28140828,-0.07240278,0.98167646,-0.17626423,0.44612837,0.29525754,0.84486234,-0.5816681,0.4384945,0.6851166,0.5285301,0.8225281,-0.21000801,0.97539204,0.20357357,0.08466432,-0.5293027,0.82365745,-0.20353639,-0.86167955,0.5062396,0.035066746,-0.95927596,-0.121700734,0.25490898,0.50083363,-0.7702286,0.39485887,-0.49141815,0.86019737,-0.13626751,0.22715555,0.94847506,-0.22089653,0.7098428,0.7028163,0.04661016,0.6460368,0.39400306,0.65375686,-0.7809922,0.5310517,0.3286871,-0.26333243,0.31176257,0.91294026]),positions:new Float32Array([0.08334465,2.1424341,0.07932985,-0.070349455,2.1392877,0.08685406,-0.026624786,2.1165075,0.22995588,0.13131183,2.1277943,0.17365156,0.09853005,2.109425,0.23106422,-0.14236523,2.1277943,0.11571934,-0.028311478,2.0860515,0.25332013,0.10569635,2.086041,0.24514012,-0.13464902,2.1094203,0.18321484,-0.025097836,2.0472333,0.24395595,0.1035895,2.047248,0.23548824,-0.14345975,2.086042,0.1963199,-0.13608178,2.0472825,0.18972445,-0.029490227,1.9328475,0.13811602,0.053974885,1.9096376,0.12667316,0.19880696,2.1094203,0.16593559,0.21191177,2.086042,0.17474641,-0.19977777,2.109425,0.08293786,0.000612297,1.893343,0.12393209,0.20531666,2.0472825,0.16736805,-0.2138535,2.086041,0.090104885,0.245548,2.1165073,0.057912216,-0.2042017,2.0472476,0.08799729,-0.06537563,1.909708,0.09252914,0.036932457,1.8633798,0.12673298,0.108120695,1.9097081,0.0966628,-0.055567756,2.1392877,-0.08594141,-0.19866906,2.1165075,-0.042218085,-0.050450303,1.8631896,0.09981998,0.2689121,2.0860515,0.05959847,-0.0048417146,1.8283503,0.15090589,0.072587796,1.8283521,0.14528267,0.25954792,2.047233,0.056383822,0.11722808,2.1392877,-0.0711597,-0.22203363,2.0860515,-0.043903664,-0.072253294,1.8283509,0.118361324,0.18924369,2.1277943,-0.10002511,-0.21266955,2.0472333,-0.04068961,-0.09538641,1.9096375,0.03838331,-0.036583383,1.7764032,0.2996845,0.12170442,1.7763994,0.2894037,0.15117924,1.9319383,0.064145274,0.24665661,2.109425,-0.06724304,-0.0844333,2.1277943,-0.15795717,-0.1738225,1.7763883,0.23220484,0.11541181,1.8631896,0.08173721,0.26073214,2.086041,-0.07441039,-0.1519282,2.1094203,-0.15024127,-0.09544642,1.86338,0.02134014,0.13395336,1.8283508,0.10354005,0.25107998,2.0472476,-0.07230329,-0.16503382,2.0860417,-0.15905136,-0.113996066,1.8283521,0.056995932,-0.15843788,2.0472827,-0.15167412,-0.10682954,1.9328475,-0.045082346,-0.11946154,1.713866,0.6884592,0.25027663,1.7138191,0.66612583,0.2477964,1.7763885,0.20510836,0.14117798,1.9037943,0.03336559,0.18152781,2.1094203,-0.16752036,-0.2581175,1.7763991,0.106113605,-0.43922716,1.7137523,0.53020483,0.16649806,1.8283503,0.03612837,0.19033799,2.086042,-0.1806257,-0.051651962,2.109425,-0.21536976,-0.09264548,1.8933431,-0.014980405,0.14232501,1.8633798,-0.005645876,0.15161814,1.9313473,-0.046003956,0.18296021,2.0472825,-0.17403017,-0.058818705,2.086041,-0.22944556,-0.1196194,1.8283503,-0.02043341,-0.15268247,1.6804774,0.8276422,0.29324442,1.6804463,0.80248094,0.3152781,1.7764032,0.06786633,0.073503695,2.1165073,-0.21426165,-0.056710783,2.0472476,-0.21979368,-0.061242893,1.909708,-0.08096743,-0.53676957,1.680413,0.6346807,-0.15181486,1.6430178,0.8767164,0.058187544,1.6404709,0.89543945,0.54579794,1.7137525,0.4705128,0.13048695,1.8922141,-0.04576187,-0.068533264,1.8631896,-0.06604265,-0.26839992,1.7764028,-0.05217246,-0.6348381,1.7138191,0.23468441,-0.37166288,1.6431051,0.80272067,0.16087472,1.828352,-0.041302234,0.07519028,2.0860515,-0.23762569,0.2888651,1.6429368,0.8562937,0.10819932,1.931129,-0.10255232,0.07197568,2.0472333,-0.22826156,-0.0870752,1.8283508,-0.08784501,-0.55967665,1.6431638,0.6783556,0.65027285,1.6804134,0.56805557,0.70405036,1.7138665,0.15074402,0.30499506,1.7763996,-0.09041822,-0.0057035857,1.9322323,-0.12842005,-0.7495322,1.6675459,0.40090367,0.48806316,1.6418642,0.76857215,-0.20091844,1.7763882,-0.18941507,-0.65717494,1.7138656,-0.1350486,-0.7000573,1.6418467,0.5222103,0.67517346,1.6406071,0.6122083,0.1191314,1.8283508,-0.10266749,0.09732953,1.8631896,-0.084125124,0.07275074,1.9051306,-0.10290013,-0.0010098432,1.8934784,-0.10959778,0.009946367,1.86338,-0.11103846,-0.79238707,1.6800269,0.17279279,0.78359157,1.6437819,0.46742213,0.8470529,1.6670016,0.28102258,-0.025710195,1.8283521,-0.12958816,0.6817153,1.7138196,-0.21899047,0.22070114,1.7763884,-0.21650977,-0.7963558,1.6804773,-0.16827253,-0.8387324,1.6423836,0.22027755,0.85286504,1.6800337,0.06970149,-0.0748271,1.7763994,-0.27370837,-0.498919,1.7137523,-0.4548178,0.051720727,1.8283504,-0.13521144,-0.8601035,1.6431593,-0.047985286,0.89519894,1.6414781,0.16984248,0.8180726,1.6804464,-0.26195997,0.90626466,1.6431584,-0.05890753,0.48610407,1.7137525,-0.514512,0.08345893,1.7764032,-0.2839906,-0.6033947,1.680413,-0.55236113,-0.81540483,1.64316,-0.2799762,-0.20339565,1.7138195,-0.65042925,0.85276496,1.6408682,-0.31371522,-0.6987217,1.6409484,-0.5125001,0.5836474,1.6804134,-0.6189865,0.73992115,1.6428952,-0.51971954,0.16633531,1.7138661,-0.6727655,-0.24636713,1.680446,-0.7867861,-0.5619955,1.643482,-0.6589329,0.59798515,1.6543156,-0.6597425,-0.3805355,1.6431631,-0.78265214,0.19955955,1.6804774,-0.8119481,0.46186322,1.6429485,-0.76795715,-0.18633449,1.6414671,-0.853363,0.014847007,1.6429577,-0.87899864,0.24777395,1.643623,-0.8525219,-0.13708203,1.2201986,-1.1987333,-0.13018008,1.4676074,-1.0874002,-0.11856759,1.4250436,-1.1078795,0.067937605,1.3835112,-1.1360718,-0.046977993,1.3895441,-1.128823,-0.066813715,1.3888745,-1.5016229,0.049661394,1.3786709,-1.4935458,0.12697549,1.3954146,-1.503003,-0.122212425,1.4266,-1.5219053,0.023472408,1.043774,-1.2762223,0.15205699,1.4147904,-1.1134502,0.18624468,1.2235599,-1.1971881,-0.2992081,1.2212609,-1.1666684,-0.17836498,1.6543496,-0.9927835,0.16904669,1.4265362,-1.5220367,0.39898196,1.4012913,-1.0702847,0.3682682,1.043757,-1.2310394,0.17729744,1.452745,-1.0943191,-0.1596576,0.87812847,-1.3139293,-0.4805254,1.0437776,-1.1767193,-0.49036428,1.3984607,-1.0141273,-0.13023514,1.4610814,-1.5664936,0.5274694,1.043756,-1.1767004,0.2066279,0.8781125,-1.3139212,-0.33465075,0.8781284,-1.2789862,-0.62902933,1.0437685,-1.1031295,-0.10498853,1.5052639,-1.0715001,-0.1058254,1.4962851,-1.5730144,-0.0029746592,1.3575419,-1.6793306,0.113855146,1.3666314,-1.6892962,0.6759691,1.0437552,-1.1030997,0.6653518,1.3975278,-0.9403692,0.3682682,1.043757,-1.2310394,0.023179002,0.80810404,-1.3389374,-0.7654057,1.0437644,-1.0117038,-0.733144,1.3971657,-0.85239965,-0.4270119,1.673638,-0.896672,0.17708606,1.4562079,-1.6243867,0.16855657,1.3798587,-1.7995425,0.8123401,1.0437571,-1.0116649,0.16712761,1.4932051,-1.0762645,0.15916966,1.6695567,-0.9924975,-0.88822824,1.0437622,-0.90386957,-0.080393285,1.3720747,-1.6966659,0.9351563,1.043763,-0.9038204,0.8836833,1.3971748,-0.74873376,0.35800847,1.6738327,-0.9445496,0.59078443,1.6738087,-0.8290441,0.47024128,0.81047237,-1.2681124,-0.019321563,0.61591285,-1.3591542,-0.16366085,0.63544285,-1.346943,-0.5848182,0.81048846,-1.2009051,-0.9960717,1.0437592,-0.7810527,-0.92477673,1.3975255,-0.634067,-0.64175564,1.6735265,-0.75429636,-0.23952836,1.6979915,-0.94038737,0.15261103,1.4969658,-1.5636654,1.0429908,1.0437641,-0.78099835,0.47024128,0.81047237,-1.2681124,0.20625602,0.6347588,-1.347509,-0.3449288,0.594272,-1.3120416,-1.0875072,1.043755,-0.64468265,-0.024805844,1.5362902,-1.0630813,0.000059388964,1.6884999,-0.989071,-0.027793014,1.5310217,-1.4637215,-0.1222637,1.3989162,-1.729115,-0.0461377,1.3307201,-1.7811424,0.04950467,1.3266906,-1.7736806,0.12662457,1.3379519,-1.7937132,0.17637855,1.3934637,-1.8795686,1.1344155,1.0437716,-0.6446212,1.0454118,1.3984663,-0.5059554,0.783354,1.6738085,-0.6596039,0.7821489,0.8103163,-1.1137438,0.38988605,0.59425515,-1.3125583,-0.51453584,0.5942715,-1.2540165,-0.87149185,0.8103454,-1.0089873,-1.1611083,1.0437543,-0.4961829,-1.054587,1.3994839,-0.3700825,-0.7672235,1.6824135,-0.6101374,1.2080059,1.0437784,-0.49611753,0.55956554,0.5942557,-1.2547859,0.38988605,0.59425515,-1.3125583,0.22211109,1.7075293,-0.93677336,0.39503187,1.706966,-0.88141817,-0.13092218,0.5296462,-1.3400967,-0.6727237,0.59427094,-1.175473,-1.2154495,1.0437506,-0.3369808,-0.8772543,1.6735612,-0.45045543,0.1524265,1.460181,-1.800241,0.09306671,1.521911,-1.5821316,0.09435941,1.5302218,-1.0635425,1.2623357,1.0437812,-0.33691546,1.1402951,1.4010118,-0.22316395,0.9264443,1.6738284,-0.44539562,1.040274,0.81034553,-0.8870845,0.71785945,0.5942598,-1.176483,0.5755161,1.7031059,-0.7984173,0.17888936,0.51580375,-1.336582,-0.4187791,0.44476014,-1.2525015,-0.8179727,0.59426934,-1.0779333,-1.0981499,0.81031895,-0.75086343,-1.2490982,1.0437595,-0.16850698,-1.1169127,1.3706566,-0.15020968,-0.45130336,1.707926,-0.83473045,-0.62489,1.7084126,-0.7098394,-0.12968473,1.3513668,-1.925497,-0.11749717,1.3428891,-1.841813,1.2959783,1.0437818,-0.16844085,0.8632467,0.5942629,-1.0791675,0.38080394,0.4455707,-1.2758154,0.02466718,0.6792218,-1.4758605,-0.06889438,0.660599,-1.4714676,-0.100696936,0.5771033,-1.3464222,-0.1411206,0.37204158,-1.2739416,-0.94876295,0.5942666,-0.96292126,-1.26063,1.0437744,0.007814106,-0.9940772,1.6601213,0.0029156592,-0.9634795,1.6721017,-0.204783,-0.027717575,1.5191196,-1.6507251,-0.122253865,1.4428332,-1.7923522,0.09278359,1.4813439,-1.8280268,-0.0024569083,1.2798687,-1.8250833,0.092384905,1.2819638,-1.833126,0.1368052,1.2746896,-1.8629043,0.16844703,1.2819757,-1.8966665,1.3075079,1.0437787,0.007881319,1.1741234,1.370678,0.007898085,1.0110695,1.6738564,-0.19576068,1.2321913,0.8104873,-0.60041237,0.9942081,0.594267,-0.9643557,0.7401232,1.7055863,-0.65052503,0.6236196,0.44474822,-1.1867466,0.55956554,0.5942557,-1.2547859,0.19085829,0.37187874,-1.2735764,-0.09610031,0.44529897,-1.3130318,0.052125175,0.41549465,-1.3055779,-0.30954644,0.30001438,-1.1835359,-0.7268331,0.44481227,-1.0997906,-1.0635753,0.5942627,-0.8319596,-1.2525207,0.81046826,-0.4389548,-1.2490995,1.0437803,0.18413563,-1.0934215,1.4009997,0.23886037,-0.19008996,1.707011,-0.92855847,0.12704387,1.4157645,-1.936517,0.17594871,1.2808125,-1.9606372,0.1519235,1.3461933,-1.9711549,1.2959762,1.043764,0.18420035,1.163787,1.3706676,0.1659035,1.1092199,0.59427035,-0.8335658,0.6236196,0.44474822,-1.1867466,0.29236773,0.2903251,-1.1922095,-0.04147702,0.2901783,-1.2189556,-0.46264032,0.3000183,-1.1310996,-1.1608902,0.5942596,-0.6865731,-1.2154578,1.0437768,0.35261065,-0.8483239,1.7080646,-0.40925828,-0.7651855,1.7067481,-0.5444803,-0.08052488,1.4712274,-1.8190814,-0.078389086,1.2749525,-1.8536009,-0.0032408445,1.4861653,-1.835384,1.2623259,1.0437587,0.35267532,1.1014621,1.3994931,0.3857751,1.0285628,1.6738753,0.078875996,1.3458589,0.8106713,-0.26622146,1.2067595,0.59427166,-0.6883165,0.8509805,1.7070105,-0.4874088,0.9069772,0.44480193,-0.9973093,0.33548447,1.6884013,-0.8837255,0.553447,1.688398,-0.7758682,0.50699013,0.30001226,-1.1321464,0.15361957,1.6884285,-0.9242653,0.073525734,0.7892097,-1.6189157,-0.045844708,0.7724023,-1.6080177,-0.117593,0.6800306,-1.5506496,-0.12936573,0.5632415,-1.4531778,-0.60541946,0.30002186,-1.060142,-0.9817169,0.44480258,-0.8756912,-1.2391936,0.5942548,-0.52827805,-1.3227639,0.810829,-0.085883886,-1.1611271,1.0437764,0.5118124,-0.9985352,1.3984613,0.5216503,-0.96419084,1.6738558,0.21145485,0.049716406,1.4263767,-1.957956,0.12730582,1.2738886,-2.0164306,0.073891826,1.3326887,-2.0237167,1.2079865,1.0437578,0.5118769,1.2853038,0.59427196,-0.5301275,0.9413059,1.7061806,-0.3039426,0.64991015,0.30001685,-1.0615208,0.50699013,0.30001226,-1.1321464,0.023474278,1.6963738,-0.93315494,0.12750843,0.7073257,-1.5483599,0.092331104,0.60411966,-1.3561718,0.15194933,0.5712692,-1.3457208,-0.10715316,0.5336413,-1.4658571,-0.035090927,0.5085891,-1.4831535,-0.73650944,0.30002305,-0.9720382,-1.296966,0.59425294,-0.3585982,-1.0875372,1.0437692,0.6603158,-0.92602456,1.7085652,-0.16358803,-0.10557469,1.4042392,-1.9213142,-0.002153509,1.2178761,-1.8368653,0.094296,1.1860807,-1.8452731,1.1343851,1.0437593,0.66037637,0.9716554,1.3975291,0.64975923,0.9758361,1.6738329,0.3424162,1.3696423,0.8108328,0.10157772,1.3433284,0.59427047,-0.36052218,1.1310791,0.44481364,-0.742424,0.69359994,1.6950672,-0.65771294,0.7811897,0.3000209,-0.9737265,-0.1686082,1.6882848,-0.9170113,0.09300706,0.5693338,-1.5786703,0.16467763,0.5860214,-1.5398133,0.14056115,0.4449696,-1.3128136,0.16903256,0.6736092,-1.555701,-0.099802546,0.80430835,-1.671052,-0.048163,0.11879362,-1.0217043,-0.31823692,0.11879522,-0.96793395,-0.8545382,0.3000229,-0.8681664,-1.171155,0.44474894,-0.5923322,-1.3326912,0.5942559,-0.17905112,-1.2989806,0.8106675,0.2819159,-0.99611145,1.0437648,0.7966923,-0.83680695,1.3971659,0.76443106,-0.8795661,1.6738274,0.46108985,-0.34940365,1.6954257,-0.8616451,-0.046361804,1.4217603,-1.9510711,1.0429507,1.0437593,0.7967477,1.3793108,0.59426767,-0.18102261,0.9893979,1.7061816,-0.050099906,0.8071997,1.6884,-0.5220938,0.8994539,0.3000235,-0.87013036,0.36474055,0.11879843,-0.9680649,0.16215064,0.11892777,-1.012956,0.17713201,0.75196517,-1.7162092,-0.1302335,0.83058083,-1.761569,-0.12324186,0.77799094,-1.7717692,-0.09288413,0.63870686,-1.6505462,-0.9581343,0.300021,-0.7499031,-1.3448501,0.5942603,0.008851049,-0.8882775,1.0437622,0.91951483,-0.935793,1.7080383,0.07467894,-0.121707335,1.2611594,-1.8993721,-0.050127953,1.3566632,-2.0076044,0.15130138,1.1028212,-1.8612034,0.17272587,1.0844145,-1.8929814,0.15187073,1.1289787,-1.9903777,0.09257905,1.1183264,-2.0230582,0.042985108,1.2055298,-2.0422392,0.93510735,1.0437636,0.91956353,0.7800218,1.3971713,0.868092,0.8603304,1.6738092,0.5751921,1.2994007,0.8104669,0.45464772,1.3917295,0.59426,0.0068432535,1.2837882,0.44476038,-0.4343717,1.0033246,0.3000229,-0.75210214,0.351041,1.6390647,-0.89452106,0.5710031,1.6390593,-0.7824896,0.092814,1.6390618,-0.94850135,-0.55681074,0.118799224,-0.84983116,-1.0459286,0.30001685,-0.6186236,-1.2832553,0.4446855,-0.26206446,-1.3324316,0.5942678,0.19671679,-1.1853124,0.8104906,0.6161044,-0.76546127,1.0437561,1.0273592,-0.61847436,1.3975233,0.95606494,-0.7364741,1.6738085,0.67529935,0.81228477,1.043766,1.0273979,1.3795705,0.5942557,0.19474547,0.96993697,1.7061809,0.21327935,0.9318202,1.6950785,-0.24165387,0.8916215,1.6884227,-0.36043704,1.0914276,0.3000211,-0.6210122,0.6032909,0.11880202,-0.85010123,0.64991015,0.30001685,-1.0615208,-0.45504582,1.6888597,-0.8117126,0.1727533,0.83271813,-1.7481815,0.15186991,0.8597339,-1.7308983,-0.0022435542,0.8908064,-1.7042718,-0.003318607,0.62629443,-1.6738396,-1.1165541,0.3000116,-0.47570226,-1.2964492,0.59427065,0.37621573,-0.62909013,1.0437534,1.1187947,-0.8944273,1.70618,0.3196373,-0.8676254,1.6950041,-0.31660378,-0.6015684,1.68903,-0.71204454,-0.76030886,1.6891152,-0.5340294,-0.045783754,1.2740339,-2.031532,-0.061141685,1.1140083,-1.8362093,-0.002242626,1.0626979,-1.8029488,0.17710689,1.0170327,-1.9092469,0.67590773,1.0437715,1.1188234,0.5372416,1.3984692,1.0298185,0.6908906,1.6738087,0.7677614,1.1450307,0.8103162,0.7665565,1.3438457,0.59425366,0.37429202,1.3534079,0.44463095,-0.08563511,0.9604242,1.7005188,-0.11909212,1.1623869,0.30001885,-0.4782323,0.75240046,1.6390642,-0.6195225,0.6032909,0.11880202,-0.85010123,0.8864331,1.6390582,-0.41432923,-0.1848513,1.6390746,-0.9309358,-0.420149,1.6390626,-0.85602874,0.092498414,0.69787395,-1.7534287,0.15227985,0.7210788,-1.7361515,0.09326837,0.91392785,-1.7304785,-0.0955817,0.9279681,-1.7640961,-0.080171585,0.77125376,-1.8124642,-0.7542176,0.11880151,-0.6764733,-1.168643,0.3000056,-0.32250932,-1.306529,0.44463158,0.10133035,-1.2384243,0.5942711,0.5458224,-0.99339545,0.8103445,0.9027785,-0.4805904,1.0437543,1.1923953,-0.35448983,1.3994879,1.0858719,-0.54390496,1.6738088,0.8447387,-0.908923,1.6884265,-0.12612545,-0.10429604,1.1050695,-1.8617474,0.15177988,0.99041355,-1.9450421,-0.02098179,1.0321329,-2.0070417,-0.045712322,1.1163943,-2.0226722,0.52740514,1.0437775,1.1924136,1.286073,0.5942568,0.5439727,0.8574923,1.7081127,0.501205,0.9640881,1.6950852,0.011064285,1.2148224,0.3000144,-0.32513958,0.8007648,0.11880094,-0.6768506,-0.7793039,1.6390554,-0.54850656,-0.050331697,0.08221776,-1.0122828,-0.31768233,0.0822433,-0.9583365,-1.2008306,0.300002,-0.16041449,-1.1598804,0.5942711,0.7040105,-0.32116503,1.0401602,1.2480917,-0.8041019,1.70701,0.5031031,-0.91707677,1.6882169,0.07447347,-0.116332136,1.2646401,-1.9874847,0.09295388,1.0318686,-1.7966456,0.09234176,0.9734661,-1.9742609,0.3453849,1.2594365,1.1669265,0.47668225,1.6738276,0.9108526,0.918371,0.8103474,1.0246814,1.2077696,0.59426075,0.7022672,1.3301343,0.4446857,0.27775922,0.955222,1.6950837,0.14017753,1.2473593,0.30000815,-0.16310902,0.8137766,1.6390581,0.5554113,0.97850096,1.6390604,0.085862175,-0.6211516,1.6390601,-0.7274221,0.22850965,0.08222909,-0.9949484,-0.0032073455,0.7587573,-1.8287121,-0.9009739,0.11880072,-0.45726252,-1.2117472,0.30000284,0.009216302,-1.2369088,0.44475976,0.4500667,-1.0623406,0.59426856,0.84926015,-0.7352703,0.81031424,1.1294383,-0.14211026,1.2594205,1.1981685,-0.31112948,1.6738327,0.960244,-0.69324535,1.705586,0.66621846,-0.86775386,1.6947649,0.32288736,-0.8853705,1.6410385,-0.30902764,-0.13021572,1.0856917,-1.907158,-0.11946847,1.0978181,-1.9699652,1.1104544,0.5942632,0.8476544,0.93015987,1.6950794,0.26351663,1.2586273,0.30000442,0.006478278,0.9623828,1.6410059,-0.16293061,0.94765157,0.11879758,-0.45766333,0.44561312,1.639059,0.87084186,-0.05457756,1.639059,0.96290904,0.9258077,1.6390648,0.33544832,0.48206767,0.08224002,-0.90942264,-0.05109592,0.059807647,-0.9850721,-0.31108904,0.059824314,-0.9319244,-0.553738,0.082253784,-0.84072477,-1.2004795,0.30000684,0.17880301,-0.9473288,0.59426665,0.98004967,-0.0029414676,0.89722586,-1.9405683,0.3818046,0.9327633,1.2778714,0.22704768,1.673856,0.9954774,0.6316996,0.81048584,1.2165991,0.99564254,0.59426695,0.97861546,0.6818113,1.7055863,0.7245314,1.2180336,0.44474998,0.6080289,1.2477103,0.3000035,0.17611045,0.19421732,1.6410056,0.94679046,0.65080816,1.6390641,0.73680925,0.80715436,1.6883981,0.53785574,0.8908367,1.6884251,0.3780169,-0.88568693,1.6396396,0.3027281,-0.93704855,1.639092,0.0075943843,0.09228564,0.8329641,-1.8848516,0.15192024,0.85334104,-1.8605547,-0.07565109,0.8995878,-1.9182856,-0.98789406,0.11879445,-0.2017572,-1.1679426,0.30001345,0.34083384,-1.0841984,0.4448124,0.7581196,-0.81636757,0.5942631,1.0948619,-0.5049327,0.80808693,1.2503597,-0.32116503,1.0401602,1.2480917,-0.15981968,0.9445862,1.3092185,-0.0475894,1.673875,1.0129703,-0.46991858,1.7081124,0.84190017,-0.1049901,0.9838308,-1.9418,0.19089691,1.186658,1.2303085,0.8648527,0.59426945,1.0936272,1.2155231,0.3000069,0.3382041,1.0347054,0.118794106,-0.20209469,0.6997237,0.08225137,-0.7645136,0.48206767,0.08224002,-0.90942264,0.2729403,1.6950784,0.9162281,0.39172405,1.6884224,0.87602925,0.5533804,1.6883998,0.79160744,0.6889995,1.6950672,0.67800796,-0.5241259,1.6390591,0.7981828,0.46759793,0.05982532,-0.8862934,0.22043568,0.059815656,-0.9689146,-0.16749732,0.03299553,-0.8752109,-0.5405655,0.0598326,-0.8168594,-0.74892044,0.08225116,-0.6684375,-1.1155082,0.30001873,0.49392647,-0.6709799,0.59425926,1.1921775,-0.31058767,0.7546499,1.3231856,0.017389765,1.187722,1.2406776,-0.76032084,1.6883994,0.5377884,0.7196025,0.5942711,1.1911676,0.5186947,1.7070104,0.83538884,1.0285956,0.44480264,0.89138585,1.1634332,0.300012,0.49139646,-0.10889079,1.6950834,0.9396299,0.020221677,1.6950848,0.94849586,-0.74926746,1.6390905,0.5856462,-0.30416387,1.6390644,0.9102148,-1.006112,0.11879355,0.079450674,-1.0445492,0.3000216,0.6367062,-0.86009926,0.44480246,1.0130032,-0.51268595,0.59425527,1.2704804,-0.6467211,1.6950669,0.67340755,0.35106364,0.7732608,1.3213917,0.5614152,0.5942707,1.2697109,0.3352293,1.7061805,0.9257138,1.0928069,0.3000166,0.6343185,1.0531384,0.118929155,0.0051182937,0.8720118,0.08225419,-0.56933045,0.67991734,0.059832525,-0.7457506,0.46759793,0.05982532,-0.8862934,-0.23223007,1.6950792,0.9145677,0.15037927,1.7005186,0.94483197,-0.5065688,1.6883978,0.7915624,-0.34673038,1.6884246,0.8752446,0.3129514,0.0330065,-0.8487171,-0.5942509,0.037374455,-0.6832741,-0.73015743,0.05983211,-0.6486305,-0.8938302,0.082239576,-0.4507805,-0.9564454,0.3000228,0.7677964,-0.30133113,0.64961153,1.3357284,-0.24995492,0.8793793,1.3086416,-0.24995492,0.8793793,1.3086416,-0.03695588,0.97967553,1.3079474,-0.1819904,1.7061807,0.9543455,0.17926827,0.9594544,1.307995,0.30571604,0.8686211,1.3093572,0.7737118,0.44481298,1.1154858,1.0050129,0.30002028,0.7655969,1.0347736,0.11879476,0.21745141,-0.95234126,0.118795164,0.34952456,-0.85257345,0.30002248,0.88582504,-0.5767401,0.44474828,1.2024413,0.08138988,1.7061814,0.97380483,0.38641644,0.5737355,1.3260057,0.90141755,0.3000228,0.88386023,0.9896236,0.08224336,-0.3332743,0.84814644,0.059832968,-0.5561582,0.7145612,0.03737477,-0.60984343,0.67991734,0.059832525,-0.7457506,-0.46575898,0.015557987,-0.5344669,-0.87070054,0.059824992,-0.43631175,-0.97935545,0.082228154,-0.19722213,-0.7343107,0.30002075,0.9894209,-0.26821455,0.58004856,1.3408854,-0.23854086,0.9368254,1.4950178,-0.11657804,0.993846,1.4253682,0.02343951,1.0082848,1.4138813,0.1716484,0.9868551,1.4172457,0.28561607,0.93589926,1.4933739,0.35627562,0.67886376,1.3302113,0.3005929,0.5591035,1.3406367,0.45560914,0.45321742,1.2763294,0.78338903,0.30002385,0.9877331,0.9478534,0.11880107,0.4729569,0.05290176,0.009341659,-0.6226395,-0.8342381,0.11879878,0.5880978,-0.60303146,0.30001727,1.0772156,-0.33079642,0.44882807,1.2942096,-0.26700586,0.91420513,1.6028824,-0.23854086,0.9368254,1.4950178,0.300248,0.9607661,1.659674,0.652299,0.3000218,1.0758358,1.0435697,0.08221803,-0.06592431,0.96321094,0.059824612,-0.32668257,0.7145612,0.03737477,-0.60984343,0.5657532,0.015558217,-0.48135206,-0.8331249,0.03300625,-0.28166395,-0.9533219,0.05981528,-0.18914744,-0.99669015,0.08221763,0.08161961,-0.46011025,0.3000119,1.1478409,-0.22779876,0.53590405,1.341137,-0.16082466,0.49030796,1.3423923,-0.29838207,0.7491861,1.4882393,-0.11753322,1.031781,1.5066577,0.023784624,1.0695803,1.5290787,0.15620223,1.0543128,1.5365474,0.20792225,0.49052173,1.3421981,0.5095196,0.30001822,1.1467938,0.80109686,0.118801974,0.6921682,-0.267814,-0.00007903695,0.058759205,-0.6608812,0.11880147,0.7855041,-0.24548951,0.2903248,1.2079035,-0.15712076,0.3610921,1.278753,-0.2643062,0.9047255,1.6497712,0.3243607,0.83986545,1.6135018,0.20062336,0.36484453,1.2822535,0.3564262,0.30001375,1.1992296,1.0262349,0.082228504,0.2129178,1.0163591,0.059807908,-0.06669014,0.90649796,0.032995813,-0.18308999,0.32357994,0.0000008908119,-0.04430827,-0.9694796,0.059807435,0.08238242,-0.9427431,0.0822428,0.34897104,-0.16082466,0.49030796,1.3423923,-0.15712076,0.3610921,1.278753,0.019480878,0.37236822,1.2998635,0.02425789,0.4495198,1.338842,-0.078982666,0.46021366,1.3368335,-0.24788877,0.6890031,1.5823387,-0.25720796,0.8231269,1.6537575,-0.18069129,1.0745118,1.6120213,-0.10018518,1.1102719,1.5884832,-0.19962151,1.1020174,1.6692796,-0.26700586,0.91420513,1.6028824,0.25154436,1.0567863,1.6208299,0.32765195,0.68810844,1.5039129,0.12445844,0.4597369,1.3368949,0.60369,0.11879907,0.8655251,-0.6070471,0.009341511,-0.021614991,-0.44167092,0.11880086,0.93226045,-0.192009,0.5880472,1.5250467,0.07696954,1.1923153,1.6255885,0.23937999,0.5897407,1.5270116,0.94070965,0.08224014,0.46647504,1.0002018,0.05981586,0.20484166,0.5657532,0.015558217,-0.48135206,-0.8596179,0.032995336,0.19878523,-0.91633075,0.05982407,0.3423783,-0.825133,0.082253985,0.58502406,0.15917301,1.1756966,1.6403203,0.27247238,0.7579822,1.6647537,0.10626299,0.24436279,1.1843089,0.36511618,0.11879548,0.9836285,0.65392655,0.009341805,0.03730923,-0.18616518,0.11879452,1.0191809,0.10626299,0.24436279,1.1843089,0.019480878,0.37236822,1.2998635,-0.078982666,0.46021366,1.3368335,-0.07510188,0.54567724,1.5366232,-0.192009,0.5880472,1.5250467,-0.11320118,0.64752257,1.6503217,-0.24788877,0.6890031,1.5823387,-0.16665137,0.7800166,1.7204527,-0.25720796,0.8231269,1.6537575,-0.21862273,0.97555107,1.745161,-0.2643062,0.9047255,1.6497712,-0.13000561,1.2205523,1.6696383,-0.0152173815,1.2451919,1.6454502,0.7931933,0.07086173,0.6782372,0.91758025,0.05982536,0.4520053,0.8800043,0.033006627,0.29735792,-0.8012676,0.059832525,0.57185113,-0.6528442,0.08225095,0.780208,0.078951955,0.53737915,1.5401113,-0.16948636,0.933222,1.7792666,-0.14193061,1.3816079,1.8129356,0.2109338,1.2106109,1.6942275,0.09504225,0.11879364,1.0373988,0.65392655,0.009341805,0.03730923,0.09504225,0.11879364,1.0373988,0.0234396,0.63065225,1.6565068,-0.024409406,0.74088794,1.7409962,-0.09351798,0.90181804,1.8040954,0.16101281,0.6488754,1.6512141,0.6006169,0.08225434,0.85641986,-0.6676807,0.03737438,0.6255383,-0.63303703,0.059832104,0.7614454,-0.43518695,0.08223949,0.9251175,-0.1361779,1.3371797,1.8652642,0.26310432,0.98280483,1.7487981,0.15118423,0.75633645,1.7342501,0.06571236,0.89168143,1.8134649,-0.10375385,1.3219061,1.9012297,0.3645637,0.08224325,0.97403014,0.5874454,0.059832793,0.83255357,0.6411311,0.0373747,0.6989676,-0.51887435,0.015557976,0.49704596,-0.42071757,0.059825003,0.9019881,-0.18162851,0.08222829,1.0106426,-0.05258019,1.3122818,1.9291797,-0.06076968,1.4828637,1.7461896,-0.1001644,1.5509489,1.8538234,0.050255213,1.449292,1.7163594,0.1220081,1.474428,1.7549484,0.16332494,1.5078211,1.8682543,0.19457108,0.92353225,1.7906046,0.050973542,1.3079153,1.9385996,0.097212024,0.08221799,1.0279773,0.3579707,0.059824385,0.9476178,0.51263946,0.01555821,0.5501603,-0.26607075,0.033006325,0.86441165,-0.17355272,0.059815552,0.9846096,0.097212024,0.08221799,1.0279773,-0.10471385,1.4867496,1.9672115,0.13015717,1.5596071,1.8278702,0.21437325,1.252835,1.8127389,0.1349504,1.3197984,1.9139618,-0.034438137,1.5614831,1.7860538,0.046039913,1.5617199,1.7744447,0.09797596,0.059807725,1.0007666,0.21437825,0.03299557,0.8909046,0.09797596,0.059807725,1.0007666,-0.10236957,1.6601003,2.0677333,-0.08605082,1.568438,2.0625153,-0.041282956,1.4725394,2.0225692,0.32357994,0.0000008908119,-0.04430827,-0.0060220635,0.009341653,0.6383341,0.046714686,1.4694996,2.0333884,0.21437825,0.03299557,0.8909046,0.1186981,1.4747397,2.0027006,-0.035708997,1.5648086,2.115774,-0.07401888,1.6548247,1.9364653,-0.092562184,1.6700922,2.1979017,-0.05520356,1.6808217,2.3022392,0.045618545,1.563633,2.128546,0.16312735,1.4525598,1.9207544,-0.0060220635,0.009341653,0.6383341,0.13632406,1.5666125,2.0636342,-0.02377089,1.6676809,1.9068271,0.046491656,1.6474826,1.8631732,-0.01231475,1.6774539,2.334932,0.07208405,1.6763514,2.3273487,0.10702443,1.6498383,1.909836,0.13675506,1.6706548,2.0202556,0.51263946,0.01555821,0.5501603,0.12681217,1.6715994,2.2434146,0.024489984,1.6868597,2.3553615,0.14904262,1.6629648,2.129228,0.013497298,1.6765794,1.9208583,0.07515714,1.6775577,1.9435898,-0.079917684,1.6874342,2.1946464,-0.076415874,1.6807529,2.0421045,0.08835412,1.6902534,2.3223107,-0.011774483,1.6934222,2.3359318,0.12859674,1.686814,2.1867743,0.02234845,1.6753298,1.9481443,-0.04541487,1.6728067,2.0182877,0.049119227,1.6857455,2.3077416,0.002972571,1.6707135,1.9543043,0.058318462,1.6707753,1.9623501,-0.050677057,1.674166,2.199432,-0.058631964,1.6714963,2.0948064,0.098035656,1.6744944,2.1967893,0.10666898,1.6717232,2.1086257,0.0918873,1.6727524,2.017068,-0.022561306,1.6681252,1.9745932,0.08456524,1.6396514,2.1486619,-0.010041372,1.6391695,2.185331,-0.05505234,1.6390067,2.0783894,-0.030087573,1.6390054,1.9475452,0.0963931,1.6389829,1.9968811,0.044547193,1.6390631,1.9208456]),uvs:new Float32Array([0.56383085,0.49572945,0.54318315,0.48315775,0.5540097,0.43693596,0.5753557,0.46960098,0.57408524,0.445826,0.53243506,0.46702212,0.5545062,0.42716795,0.57629883,0.44063866,0.53459597,0.44297063,0.55473495,0.4281926,0.5762996,0.44182265,0.53320307,0.43675837,0.53354996,0.43743944,0.5486393,0.4567124,0.5664972,0.46747687,0.58744353,0.47444963,0.59065866,0.47207454,0.5204789,0.47005764,0.5540453,0.46283823,0.59044933,0.4732049,0.5177227,0.46598,0.5902579,0.5125457,0.5180881,0.4662444,0.53862274,0.46785623,0.56176317,0.4661005,0.5758522,0.48511207,0.53929913,0.5309931,0.51626885,0.5093962,0.5416415,0.46679458,0.59520185,0.51372135,0.55432063,0.4454817,0.57204807,0.45691085,0.59483075,0.5146255,0.5633087,0.53875506,0.5113002,0.5085487,0.5367605,0.45300454,0.57409024,0.5547935,0.5115867,0.50839025,0.5298807,0.48665497,0.55576324,0.3693412,0.5944495,0.394134,0.5811135,0.5021577,0.5860809,0.5519036,0.5310886,0.5520973,0.5173457,0.38657805,0.57664156,0.49205488,0.58881485,0.5562849,0.5189948,0.5473309,0.5287704,0.49657688,0.58378273,0.48316658,0.5883615,0.5567608,0.5157375,0.54997957,0.5237934,0.47678053,0.5158632,0.54958963,0.52477556,0.52163744,0.5585938,0.22247021,0.64761,0.2784205,0.6182397,0.44949877,0.57885647,0.517105,0.5719042,0.5788152,0.49103063,0.43748364,0.4686071,0.26525488,0.58739704,0.51773506,0.57326114,0.5852916,0.53228956,0.5757849,0.5274779,0.51147443,0.5769825,0.5319237,0.57637024,0.54634094,0.5728233,0.58533984,0.530019,0.5812064,0.51827604,0.51161677,0.5589657,0.18589944,0.665279,0.25202373,0.6252903,0.5199709,0.55240446,0.5846863,0.529932,0.58075184,0.53001624,0.5417409,0.45103097,0.23829988,0.5626184,0.16698733,0.6247753,0.18617442,0.6879668,0.38968867,0.57217985,0.5462866,0.5290633,0.5363385,0.48064515,0.50874543,0.42309892,0.37117362,0.49041742,0.17701697,0.58189076,0.552547,0.5518453,0.59467715,0.6725122,0.23476869,0.56545967,0.5650203,0.5515262,0.5943763,0.5218095,0.54596895,0.44077924,0.22286889,0.7067529,0.37683308,0.6980337,0.51875657,0.6149787,0.5911406,0.540123,0.56421566,0.4057543,0.3180548,0.6998223,0.29267883,0.48735338,0.57831013,0.40912092,0.50296944,0.41304666,0.27685326,0.71633554,0.36712104,0.5688516,0.576087,0.5640695,0.56155723,0.557402,0.5650748,0.54199606,0.55881494,0.5438986,0.56214833,0.39789137,0.39166212,0.7218531,0.4239874,0.7220329,0.48431596,0.5334698,0.57199335,0.68458766,0.65040684,0.58836097,0.641064,0.39101952,0.50230837,0.39100444,0.3763519,0.7162062,0.5545882,0.51079065,0.63266134,0.4181591,0.6297085,0.55120647,0.5834012,0.3832671,0.46170026,0.7258587,0.52451074,0.70407915,0.66081554,0.72241366,0.5960014,0.6384633,0.75398684,0.5495067,0.6573702,0.39953196,0.640071,0.38218474,0.5362937,0.4571666,0.73813814,0.7127075,0.67821175,0.38674617,0.61653984,0.6567383,0.7785614,0.6928016,0.744717,0.5462981,0.7940663,0.4392854,0.761696,0.3962282,0.6768964,0.6643171,0.7936463,0.41241777,0.74058795,0.54573774,0.8279332,0.6269679,0.8275783,0.43963152,0.79260314,0.48516735,0.83040583,0.55752325,0.8468027,0.31630385,0.87820697,0.3994552,0.85925615,0.39018303,0.86876595,0.4184501,0.9156983,0.39014873,0.89028597,0.37146783,0.89708775,0.38622057,0.9194009,0.40976498,0.9309267,0.3737538,0.8842662,0.23950031,0.9142025,0.4633667,0.9254246,0.3346259,0.9577966,0.3139935,0.8372988,0.43512294,0.8101324,0.4304539,0.93350905,0.63565016,0.93904555,0.9739257,0.9628624,0.48726785,0.91974795,0.21705404,0.8610444,0.27601063,0.79483736,0.3431179,0.7732532,0.3811314,0.881681,0.89244634,0.9368228,0.12659624,0.92099905,0.23522949,0.82441294,0.2799794,0.75534624,0.4141152,0.85817957,0.39055282,0.8830576,0.36346495,0.91361344,0.384903,0.9319419,0.8608255,0.9018117,0.73524475,0.8779523,0.026442397,0.9485693,0.16734466,0.88560563,0.28270602,0.71602315,0.33558387,0.69573176,0.40632513,0.7451786,0.43343356,0.93211156,0.3905912,0.9401609,0.8456663,0.86443007,0.49127582,0.9085049,0.51914746,0.85764116,0.2846386,0.67672276,0.35883933,0.89965475,0.8370842,0.8261407,0.76005816,0.80400383,0.58363223,0.8558965,0.65143096,0.8240836,0.038318068,0.9135703,0.14398704,0.8493366,0.17289378,0.83242357,0.2395395,0.7644464,0.28602123,0.6372835,0.33208448,0.61762834,0.389248,0.6786765,0.43330306,0.78607297,0.44316125,0.92224383,0.8316798,0.78729254,1.0051861,0.9072281,0.09494999,0.8750376,0.189686,0.7972015,0.28699383,0.5975273,0.4391803,0.868773,0.47519934,0.83548546,0.4173985,0.8893641,0.3615672,0.89139855,0.3477749,0.90871096,0.3558516,0.9248323,0.36995012,0.9366081,0.39293575,0.9393337,0.8280345,0.74790883,0.7702403,0.72654426,0.69116163,0.7700589,0.91438663,0.8606985,0.04389055,0.8710385,0.20533343,0.765149,0.25238276,0.68962944,0.2876373,0.5572525,0.3308706,0.5378139,0.38344625,0.62601316,0.8254702,0.7078785,0.9982284,0.8625037,1.0430932,0.8798418,0.54186094,0.84615785,0.59648347,0.83932334,0.15331717,0.82203066,0.2165005,0.73156726,0.28799257,0.5162235,0.3781705,0.5729711,0.41710848,0.92946446,0.43223578,0.9112146,0.47324222,0.88942355,0.8236269,0.6670113,0.77506745,0.64578354,0.7128606,0.70532316,0.8773848,0.7933226,0.96161425,0.8442181,0.64506763,0.814677,0.095404744,0.8497234,0.17790608,0.763546,0.2245918,0.6969963,0.258806,0.6133525,0.2880738,0.47416353,0.33110994,0.47582412,0.41049153,0.728501,0.3954427,0.6716704,0.34402776,0.8964109,0.34547284,0.8968492,0.8223003,0.6250541,0.9345888,0.819371,0.04624506,0.8399837,0.15114078,0.8716937,0.16534404,0.8576466,0.15453808,0.83297074,0.13936551,0.7900752,0.23048392,0.661693,0.28786457,0.43075478,0.37647867,0.4401566,0.37632447,0.50008273,0.40347695,0.89606446,0.3705746,0.8904132,0.40839478,0.9197351,0.33406636,0.91815096,0.34152085,0.9338925,0.34174722,0.9415728,0.34581825,0.94552493,0.82137203,0.5817005,0.7768586,0.5823276,0.7245535,0.63395655,0.8605069,0.71924996,0.9150971,0.7903331,0.680092,0.76864254,0.010102542,0.83329844,0.0030432213,0.8525695,0.08077693,0.8202523,0.13855019,0.813244,0.11104485,0.82161444,0.15052624,0.75320524,0.20234337,0.70244884,0.23472509,0.6257595,0.2615531,0.5350409,0.2873337,0.38723594,0.3342346,0.36913118,0.44668284,0.793293,0.39015055,0.9309025,0.34402654,0.9445945,0.36946887,0.9392354,0.8207962,0.53819144,0.77732575,0.5392391,0.9009819,0.7585324,0.99486446,0.82600343,0.057383277,0.7982096,0.1123959,0.7814099,0.16600168,0.7283648,0.23765638,0.58920324,0.2864412,0.34486967,0.38421538,0.5661064,0.3883865,0.61418116,0.38018233,0.89548135,0.3281302,0.9056306,0.39307618,0.90596795,0.82053536,0.4957883,0.7770672,0.4765774,0.7299949,0.5567374,0.85194457,0.6407261,0.89064854,0.7247515,0.7002369,0.7202891,0.94475424,0.7848522,0.5804895,0.8447108,0.6441476,0.8154453,0.019554103,0.79892695,0.522547,0.8448826,0.16875345,0.89893186,0.18636717,0.88102067,0.18008813,0.8581727,0.16063176,0.8350351,0.17801286,0.7011962,0.21583033,0.636252,0.23948005,0.55196404,0.2614029,0.45334715,0.28509632,0.30337375,0.3398387,0.2872956,0.3839585,0.3830905,0.38013,0.9194697,0.33658502,0.9384182,0.3529101,0.9282392,0.8205595,0.45420164,0.88302755,0.6893792,0.71312606,0.665328,0.993998,0.78701615,1.019253,0.80039835,0.48682415,0.8303633,0.13642532,0.89077127,0.12022326,0.8604912,0.10455793,0.8587749,0.15538755,0.8354224,0.14116205,0.8400314,0.18726017,0.6723334,0.24029738,0.51392716,0.28313246,0.26251027,0.38239992,0.49189982,0.35926634,0.89765877,0.31336838,0.9192887,0.30315912,0.93477184,0.82086796,0.41317564,0.77514154,0.39523253,0.73045987,0.48025316,0.84784347,0.5572104,0.87742245,0.6525608,0.91484374,0.72793627,0.67565024,0.77784437,0.9723182,0.7696337,0.44603172,0.7974458,0.12915558,0.8678758,0.11576745,0.87325937,0.095596895,0.8362795,0.1227257,0.88932824,0.2049109,0.8794678,0.09990238,0.7325561,0.13171342,0.7010565,0.19428936,0.64218295,0.22262993,0.5668012,0.24012333,0.47493124,0.25808018,0.36947685,0.28025505,0.22209531,0.35099363,0.20816088,0.3959996,0.31096038,0.42006066,0.7548212,0.36786973,0.9059211,0.82149017,0.37249053,0.8733851,0.6142801,0.7216755,0.59258616,0.6962464,0.7340659,0.9545672,0.7479695,0.039846003,0.7454215,0.0706412,0.745618,0.14354782,0.9084484,0.21659145,0.8795565,0.20664567,0.876316,0.17356203,0.8614421,0.19949794,0.6109961,0.23888418,0.43478018,0.27590188,0.18201256,0.38764995,0.42231292,0.3232206,0.8996445,0.350004,0.9094449,0.2626592,0.94234025,0.25361505,0.94478023,0.27609164,0.94276375,0.27635702,0.93333185,0.30888554,0.92650914,0.8224908,0.33195662,0.7707547,0.31498438,0.726369,0.40645424,0.8470397,0.47494054,0.8706365,0.5744108,0.89766645,0.66224134,0.940339,0.72299385,0.5876003,0.85790575,0.655066,0.8243456,0.4999789,0.85188174,0.15374178,0.6583288,0.20315903,0.5789169,0.22445136,0.4942851,0.23649046,0.39472556,0.25050107,0.28970248,0.26889545,0.1422564,0.3770157,0.1322842,0.41775966,0.24504325,0.8239912,0.2914059,0.86907184,0.5342185,0.7246051,0.5162777,0.7153263,0.64987767,0.7099234,0.6850091,0.92909133,0.6954125,0.011705842,0.7352587,0.0020890192,0.7662393,0.4076269,0.724994,0.16157696,0.9199486,0.17185542,0.9202498,0.20851976,0.9028299,0.15837461,0.8707802,0.2054437,0.546011,0.23283681,0.35604805,0.25639617,0.10308963,0.39542955,0.351829,0.38356,0.5397457,0.3959546,0.6771858,0.3866856,0.60994774,0.327372,0.9123534,0.28169328,0.90794176,0.2617978,0.9159303,0.22494194,0.9403597,0.8262062,0.25068322,0.76189876,0.23490636,0.71680844,0.3350131,0.8491803,0.39528048,0.86860144,0.49497387,0.8883383,0.59003794,0.7189672,0.6133101,0.92031527,0.6656936,0.6939259,0.7691926,1.0030916,0.72869766,0.7149812,0.7037196,0.43458605,0.8044536,0.40316474,0.7448584,0.15411791,0.8934298,0.14409631,0.9023117,0.19948873,0.9192374,0.23258546,0.89324296,0.19931342,0.8829355,0.1677765,0.6085763,0.20643434,0.5122849,0.22140096,0.41831866,0.22765638,0.31863615,0.23506218,0.21352899,0.23003425,0.06571498,0.4697102,0.06994735,0.45671684,0.18964238,0.38312566,0.4821517,0.28140977,0.9010872,0.2205838,0.9355509,0.25420392,0.9139817,0.2829442,0.9123806,0.82953995,0.20964654,0.8691423,0.4565053,0.72102094,0.42659163,0.72251856,0.5755899,0.91359663,0.63411325,0.97410107,0.6961486,0.37838843,0.61276746,0.09861616,0.7257828,0.12927498,0.6952243,0.20613039,0.47770053,0.22051457,0.2824815,0.15845968,0.036823973,0.40848404,0.2961582,0.38642603,0.42249554,0.3236786,0.90181774,0.24023741,0.9299147,0.22631797,0.926111,0.7797758,0.16995642,0.6987512,0.26678047,0.8549764,0.31700122,0.8707031,0.41866988,0.88469285,0.51403046,0.7240294,0.5372222,0.90862614,0.6007991,0.72742605,0.40328735,0.7314122,0.55403,0.38675377,0.6804997,0.06040067,0.7394608,0.18578342,0.8918899,0.17542432,0.5542337,0.2044411,0.44219476,0.21275958,0.34536695,0.21072568,0.24773009,0.20035607,0.1430239,0.7367424,0.05022887,0.5221014,0.15630889,0.42852125,0.24680768,0.39643967,0.34887433,0.37619823,0.5365642,0.27796844,0.89708257,0.28030416,0.90066564,0.87338126,0.38136727,0.7242763,0.49972084,0.9051932,0.56576633,0.725572,0.62842274,0.9534835,0.65215254,0.6992627,0.26296425,0.6006683,0.15814152,0.7316742,0.47733963,0.022647364,0.7329271,0.09707912,0.7190199,0.12663382,0.6895207,0.1507213,0.65369403,0.20128646,0.40698892,0.19721995,0.21476683,0.21901277,0.90698874,0.85984546,0.1733515,0.6650467,0.20531285,0.8671396,0.23960212,0.877378,0.34454972,0.7109925,0.34566605,0.8860152,0.44075093,0.90324473,0.53024584,0.66168624,0.20048526,0.71768016,0.3315375,0.72014856,0.40933836,0.72392416,0.46290368,0.38760626,0.35190713,0.37798128,0.44069678,0.18572791,0.91264224,0.1767126,0.92175514,0.22759733,0.8971156,0.17749402,0.49656904,0.19660565,0.37332794,0.19637565,0.27821976,0.17835855,0.18437243,0.14423707,0.09959388,1.120868,0.037678167,0.97361374,0.061942983,0.60319483,0.1616428,0.4777652,0.19074252,0.2511641,0.8980028,0.79776704,0.12770903,0.8830383,0.30823648,0.9027065,0.49547347,0.940197,0.5997641,0.99055505,0.70891833,1.0134751,0.7287643,0.6684639,0.22824666,0.6855686,0.2572325,0.7023461,0.3058412,0.71291363,0.3566494,0.4530578,0.18988124,0.024340479,0.7262165,0.06049446,0.7322935,0.10615084,0.6875897,0.14752346,0.6492876,0.16448535,0.6051896,0.1901878,0.3412431,0.1518211,0.15799889,0.060376346,0.09549808,0.7963034,0.086349756,0.4124586,0.28243908,0.8909239,0.2725429,0.69793415,0.29217616,0.8923864,0.36995867,0.90348446,0.4614069,0.5812108,0.1680985,0.6169653,0.18082921,0.40869692,0.26411596,0.5180519,0.15466207,0.17386448,0.43639725,0.18171889,0.3108757,0.16728054,0.21922782,0.11514859,0.13813944,0.4328936,0.23768297,0.8928435,0.17874672,0.9019443,0.23774533,0.6762424,0.240712,0.9055772,0.428026,0.9342299,0.556529,0.9663038,0.6716173,0.9934339,0.70346105,1.0148032,0.7237499,0.543087,0.16565736,0.6456228,0.20294578,0.4636531,0.19902518,0.5066303,0.17211679,0.04425102,0.71032476,0.1470029,0.61795956,0.16110814,0.6019808,0.17199329,0.5520996,0.17077188,0.28251737,0.056724157,0.11606196,1.0290993,0.069496475,0.031415872,0.07017061,0.91177213,0.07733829,0.5601574,0.16579899,0.8744266,0.12511595,0.8809192,0.1602133,0.9055455,0.30196273,0.9090684,0.39535284,0.93193865,0.5107813,0.16420986,0.37993538,0.15681028,0.25665724,0.11739838,0.1756522,0.6305673,0.18948299,0.9205624,0.20671281,0.914134,0.3634692,0.9496427,0.6246412,0.9696953,0.66739136,0.00466474,0.6968733,0.0010359646,0.70697594,0.1295646,0.5991937,0.16843033,0.5503728,0.17396149,0.495718,0.13924164,0.2340366,0.049634315,0.12772693,0.98799556,0.05256421,0.9244236,0.060714968,0.87569815,0.08405379,0.86308634,0.11680955,0.8626927,0.14038087,0.9094556,0.18796468,0.9328412,0.19234224,0.9304708,0.23694636,0.9210572,0.33253777,0.9337046,0.4526049,0.06918667,0.64846075,0.1477781,0.3304975,0.11758165,0.21568888,0.06517966,0.15940702,0.024783935,0.06399959,0.022717228,0.062015295,0.85049397,0.13513921,0.9302535,0.30283427,0.93956906,0.57021624,0.9532609,0.6219051,0.9878628,0.67414516,0.009285603,0.6562987,0.1595816,0.5208753,0.1703323,0.49536115,0.17023937,0.43694377,0.0917953,0.20290676,0.037925575,0.1406532,0.02408451,0.15310602,0.041587517,0.08715959,0.89762306,0.05502879,0.84465134,0.07873442,0.8398113,0.106518894,0.9545424,0.18966609,0.94229674,0.27479863,0.9411439,0.39736885,0.07982181,0.48698,0.12326829,0.2905175,0.05319361,0.20305538,0.029864682,0.1829566,0.02099512,0.06611339,0.8797976,0.14915228,0.9701077,0.2126197,0.9579313,0.24911647,0.93548506,0.5114485,0.9432408,0.56901294,0.95797443,0.5893675,0.028216114,0.5279245,0.16657166,0.4380747,0.16054389,0.381997,1.0247798,0.15661404,1.0298647,0.1829566,0.9966049,0.19159634,0.98930275,0.17481327,1.0083582,0.16438743,0.01768047,0.09513326,0.020187318,0.07552176,0.8776393,0.03989821,0.84095573,0.053258877,0.85897744,0.03842187,0.98452926,0.05211184,0.8333796,0.123133555,0.9062468,0.16944145,0.9705882,0.1843482,0.9551114,0.34648752,0.1286795,0.47774857,0.09003194,0.26410693,0.014737048,0.11929629,0.79521275,0.08756951,0.93098885,0.16544151,0.93716276,0.45458943,0.93913555,0.5117389,0.99783933,0.640623,0.15202224,0.41760615,0.15690833,0.38467845,0.14421701,0.3340978,0.800063,0.10358047,0.895252,0.14458385,0.99614376,0.23219824,0.9772991,0.30260828,0.98118126,0.52992237,0.050173834,0.2562365,0.00814436,0.22405156,0.0029977264,0.20809662,0.008653378,0.16413386,0.9909069,0.1349066,1.0072939,0.124720424,0.9821185,0.108832315,1.0086749,0.089490056,0.9722822,0.08089945,1.0013709,0.06843192,0.9312191,0.047337655,0.9835572,0.054165266,0.7704978,0.04829276,0.77006364,0.07060939,0.9456291,0.40174264,0.9407612,0.45627543,0.949846,0.4861468,0.14078286,0.33831108,0.120153844,0.29564327,0.96196365,0.15118504,0.92791,0.059126325,0.7059092,0.0602891,0.79371023,0.1124961,1.0095878,0.27026922,0.006635111,0.5502757,0.010118984,0.27173066,0.9548465,0.1254378,0.94234973,0.10155833,0.9148942,0.07291348,0.9290308,0.14041883,0.9581758,0.35108936,0.122613296,0.33127278,0.11721027,0.30114627,0.08795343,0.2705322,0.7206092,0.05729463,0.84774965,0.12397552,0.90906703,0.123698026,0.8884691,0.09684041,0.7337785,0.061232284,0.9797741,0.3084783,0.9614298,0.35555312,0.96210706,0.3876406,0.108620495,0.36098602,0.08619282,0.27736655,0.04972796,0.2633428,0.74697006,0.068518676,0.6851326,0.0792802,0.6635486,0.087631434,0.7127924,0.09624627,0.71703374,0.10972002,0.72064126,0.11600459,0.8664504,0.114961214,0.7584554,0.084766865,1.0020937,0.28290224,0.9824674,0.31430203,0.97984743,0.4072153,0.065994516,0.29359323,0.049602073,0.27068478,0.010874764,0.2771328,0.6832024,0.07649769,0.7022272,0.11630611,0.773759,0.11052422,0.76089746,0.09917171,0.67210484,0.095783524,0.6872533,0.10680348,1.0043076,0.2893865,0.9997717,0.31875882,0.012433548,0.28406644,0.65457666,0.09493222,0.6728004,0.08640602,0.7005047,0.082337916,1.0057929,0.46996826,0.04141562,0.35654837,0.7152771,0.09342489,0.013314394,0.30861285,0.7224884,0.104023114,0.685135,0.090783246,0.6554768,0.10039595,0.66094816,0.09457934,0.67023504,0.09762179,0.69851214,0.099748686,0.7310855,0.11061789,1.008975,0.3731629,0.7068112,0.1115801,0.66103554,0.10672435,0.67454684,0.114199296,0.6775614,0.1002444,0.68844455,0.107599385,0.68508065,0.12022652,0.6887903,0.121841475,0.002489133,0.40105778,0.6950637,0.11515421,0.68191314,0.10423266,0.6951387,0.120165974,0.6667152,0.111996174,0.67839,0.11883555,0.6591545,0.096556745,0.6551869,0.1005799,0.68892753,0.110719785,0.6754353,0.10084474,0.69209236,0.11888718,0.6695055,0.11244151,0.65978134,0.10301311,0.6838405,0.10652727,0.66625226,0.10904685,0.67627454,0.115739666,0.66736096,0.0986426,0.6610199,0.099692166,0.68947494,0.1137353,0.6882302,0.117041595,0.68340147,0.11822277,0.6628245,0.10603843,0.69022506,0.1092011,0.67939335,0.10008923,0.6674889,0.09749396,0.6669351,0.10325063,0.68748736,0.11503552,0.6773752,0.11130737]),vertexCount:823});class s{C;static VERTEX=35633;static FRAGMENT=35632;constructor(C){this.config=C}vertexCode="";fragmentCode="";_app;program=null;mappings={};get gl(){const C=this._app?.gl;if(!C)throw new Error("GL context not defined at shader compile time.");return C}app(C){return this._app=C,this.program=C.gl.createProgram(),this}vertex(C){return this.vertexCode=C,this}fragment(C){return this.fragmentCode=C,this}attrib(C){return this.gl.getAttribLocation(this.program,C)}uniform(C){return this.gl.getUniformLocation(this.program,C)}generateMappings(C){return{attributes:{normal:this.attrib(C.attributes.normal),uv0:this.attrib(C.attributes.uv0),vertex:this.attrib(C.attributes.vertex),vertexColor:this.attrib(C.attributes.vertexColor)},uniforms:{albedo:this.uniform(C.uniforms.albedo),light0:this.uniform(C.uniforms.light0),light0Color:this.uniform(C.uniforms.light0Color),objectToWorld:this.uniform(C.uniforms.objectToWorld),objectToWorldInv:this.uniform(C.uniforms.objectToWorldInv),projection:this.uniform(C.uniforms.projection),texture0:this.uniform(C.uniforms.texture0),texture1:this.uniform(C.uniforms.texture1),time:this.uniform(C.uniforms.time),view:this.uniform(C.uniforms.view)}}}attach(C,V){const M=this.gl,Q=M.createShader(C);if(!Q)throw new Error(`failed to init ${Q5(C)} shader`);M.shaderSource(Q,V),M.compileShader(Q),M.attachShader(this.program,Q)}compile(){const C=this.gl;this.attach(C.FRAGMENT_SHADER,this.fragmentCode),this.attach(C.VERTEX_SHADER,this.vertexCode)}link(){if(this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))throw new Error("Unable to initialize the shader program: "+this.gl.getProgramInfoLog(this.program));this.mappings=this.generateMappings(this.config)}bindAttrib(C,V){this.gl.bindAttribLocation(this.program,C,V)}use(){this._app?.gl.useProgram(this.program)}}var Q5=(C)=>{switch(C){case s.FRAGMENT:return"fragment";case s.VERTEX:return"vertex";default:return"some unknown type of"}};var o0=`#version 300 es -precision highp float;in vec2 uv0;in vec3 normal;in vec3 light_pos;out vec4 fragColor;void main(){vec3 normal=normalize(normal);float light=dot(normal,light_pos);fragColor=vec4(1.0);fragColor.rgb*=max(light,0.1);}`;var t0=`#version 300 es -uniform mat4 u_view;uniform mat4 u_projection;uniform mat4 u_object_to_world;uniform mat4 u_object_to_world_inv;uniform vec3 u_light_0;in vec4 a_vertex;in vec2 a_uv0;in vec3 a_normal;in vec4 a_vertex_color;out vec2 uv0;out vec3 normal;out vec4 vertex_color;out vec3 light_pos;void main(){mat4 worldInv=inverse(u_view);mat4 MVW=u_projection*u_view*u_object_to_world;gl_Position=MVW*a_vertex;uv0=a_uv0;normal=normalize(mat3(worldInv)*a_normal);vertex_color=a_vertex_color;light_pos=normalize(mat3(u_object_to_world_inv)*u_light_0);}`;var I5={attributes:{vertex:"a_vertex",uv0:"a_uv0",normal:"a_normal",vertexColor:"a_vertex_color"},uniforms:{view:"u_view",projection:"u_projection",objectToWorld:"u_object_to_world",objectToWorldInv:"u_object_to_world_inv",light0:"u_light_0",light0Color:"u_light_0_color",time:"u_time",albedo:"u_albedo",texture0:"u_texture_0",texture1:"u_texture_1"}},N0=(C)=>new s(I5).vertex(t0).fragment(o0).app(C);var f=new I0({fov:45}),a0=new i([3,3,5],o([-15,40,0])),C6=new i([1,1,0]),Y0=new i(e0(0),o([0,0,0])),N5=new i([-2,0,1],o([0,152,0]));f.onUpdate(()=>{w.rotateY(Y0.rotation,Y0.rotation,0.001)});new a(f,N5,new t(f,b0,N0(f),a0,C6).configure({}));new a(f,Y0,new t(f,u0,N0(f),a0,C6).configure({}));f.start(); +var UJ=Object.defineProperty;var VB=(B,J)=>{for(var V in J)UJ(B,V,{get:J[V],enumerable:!0,configurable:!0,set:(I)=>J[V]=()=>I})};var P=0.000001,j=typeof Float32Array!=="undefined"?Float32Array:Array,n=Math.random,GV=Math.PI/180;if(!Math.hypot)Math.hypot=function(){var B=0,J=arguments.length;while(J--)B+=arguments[J]*arguments[J];return Math.sqrt(B)};function QB(){var B=new j(9);if(j!=Float32Array)B[1]=0,B[2]=0,B[3]=0,B[5]=0,B[6]=0,B[7]=0;return B[0]=1,B[4]=1,B[8]=1,B}var g={};VB(g,{transpose:()=>{{return SJ}},translate:()=>{{return GJ}},targetTo:()=>{{return rJ}},subtract:()=>{{return DB}},sub:()=>{{return tJ}},str:()=>{{return zJ}},set:()=>{{return FJ}},scale:()=>{{return _J}},rotateZ:()=>{{return TJ}},rotateY:()=>{{return DJ}},rotateX:()=>{{return PJ}},rotate:()=>{{return HJ}},perspectiveZO:()=>{{return dJ}},perspectiveNO:()=>{{return HB}},perspectiveFromFieldOfView:()=>{{return lJ}},perspective:()=>{{return nJ}},orthoZO:()=>{{return iJ}},orthoNO:()=>{{return PB}},ortho:()=>{{return sJ}},multiplyScalarAndAdd:()=>{{return bJ}},multiplyScalar:()=>{{return eJ}},multiply:()=>{{return $B}},mul:()=>{{return aJ}},lookAt:()=>{{return yJ}},invert:()=>{{return QJ}},identity:()=>{{return KB}},getTranslation:()=>{{return hJ}},getScaling:()=>{{return _B}},getRotation:()=>{{return gJ}},frustum:()=>{{return cJ}},fromZRotation:()=>{{return AJ}},fromYRotation:()=>{{return CJ}},fromXRotation:()=>{{return pJ}},fromValues:()=>{{return EJ}},fromTranslation:()=>{{return jJ}},fromScaling:()=>{{return qJ}},fromRotationTranslationScaleOrigin:()=>{{return fJ}},fromRotationTranslationScale:()=>{{return wJ}},fromRotationTranslation:()=>{{return GB}},fromRotation:()=>{{return ZJ}},fromQuat2:()=>{{return OJ}},fromQuat:()=>{{return vJ}},frob:()=>{{return xJ}},exactEquals:()=>{{return uJ}},equals:()=>{{return oJ}},determinant:()=>{{return $J}},create:()=>{{return YJ}},copy:()=>{{return MJ}},clone:()=>{{return XJ}},adjoint:()=>{{return KJ}},add:()=>{{return mJ}}});function YJ(){var B=new j(16);if(j!=Float32Array)B[1]=0,B[2]=0,B[3]=0,B[4]=0,B[6]=0,B[7]=0,B[8]=0,B[9]=0,B[11]=0,B[12]=0,B[13]=0,B[14]=0;return B[0]=1,B[5]=1,B[10]=1,B[15]=1,B}function XJ(B){var J=new j(16);return J[0]=B[0],J[1]=B[1],J[2]=B[2],J[3]=B[3],J[4]=B[4],J[5]=B[5],J[6]=B[6],J[7]=B[7],J[8]=B[8],J[9]=B[9],J[10]=B[10],J[11]=B[11],J[12]=B[12],J[13]=B[13],J[14]=B[14],J[15]=B[15],J}function MJ(B,J){return B[0]=J[0],B[1]=J[1],B[2]=J[2],B[3]=J[3],B[4]=J[4],B[5]=J[5],B[6]=J[6],B[7]=J[7],B[8]=J[8],B[9]=J[9],B[10]=J[10],B[11]=J[11],B[12]=J[12],B[13]=J[13],B[14]=J[14],B[15]=J[15],B}function EJ(B,J,V,I,L,N,R,W,U,k,Y,M,F,E,Q,S){var X=new j(16);return X[0]=B,X[1]=J,X[2]=V,X[3]=I,X[4]=L,X[5]=N,X[6]=R,X[7]=W,X[8]=U,X[9]=k,X[10]=Y,X[11]=M,X[12]=F,X[13]=E,X[14]=Q,X[15]=S,X}function FJ(B,J,V,I,L,N,R,W,U,k,Y,M,F,E,Q,S,X){return B[0]=J,B[1]=V,B[2]=I,B[3]=L,B[4]=N,B[5]=R,B[6]=W,B[7]=U,B[8]=k,B[9]=Y,B[10]=M,B[11]=F,B[12]=E,B[13]=Q,B[14]=S,B[15]=X,B}function KB(B){return B[0]=1,B[1]=0,B[2]=0,B[3]=0,B[4]=0,B[5]=1,B[6]=0,B[7]=0,B[8]=0,B[9]=0,B[10]=1,B[11]=0,B[12]=0,B[13]=0,B[14]=0,B[15]=1,B}function SJ(B,J){if(B===J){var V=J[1],I=J[2],L=J[3],N=J[6],R=J[7],W=J[11];B[1]=J[4],B[2]=J[8],B[3]=J[12],B[4]=V,B[6]=J[9],B[7]=J[13],B[8]=I,B[9]=N,B[11]=J[14],B[12]=L,B[13]=R,B[14]=W}else B[0]=J[0],B[1]=J[4],B[2]=J[8],B[3]=J[12],B[4]=J[1],B[5]=J[5],B[6]=J[9],B[7]=J[13],B[8]=J[2],B[9]=J[6],B[10]=J[10],B[11]=J[14],B[12]=J[3],B[13]=J[7],B[14]=J[11],B[15]=J[15];return B}function QJ(B,J){var V=J[0],I=J[1],L=J[2],N=J[3],R=J[4],W=J[5],U=J[6],k=J[7],Y=J[8],M=J[9],F=J[10],E=J[11],Q=J[12],S=J[13],X=J[14],K=J[15],D=V*W-I*R,H=V*U-L*R,_=V*k-N*R,$=I*U-L*W,G=I*k-N*W,C=L*k-N*U,q=Y*S-M*Q,Z=Y*X-F*Q,p=Y*K-E*Q,A=M*X-F*S,O=M*K-E*S,h=F*K-E*X,T=D*h-H*O+_*A+$*p-G*Z+C*q;if(!T)return null;return T=1/T,B[0]=(W*h-U*O+k*A)*T,B[1]=(L*O-I*h-N*A)*T,B[2]=(S*C-X*G+K*$)*T,B[3]=(F*G-M*C-E*$)*T,B[4]=(U*p-R*h-k*Z)*T,B[5]=(V*h-L*p+N*Z)*T,B[6]=(X*_-Q*C-K*H)*T,B[7]=(Y*C-F*_+E*H)*T,B[8]=(R*O-W*p+k*q)*T,B[9]=(I*p-V*O-N*q)*T,B[10]=(Q*G-S*_+K*D)*T,B[11]=(M*_-Y*G-E*D)*T,B[12]=(W*Z-R*A-U*q)*T,B[13]=(V*A-I*Z+L*q)*T,B[14]=(S*H-Q*$-X*D)*T,B[15]=(Y*$-M*H+F*D)*T,B}function KJ(B,J){var V=J[0],I=J[1],L=J[2],N=J[3],R=J[4],W=J[5],U=J[6],k=J[7],Y=J[8],M=J[9],F=J[10],E=J[11],Q=J[12],S=J[13],X=J[14],K=J[15];return B[0]=W*(F*K-E*X)-M*(U*K-k*X)+S*(U*E-k*F),B[1]=-(I*(F*K-E*X)-M*(L*K-N*X)+S*(L*E-N*F)),B[2]=I*(U*K-k*X)-W*(L*K-N*X)+S*(L*k-N*U),B[3]=-(I*(U*E-k*F)-W*(L*E-N*F)+M*(L*k-N*U)),B[4]=-(R*(F*K-E*X)-Y*(U*K-k*X)+Q*(U*E-k*F)),B[5]=V*(F*K-E*X)-Y*(L*K-N*X)+Q*(L*E-N*F),B[6]=-(V*(U*K-k*X)-R*(L*K-N*X)+Q*(L*k-N*U)),B[7]=V*(U*E-k*F)-R*(L*E-N*F)+Y*(L*k-N*U),B[8]=R*(M*K-E*S)-Y*(W*K-k*S)+Q*(W*E-k*M),B[9]=-(V*(M*K-E*S)-Y*(I*K-N*S)+Q*(I*E-N*M)),B[10]=V*(W*K-k*S)-R*(I*K-N*S)+Q*(I*k-N*W),B[11]=-(V*(W*E-k*M)-R*(I*E-N*M)+Y*(I*k-N*W)),B[12]=-(R*(M*X-F*S)-Y*(W*X-U*S)+Q*(W*F-U*M)),B[13]=V*(M*X-F*S)-Y*(I*X-L*S)+Q*(I*F-L*M),B[14]=-(V*(W*X-U*S)-R*(I*X-L*S)+Q*(I*U-L*W)),B[15]=V*(W*F-U*M)-R*(I*F-L*M)+Y*(I*U-L*W),B}function $J(B){var J=B[0],V=B[1],I=B[2],L=B[3],N=B[4],R=B[5],W=B[6],U=B[7],k=B[8],Y=B[9],M=B[10],F=B[11],E=B[12],Q=B[13],S=B[14],X=B[15],K=J*R-V*N,D=J*W-I*N,H=J*U-L*N,_=V*W-I*R,$=V*U-L*R,G=I*U-L*W,C=k*Q-Y*E,q=k*S-M*E,Z=k*X-F*E,p=Y*S-M*Q,A=Y*X-F*Q,O=M*X-F*S;return K*O-D*A+H*p+_*Z-$*q+G*C}function $B(B,J,V){var I=J[0],L=J[1],N=J[2],R=J[3],W=J[4],U=J[5],k=J[6],Y=J[7],M=J[8],F=J[9],E=J[10],Q=J[11],S=J[12],X=J[13],K=J[14],D=J[15],H=V[0],_=V[1],$=V[2],G=V[3];return B[0]=H*I+_*W+$*M+G*S,B[1]=H*L+_*U+$*F+G*X,B[2]=H*N+_*k+$*E+G*K,B[3]=H*R+_*Y+$*Q+G*D,H=V[4],_=V[5],$=V[6],G=V[7],B[4]=H*I+_*W+$*M+G*S,B[5]=H*L+_*U+$*F+G*X,B[6]=H*N+_*k+$*E+G*K,B[7]=H*R+_*Y+$*Q+G*D,H=V[8],_=V[9],$=V[10],G=V[11],B[8]=H*I+_*W+$*M+G*S,B[9]=H*L+_*U+$*F+G*X,B[10]=H*N+_*k+$*E+G*K,B[11]=H*R+_*Y+$*Q+G*D,H=V[12],_=V[13],$=V[14],G=V[15],B[12]=H*I+_*W+$*M+G*S,B[13]=H*L+_*U+$*F+G*X,B[14]=H*N+_*k+$*E+G*K,B[15]=H*R+_*Y+$*Q+G*D,B}function GJ(B,J,V){var I=V[0],L=V[1],N=V[2],R,W,U,k,Y,M,F,E,Q,S,X,K;if(J===B)B[12]=J[0]*I+J[4]*L+J[8]*N+J[12],B[13]=J[1]*I+J[5]*L+J[9]*N+J[13],B[14]=J[2]*I+J[6]*L+J[10]*N+J[14],B[15]=J[3]*I+J[7]*L+J[11]*N+J[15];else R=J[0],W=J[1],U=J[2],k=J[3],Y=J[4],M=J[5],F=J[6],E=J[7],Q=J[8],S=J[9],X=J[10],K=J[11],B[0]=R,B[1]=W,B[2]=U,B[3]=k,B[4]=Y,B[5]=M,B[6]=F,B[7]=E,B[8]=Q,B[9]=S,B[10]=X,B[11]=K,B[12]=R*I+Y*L+Q*N+J[12],B[13]=W*I+M*L+S*N+J[13],B[14]=U*I+F*L+X*N+J[14],B[15]=k*I+E*L+K*N+J[15];return B}function _J(B,J,V){var I=V[0],L=V[1],N=V[2];return B[0]=J[0]*I,B[1]=J[1]*I,B[2]=J[2]*I,B[3]=J[3]*I,B[4]=J[4]*L,B[5]=J[5]*L,B[6]=J[6]*L,B[7]=J[7]*L,B[8]=J[8]*N,B[9]=J[9]*N,B[10]=J[10]*N,B[11]=J[11]*N,B[12]=J[12],B[13]=J[13],B[14]=J[14],B[15]=J[15],B}function HJ(B,J,V,I){var L=I[0],N=I[1],R=I[2],W=Math.hypot(L,N,R),U,k,Y,M,F,E,Q,S,X,K,D,H,_,$,G,C,q,Z,p,A,O,h,T,w;if(W0)V[0]=(W*R+Y*I+U*N-k*L)*2/M,V[1]=(U*R+Y*L+k*I-W*N)*2/M,V[2]=(k*R+Y*N+W*L-U*I)*2/M;else V[0]=(W*R+Y*I+U*N-k*L)*2,V[1]=(U*R+Y*L+k*I-W*N)*2,V[2]=(k*R+Y*N+W*L-U*I)*2;return GB(B,J,V),B}function hJ(B,J){return B[0]=J[12],B[1]=J[13],B[2]=J[14],B}function _B(B,J){var V=J[0],I=J[1],L=J[2],N=J[4],R=J[5],W=J[6],U=J[8],k=J[9],Y=J[10];return B[0]=Math.hypot(V,I,L),B[1]=Math.hypot(N,R,W),B[2]=Math.hypot(U,k,Y),B}function gJ(B,J){var V=new j(3);_B(V,J);var I=1/V[0],L=1/V[1],N=1/V[2],R=J[0]*I,W=J[1]*L,U=J[2]*N,k=J[4]*I,Y=J[5]*L,M=J[6]*N,F=J[8]*I,E=J[9]*L,Q=J[10]*N,S=R+Y+Q,X=0;if(S>0)X=Math.sqrt(S+1)*2,B[3]=0.25*X,B[0]=(M-E)/X,B[1]=(F-U)/X,B[2]=(W-k)/X;else if(R>Y&&R>Q)X=Math.sqrt(1+R-Y-Q)*2,B[3]=(M-E)/X,B[0]=0.25*X,B[1]=(W+k)/X,B[2]=(F+U)/X;else if(Y>Q)X=Math.sqrt(1+Y-R-Q)*2,B[3]=(F-U)/X,B[0]=(W+k)/X,B[1]=0.25*X,B[2]=(M+E)/X;else X=Math.sqrt(1+Q-R-Y)*2,B[3]=(W-k)/X,B[0]=(F+U)/X,B[1]=(M+E)/X,B[2]=0.25*X;return B}function wJ(B,J,V,I){var L=J[0],N=J[1],R=J[2],W=J[3],U=L+L,k=N+N,Y=R+R,M=L*U,F=L*k,E=L*Y,Q=N*k,S=N*Y,X=R*Y,K=W*U,D=W*k,H=W*Y,_=I[0],$=I[1],G=I[2];return B[0]=(1-(Q+X))*_,B[1]=(F+H)*_,B[2]=(E-D)*_,B[3]=0,B[4]=(F-H)*$,B[5]=(1-(M+X))*$,B[6]=(S+K)*$,B[7]=0,B[8]=(E+D)*G,B[9]=(S-K)*G,B[10]=(1-(M+Q))*G,B[11]=0,B[12]=V[0],B[13]=V[1],B[14]=V[2],B[15]=1,B}function fJ(B,J,V,I,L){var N=J[0],R=J[1],W=J[2],U=J[3],k=N+N,Y=R+R,M=W+W,F=N*k,E=N*Y,Q=N*M,S=R*Y,X=R*M,K=W*M,D=U*k,H=U*Y,_=U*M,$=I[0],G=I[1],C=I[2],q=L[0],Z=L[1],p=L[2],A=(1-(S+K))*$,O=(E+_)*$,h=(Q-H)*$,T=(E-_)*G,w=(1-(F+K))*G,i=(X+D)*G,y=(Q+H)*C,FB=(X-D)*C,SB=(1-(F+S))*C;return B[0]=A,B[1]=O,B[2]=h,B[3]=0,B[4]=T,B[5]=w,B[6]=i,B[7]=0,B[8]=y,B[9]=FB,B[10]=SB,B[11]=0,B[12]=V[0]+q-(A*q+T*Z+y*p),B[13]=V[1]+Z-(O*q+w*Z+FB*p),B[14]=V[2]+p-(h*q+i*Z+SB*p),B[15]=1,B}function vJ(B,J){var V=J[0],I=J[1],L=J[2],N=J[3],R=V+V,W=I+I,U=L+L,k=V*R,Y=I*R,M=I*W,F=L*R,E=L*W,Q=L*U,S=N*R,X=N*W,K=N*U;return B[0]=1-M-Q,B[1]=Y+K,B[2]=F-X,B[3]=0,B[4]=Y-K,B[5]=1-k-Q,B[6]=E+S,B[7]=0,B[8]=F+X,B[9]=E-S,B[10]=1-k-M,B[11]=0,B[12]=0,B[13]=0,B[14]=0,B[15]=1,B}function cJ(B,J,V,I,L,N,R){var W=1/(V-J),U=1/(L-I),k=1/(N-R);return B[0]=N*2*W,B[1]=0,B[2]=0,B[3]=0,B[4]=0,B[5]=N*2*U,B[6]=0,B[7]=0,B[8]=(V+J)*W,B[9]=(L+I)*U,B[10]=(R+N)*k,B[11]=-1,B[12]=0,B[13]=0,B[14]=R*N*2*k,B[15]=0,B}function HB(B,J,V,I,L){var N=1/Math.tan(J/2),R;if(B[0]=N/V,B[1]=0,B[2]=0,B[3]=0,B[4]=0,B[5]=N,B[6]=0,B[7]=0,B[8]=0,B[9]=0,B[11]=-1,B[12]=0,B[13]=0,B[15]=0,L!=null&&L!==Infinity)R=1/(I-L),B[10]=(L+I)*R,B[14]=2*L*I*R;else B[10]=-1,B[14]=-2*I;return B}function dJ(B,J,V,I,L){var N=1/Math.tan(J/2),R;if(B[0]=N/V,B[1]=0,B[2]=0,B[3]=0,B[4]=0,B[5]=N,B[6]=0,B[7]=0,B[8]=0,B[9]=0,B[11]=-1,B[12]=0,B[13]=0,B[15]=0,L!=null&&L!==Infinity)R=1/(I-L),B[10]=L*R,B[14]=L*I*R;else B[10]=-1,B[14]=-I;return B}function lJ(B,J,V,I){var L=Math.tan(J.upDegrees*Math.PI/180),N=Math.tan(J.downDegrees*Math.PI/180),R=Math.tan(J.leftDegrees*Math.PI/180),W=Math.tan(J.rightDegrees*Math.PI/180),U=2/(R+W),k=2/(L+N);return B[0]=U,B[1]=0,B[2]=0,B[3]=0,B[4]=0,B[5]=k,B[6]=0,B[7]=0,B[8]=-((R-W)*U*0.5),B[9]=(L-N)*k*0.5,B[10]=I/(V-I),B[11]=-1,B[12]=0,B[13]=0,B[14]=I*V/(V-I),B[15]=0,B}function PB(B,J,V,I,L,N,R){var W=1/(J-V),U=1/(I-L),k=1/(N-R);return B[0]=-2*W,B[1]=0,B[2]=0,B[3]=0,B[4]=0,B[5]=-2*U,B[6]=0,B[7]=0,B[8]=0,B[9]=0,B[10]=2*k,B[11]=0,B[12]=(J+V)*W,B[13]=(L+I)*U,B[14]=(R+N)*k,B[15]=1,B}function iJ(B,J,V,I,L,N,R){var W=1/(J-V),U=1/(I-L),k=1/(N-R);return B[0]=-2*W,B[1]=0,B[2]=0,B[3]=0,B[4]=0,B[5]=-2*U,B[6]=0,B[7]=0,B[8]=0,B[9]=0,B[10]=k,B[11]=0,B[12]=(J+V)*W,B[13]=(L+I)*U,B[14]=N*k,B[15]=1,B}function yJ(B,J,V,I){var L,N,R,W,U,k,Y,M,F,E,Q=J[0],S=J[1],X=J[2],K=I[0],D=I[1],H=I[2],_=V[0],$=V[1],G=V[2];if(Math.abs(Q-_)0)E=1/Math.sqrt(E),Y*=E,M*=E,F*=E;var Q=U*F-k*M,S=k*Y-W*F,X=W*M-U*Y;if(E=Q*Q+S*S+X*X,E>0)E=1/Math.sqrt(E),Q*=E,S*=E,X*=E;return B[0]=Q,B[1]=S,B[2]=X,B[3]=0,B[4]=M*X-F*S,B[5]=F*Q-Y*X,B[6]=Y*S-M*Q,B[7]=0,B[8]=Y,B[9]=M,B[10]=F,B[11]=0,B[12]=L,B[13]=N,B[14]=R,B[15]=1,B}function zJ(B){return"mat4("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+", "+B[6]+", "+B[7]+", "+B[8]+", "+B[9]+", "+B[10]+", "+B[11]+", "+B[12]+", "+B[13]+", "+B[14]+", "+B[15]+")"}function xJ(B){return Math.hypot(B[0],B[1],B[2],B[3],B[4],B[5],B[6],B[7],B[8],B[9],B[10],B[11],B[12],B[13],B[14],B[15])}function mJ(B,J,V){return B[0]=J[0]+V[0],B[1]=J[1]+V[1],B[2]=J[2]+V[2],B[3]=J[3]+V[3],B[4]=J[4]+V[4],B[5]=J[5]+V[5],B[6]=J[6]+V[6],B[7]=J[7]+V[7],B[8]=J[8]+V[8],B[9]=J[9]+V[9],B[10]=J[10]+V[10],B[11]=J[11]+V[11],B[12]=J[12]+V[12],B[13]=J[13]+V[13],B[14]=J[14]+V[14],B[15]=J[15]+V[15],B}function DB(B,J,V){return B[0]=J[0]-V[0],B[1]=J[1]-V[1],B[2]=J[2]-V[2],B[3]=J[3]-V[3],B[4]=J[4]-V[4],B[5]=J[5]-V[5],B[6]=J[6]-V[6],B[7]=J[7]-V[7],B[8]=J[8]-V[8],B[9]=J[9]-V[9],B[10]=J[10]-V[10],B[11]=J[11]-V[11],B[12]=J[12]-V[12],B[13]=J[13]-V[13],B[14]=J[14]-V[14],B[15]=J[15]-V[15],B}function eJ(B,J,V){return B[0]=J[0]*V,B[1]=J[1]*V,B[2]=J[2]*V,B[3]=J[3]*V,B[4]=J[4]*V,B[5]=J[5]*V,B[6]=J[6]*V,B[7]=J[7]*V,B[8]=J[8]*V,B[9]=J[9]*V,B[10]=J[10]*V,B[11]=J[11]*V,B[12]=J[12]*V,B[13]=J[13]*V,B[14]=J[14]*V,B[15]=J[15]*V,B}function bJ(B,J,V,I){return B[0]=J[0]+V[0]*I,B[1]=J[1]+V[1]*I,B[2]=J[2]+V[2]*I,B[3]=J[3]+V[3]*I,B[4]=J[4]+V[4]*I,B[5]=J[5]+V[5]*I,B[6]=J[6]+V[6]*I,B[7]=J[7]+V[7]*I,B[8]=J[8]+V[8]*I,B[9]=J[9]+V[9]*I,B[10]=J[10]+V[10]*I,B[11]=J[11]+V[11]*I,B[12]=J[12]+V[12]*I,B[13]=J[13]+V[13]*I,B[14]=J[14]+V[14]*I,B[15]=J[15]+V[15]*I,B}function uJ(B,J){return B[0]===J[0]&&B[1]===J[1]&&B[2]===J[2]&&B[3]===J[3]&&B[4]===J[4]&&B[5]===J[5]&&B[6]===J[6]&&B[7]===J[7]&&B[8]===J[8]&&B[9]===J[9]&&B[10]===J[10]&&B[11]===J[11]&&B[12]===J[12]&&B[13]===J[13]&&B[14]===J[14]&&B[15]===J[15]}function oJ(B,J){var V=B[0],I=B[1],L=B[2],N=B[3],R=B[4],W=B[5],U=B[6],k=B[7],Y=B[8],M=B[9],F=B[10],E=B[11],Q=B[12],S=B[13],X=B[14],K=B[15],D=J[0],H=J[1],_=J[2],$=J[3],G=J[4],C=J[5],q=J[6],Z=J[7],p=J[8],A=J[9],O=J[10],h=J[11],T=J[12],w=J[13],i=J[14],y=J[15];return Math.abs(V-D)<=P*Math.max(1,Math.abs(V),Math.abs(D))&&Math.abs(I-H)<=P*Math.max(1,Math.abs(I),Math.abs(H))&&Math.abs(L-_)<=P*Math.max(1,Math.abs(L),Math.abs(_))&&Math.abs(N-$)<=P*Math.max(1,Math.abs(N),Math.abs($))&&Math.abs(R-G)<=P*Math.max(1,Math.abs(R),Math.abs(G))&&Math.abs(W-C)<=P*Math.max(1,Math.abs(W),Math.abs(C))&&Math.abs(U-q)<=P*Math.max(1,Math.abs(U),Math.abs(q))&&Math.abs(k-Z)<=P*Math.max(1,Math.abs(k),Math.abs(Z))&&Math.abs(Y-p)<=P*Math.max(1,Math.abs(Y),Math.abs(p))&&Math.abs(M-A)<=P*Math.max(1,Math.abs(M),Math.abs(A))&&Math.abs(F-O)<=P*Math.max(1,Math.abs(F),Math.abs(O))&&Math.abs(E-h)<=P*Math.max(1,Math.abs(E),Math.abs(h))&&Math.abs(Q-T)<=P*Math.max(1,Math.abs(Q),Math.abs(T))&&Math.abs(S-w)<=P*Math.max(1,Math.abs(S),Math.abs(w))&&Math.abs(X-i)<=P*Math.max(1,Math.abs(X),Math.abs(i))&&Math.abs(K-y)<=P*Math.max(1,Math.abs(K),Math.abs(y))}var nJ=HB,sJ=PB,aJ=$B,tJ=DB;var f={};VB(f,{str:()=>{{return b0}},squaredLength:()=>{{return aB}},sqrLen:()=>{{return LV}},sqlerp:()=>{{return UV}},slerp:()=>{{return b}},setAxisAngle:()=>{{return rB}},setAxes:()=>{{return kV}},set:()=>{{return t0}},scale:()=>{{return bB}},rotationTo:()=>{{return WV}},rotateZ:()=>{{return i0}},rotateY:()=>{{return s0}},rotateX:()=>{{return l0}},random:()=>{{return z0}},pow:()=>{{return r0}},normalize:()=>{{return RB}},multiply:()=>{{return zB}},mul:()=>{{return JV}},ln:()=>{{return mB}},lerp:()=>{{return VV}},length:()=>{{return oB}},len:()=>{{return IV}},invert:()=>{{return x0}},identity:()=>{{return c0}},getAxisAngle:()=>{{return n0}},getAngle:()=>{{return d0}},fromValues:()=>{{return o0}},fromMat3:()=>{{return eB}},fromEuler:()=>{{return e0}},exp:()=>{{return xB}},exactEquals:()=>{{return NV}},equals:()=>{{return RV}},dot:()=>{{return uB}},create:()=>{{return NB}},copy:()=>{{return a0}},conjugate:()=>{{return m0}},clone:()=>{{return u0}},calculateW:()=>{{return y0}},add:()=>{{return BV}}});var s={};VB(s,{zero:()=>{{return T0}},transformQuat:()=>{{return G0}},transformMat4:()=>{{return K0}},transformMat3:()=>{{return $0}},subtract:()=>{{return jB}},sub:()=>{{return p0}},str:()=>{{return j0}},squaredLength:()=>{{return AB}},squaredDistance:()=>{{return CB}},sqrLen:()=>{{return g0}},sqrDist:()=>{{return h0}},set:()=>{{return V0}},scaleAndAdd:()=>{{return Y0}},scale:()=>{{return k0}},round:()=>{{return U0}},rotateZ:()=>{{return P0}},rotateY:()=>{{return H0}},rotateX:()=>{{return _0}},random:()=>{{return Q0}},normalize:()=>{{return IB}},negate:()=>{{return X0}},multiply:()=>{{return qB}},mul:()=>{{return C0}},min:()=>{{return R0}},max:()=>{{return W0}},lerp:()=>{{return E0}},length:()=>{{return TB}},len:()=>{{return LB}},inverse:()=>{{return M0}},hermite:()=>{{return F0}},fromValues:()=>{{return m}},forEach:()=>{{return w0}},floor:()=>{{return N0}},exactEquals:()=>{{return q0}},equals:()=>{{return Z0}},dot:()=>{{return e}},divide:()=>{{return ZB}},div:()=>{{return A0}},distance:()=>{{return pB}},dist:()=>{{return O0}},cross:()=>{{return z}},create:()=>{{return x}},copy:()=>{{return J0}},clone:()=>{{return B0}},ceil:()=>{{return L0}},bezier:()=>{{return S0}},angle:()=>{{return D0}},add:()=>{{return I0}}});function x(){var B=new j(3);if(j!=Float32Array)B[0]=0,B[1]=0,B[2]=0;return B}function B0(B){var J=new j(3);return J[0]=B[0],J[1]=B[1],J[2]=B[2],J}function TB(B){var J=B[0],V=B[1],I=B[2];return Math.hypot(J,V,I)}function m(B,J,V){var I=new j(3);return I[0]=B,I[1]=J,I[2]=V,I}function J0(B,J){return B[0]=J[0],B[1]=J[1],B[2]=J[2],B}function V0(B,J,V,I){return B[0]=J,B[1]=V,B[2]=I,B}function I0(B,J,V){return B[0]=J[0]+V[0],B[1]=J[1]+V[1],B[2]=J[2]+V[2],B}function jB(B,J,V){return B[0]=J[0]-V[0],B[1]=J[1]-V[1],B[2]=J[2]-V[2],B}function qB(B,J,V){return B[0]=J[0]*V[0],B[1]=J[1]*V[1],B[2]=J[2]*V[2],B}function ZB(B,J,V){return B[0]=J[0]/V[0],B[1]=J[1]/V[1],B[2]=J[2]/V[2],B}function L0(B,J){return B[0]=Math.ceil(J[0]),B[1]=Math.ceil(J[1]),B[2]=Math.ceil(J[2]),B}function N0(B,J){return B[0]=Math.floor(J[0]),B[1]=Math.floor(J[1]),B[2]=Math.floor(J[2]),B}function R0(B,J,V){return B[0]=Math.min(J[0],V[0]),B[1]=Math.min(J[1],V[1]),B[2]=Math.min(J[2],V[2]),B}function W0(B,J,V){return B[0]=Math.max(J[0],V[0]),B[1]=Math.max(J[1],V[1]),B[2]=Math.max(J[2],V[2]),B}function U0(B,J){return B[0]=Math.round(J[0]),B[1]=Math.round(J[1]),B[2]=Math.round(J[2]),B}function k0(B,J,V){return B[0]=J[0]*V,B[1]=J[1]*V,B[2]=J[2]*V,B}function Y0(B,J,V,I){return B[0]=J[0]+V[0]*I,B[1]=J[1]+V[1]*I,B[2]=J[2]+V[2]*I,B}function pB(B,J){var V=J[0]-B[0],I=J[1]-B[1],L=J[2]-B[2];return Math.hypot(V,I,L)}function CB(B,J){var V=J[0]-B[0],I=J[1]-B[1],L=J[2]-B[2];return V*V+I*I+L*L}function AB(B){var J=B[0],V=B[1],I=B[2];return J*J+V*V+I*I}function X0(B,J){return B[0]=-J[0],B[1]=-J[1],B[2]=-J[2],B}function M0(B,J){return B[0]=1/J[0],B[1]=1/J[1],B[2]=1/J[2],B}function IB(B,J){var V=J[0],I=J[1],L=J[2],N=V*V+I*I+L*L;if(N>0)N=1/Math.sqrt(N);return B[0]=J[0]*N,B[1]=J[1]*N,B[2]=J[2]*N,B}function e(B,J){return B[0]*J[0]+B[1]*J[1]+B[2]*J[2]}function z(B,J,V){var I=J[0],L=J[1],N=J[2],R=V[0],W=V[1],U=V[2];return B[0]=L*U-N*W,B[1]=N*R-I*U,B[2]=I*W-L*R,B}function E0(B,J,V,I){var L=J[0],N=J[1],R=J[2];return B[0]=L+I*(V[0]-L),B[1]=N+I*(V[1]-N),B[2]=R+I*(V[2]-R),B}function F0(B,J,V,I,L,N){var R=N*N,W=R*(2*N-3)+1,U=R*(N-2)+N,k=R*(N-1),Y=R*(3-2*N);return B[0]=J[0]*W+V[0]*U+I[0]*k+L[0]*Y,B[1]=J[1]*W+V[1]*U+I[1]*k+L[1]*Y,B[2]=J[2]*W+V[2]*U+I[2]*k+L[2]*Y,B}function S0(B,J,V,I,L,N){var R=1-N,W=R*R,U=N*N,k=W*R,Y=3*N*W,M=3*U*R,F=U*N;return B[0]=J[0]*k+V[0]*Y+I[0]*M+L[0]*F,B[1]=J[1]*k+V[1]*Y+I[1]*M+L[1]*F,B[2]=J[2]*k+V[2]*Y+I[2]*M+L[2]*F,B}function Q0(B,J){J=J||1;var V=n()*2*Math.PI,I=n()*2-1,L=Math.sqrt(1-I*I)*J;return B[0]=Math.cos(V)*L,B[1]=Math.sin(V)*L,B[2]=I*J,B}function K0(B,J,V){var I=J[0],L=J[1],N=J[2],R=V[3]*I+V[7]*L+V[11]*N+V[15];return R=R||1,B[0]=(V[0]*I+V[4]*L+V[8]*N+V[12])/R,B[1]=(V[1]*I+V[5]*L+V[9]*N+V[13])/R,B[2]=(V[2]*I+V[6]*L+V[10]*N+V[14])/R,B}function $0(B,J,V){var I=J[0],L=J[1],N=J[2];return B[0]=I*V[0]+L*V[3]+N*V[6],B[1]=I*V[1]+L*V[4]+N*V[7],B[2]=I*V[2]+L*V[5]+N*V[8],B}function G0(B,J,V){var I=V[0],L=V[1],N=V[2],R=V[3],W=J[0],U=J[1],k=J[2],Y=L*k-N*U,M=N*W-I*k,F=I*U-L*W,E=L*F-N*M,Q=N*Y-I*F,S=I*M-L*Y,X=R*2;return Y*=X,M*=X,F*=X,E*=2,Q*=2,S*=2,B[0]=W+Y+E,B[1]=U+M+Q,B[2]=k+F+S,B}function _0(B,J,V,I){var L=[],N=[];return L[0]=J[0]-V[0],L[1]=J[1]-V[1],L[2]=J[2]-V[2],N[0]=L[0],N[1]=L[1]*Math.cos(I)-L[2]*Math.sin(I),N[2]=L[1]*Math.sin(I)+L[2]*Math.cos(I),B[0]=N[0]+V[0],B[1]=N[1]+V[1],B[2]=N[2]+V[2],B}function H0(B,J,V,I){var L=[],N=[];return L[0]=J[0]-V[0],L[1]=J[1]-V[1],L[2]=J[2]-V[2],N[0]=L[2]*Math.sin(I)+L[0]*Math.cos(I),N[1]=L[1],N[2]=L[2]*Math.cos(I)-L[0]*Math.sin(I),B[0]=N[0]+V[0],B[1]=N[1]+V[1],B[2]=N[2]+V[2],B}function P0(B,J,V,I){var L=[],N=[];return L[0]=J[0]-V[0],L[1]=J[1]-V[1],L[2]=J[2]-V[2],N[0]=L[0]*Math.cos(I)-L[1]*Math.sin(I),N[1]=L[0]*Math.sin(I)+L[1]*Math.cos(I),N[2]=L[2],B[0]=N[0]+V[0],B[1]=N[1]+V[1],B[2]=N[2]+V[2],B}function D0(B,J){var V=B[0],I=B[1],L=B[2],N=J[0],R=J[1],W=J[2],U=Math.sqrt(V*V+I*I+L*L),k=Math.sqrt(N*N+R*R+W*W),Y=U*k,M=Y&&e(B,J)/Y;return Math.acos(Math.min(Math.max(M,-1),1))}function T0(B){return B[0]=0,B[1]=0,B[2]=0,B}function j0(B){return"vec3("+B[0]+", "+B[1]+", "+B[2]+")"}function q0(B,J){return B[0]===J[0]&&B[1]===J[1]&&B[2]===J[2]}function Z0(B,J){var V=B[0],I=B[1],L=B[2],N=J[0],R=J[1],W=J[2];return Math.abs(V-N)<=P*Math.max(1,Math.abs(V),Math.abs(N))&&Math.abs(I-R)<=P*Math.max(1,Math.abs(I),Math.abs(R))&&Math.abs(L-W)<=P*Math.max(1,Math.abs(L),Math.abs(W))}var p0=jB,C0=qB,A0=ZB,O0=pB,h0=CB,LB=TB,g0=AB,w0=function(){var B=x();return function(J,V,I,L,N,R){var W,U;if(!V)V=3;if(!I)I=0;if(L)U=Math.min(L*V+I,J.length);else U=J.length;for(W=I;W0)R=1/Math.sqrt(R);return B[0]=V*R,B[1]=I*R,B[2]=L*R,B[3]=N*R,B}function lB(B,J){return B[0]*J[0]+B[1]*J[1]+B[2]*J[2]+B[3]*J[3]}function sB(B,J,V,I){var L=J[0],N=J[1],R=J[2],W=J[3];return B[0]=L+I*(V[0]-L),B[1]=N+I*(V[1]-N),B[2]=R+I*(V[2]-R),B[3]=W+I*(V[3]-W),B}function iB(B,J){return B[0]===J[0]&&B[1]===J[1]&&B[2]===J[2]&&B[3]===J[3]}function yB(B,J){var V=B[0],I=B[1],L=B[2],N=B[3],R=J[0],W=J[1],U=J[2],k=J[3];return Math.abs(V-R)<=P*Math.max(1,Math.abs(V),Math.abs(R))&&Math.abs(I-W)<=P*Math.max(1,Math.abs(I),Math.abs(W))&&Math.abs(L-U)<=P*Math.max(1,Math.abs(L),Math.abs(U))&&Math.abs(N-k)<=P*Math.max(1,Math.abs(N),Math.abs(k))}var _V=function(){var B=f0();return function(J,V,I,L,N,R){var W,U;if(!V)V=4;if(!I)I=0;if(L)U=Math.min(L*V+I,J.length);else U=J.length;for(W=I;WP)B[0]=J[0]/I,B[1]=J[1]/I,B[2]=J[2]/I;else B[0]=1,B[1]=0,B[2]=0;return V}function d0(B,J){var V=uB(B,J);return Math.acos(2*V*V-1)}function zB(B,J,V){var I=J[0],L=J[1],N=J[2],R=J[3],W=V[0],U=V[1],k=V[2],Y=V[3];return B[0]=I*Y+R*W+L*k-N*U,B[1]=L*Y+R*U+N*W-I*k,B[2]=N*Y+R*k+I*U-L*W,B[3]=R*Y-I*W-L*U-N*k,B}function l0(B,J,V){V*=0.5;var I=J[0],L=J[1],N=J[2],R=J[3],W=Math.sin(V),U=Math.cos(V);return B[0]=I*U+R*W,B[1]=L*U+N*W,B[2]=N*U-L*W,B[3]=R*U-I*W,B}function s0(B,J,V){V*=0.5;var I=J[0],L=J[1],N=J[2],R=J[3],W=Math.sin(V),U=Math.cos(V);return B[0]=I*U-N*W,B[1]=L*U+R*W,B[2]=N*U+I*W,B[3]=R*U-L*W,B}function i0(B,J,V){V*=0.5;var I=J[0],L=J[1],N=J[2],R=J[3],W=Math.sin(V),U=Math.cos(V);return B[0]=I*U+L*W,B[1]=L*U-I*W,B[2]=N*U+R*W,B[3]=R*U-N*W,B}function y0(B,J){var V=J[0],I=J[1],L=J[2];return B[0]=V,B[1]=I,B[2]=L,B[3]=Math.sqrt(Math.abs(1-V*V-I*I-L*L)),B}function xB(B,J){var V=J[0],I=J[1],L=J[2],N=J[3],R=Math.sqrt(V*V+I*I+L*L),W=Math.exp(N),U=R>0?W*Math.sin(R)/R:0;return B[0]=V*U,B[1]=I*U,B[2]=L*U,B[3]=W*Math.cos(R),B}function mB(B,J){var V=J[0],I=J[1],L=J[2],N=J[3],R=Math.sqrt(V*V+I*I+L*L),W=R>0?Math.atan2(R,N)/R:0;return B[0]=V*W,B[1]=I*W,B[2]=L*W,B[3]=0.5*Math.log(V*V+I*I+L*L+N*N),B}function r0(B,J,V){return mB(B,J),bB(B,B,V),xB(B,B),B}function b(B,J,V,I){var L=J[0],N=J[1],R=J[2],W=J[3],U=V[0],k=V[1],Y=V[2],M=V[3],F,E,Q,S,X;if(E=L*U+N*k+R*Y+W*M,E<0)E=-E,U=-U,k=-k,Y=-Y,M=-M;if(1-E>P)F=Math.acos(E),Q=Math.sin(F),S=Math.sin((1-I)*F)/Q,X=Math.sin(I*F)/Q;else S=1-I,X=I;return B[0]=S*L+X*U,B[1]=S*N+X*k,B[2]=S*R+X*Y,B[3]=S*W+X*M,B}function z0(B){var J=n(),V=n(),I=n(),L=Math.sqrt(1-J),N=Math.sqrt(J);return B[0]=L*Math.sin(2*Math.PI*V),B[1]=L*Math.cos(2*Math.PI*V),B[2]=N*Math.sin(2*Math.PI*I),B[3]=N*Math.cos(2*Math.PI*I),B}function x0(B,J){var V=J[0],I=J[1],L=J[2],N=J[3],R=V*V+I*I+L*L+N*N,W=R?1/R:0;return B[0]=-V*W,B[1]=-I*W,B[2]=-L*W,B[3]=N*W,B}function m0(B,J){return B[0]=-J[0],B[1]=-J[1],B[2]=-J[2],B[3]=J[3],B}function eB(B,J){var V=J[0]+J[4]+J[8],I;if(V>0)I=Math.sqrt(V+1),B[3]=0.5*I,I=0.5/I,B[0]=(J[5]-J[7])*I,B[1]=(J[6]-J[2])*I,B[2]=(J[1]-J[3])*I;else{var L=0;if(J[4]>J[0])L=1;if(J[8]>J[L*3+L])L=2;var N=(L+1)%3,R=(L+2)%3;I=Math.sqrt(J[L*3+L]-J[N*3+N]-J[R*3+R]+1),B[L]=0.5*I,I=0.5/I,B[3]=(J[N*3+R]-J[R*3+N])*I,B[N]=(J[N*3+L]+J[L*3+N])*I,B[R]=(J[R*3+L]+J[L*3+R])*I}return B}function e0(B,J,V,I){var L=0.5*Math.PI/180;J*=L,V*=L,I*=L;var N=Math.sin(J),R=Math.cos(J),W=Math.sin(V),U=Math.cos(V),k=Math.sin(I),Y=Math.cos(I);return B[0]=N*U*Y-R*W*k,B[1]=R*W*Y+N*U*k,B[2]=R*U*k-N*W*Y,B[3]=R*U*Y+N*W*k,B}function b0(B){return"quat("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+")"}var u0=OB,o0=hB,a0=gB,t0=wB,BV=fB,JV=zB,bB=vB,uB=lB,VV=sB,oB=cB,IV=oB,aB=nB,LV=aB,RB=dB,NV=iB,RV=yB,WV=function(){var B=x(),J=m(1,0,0),V=m(0,1,0);return function(I,L,N){var R=e(L,N);if(R<-0.999999){if(z(B,J,L),LB(B)<0.000001)z(B,V,L);return IB(B,B),rB(I,B,Math.PI),I}else if(R>0.999999)return I[0]=0,I[1]=0,I[2]=0,I[3]=1,I;else return z(B,L,N),I[0]=B[0],I[1]=B[1],I[2]=B[2],I[3]=1+R,RB(I,I)}}(),UV=function(){var B=NB(),J=NB();return function(V,I,L,N,R,W){return b(B,I,R,W),b(J,L,N,W),b(V,B,J,2*W*(1-W)),V}}(),kV=function(){var B=QB();return function(J,V,I,L){return B[0]=I[0],B[3]=I[1],B[6]=I[2],B[1]=L[0],B[4]=L[1],B[7]=L[2],B[2]=-V[0],B[5]=-V[1],B[8]=-V[2],RB(J,eB(J,B))}}();class d{B;constructor(B){this.app=B;this.onStart&&B.onStart(this.onStart.bind(this)),this.onUpdate&&B.onUpdate(this.onUpdate.bind(this)),this.onAfterUpdate&&B.onAfterUpdate(this.onAfterUpdate.bind(this)),this.onBeforeUpdate&&B.onBeforeUpdate(this.onBeforeUpdate.bind(this)),this.onDraw&&B.onDraw(this.onDraw.bind(this))}}class c{B;J;V;constructor(B=s.create(),J=f.create(),V=s.fromValues(1,1,1)){this.position=B;this.rotation=J;this.scale=V}rotateEuler(B,J,V){return f.fromEuler(this.rotation,B,J,V),this}toMat4(){const B=g.create();return g.fromRotationTranslationScale(B,this.rotation,this.position,this.scale),B}}var u=(B)=>f.fromEuler(f.create(),B[0],B[1],B[2]),tB=(B)=>[B,B,B];class o extends d{B;J;V;I;L;N;projectionMatrix=g.create();buffers={textures:{}};faceDataType;colorDataType;constructor(B,J,V,I=new c([0,0,-6]),L=new c([100,100,0]),N={}){super(B);this.app=B;this.mesh=J;this.shader=V;this.camera=I;this.light=L;this.config=N;this.faceDataType=this.getDataType(J.config.faces),this.colorDataType=J.config.colors?this.getDataType(J.config.colors):null}getDataType(B){switch(B.BYTES_PER_ELEMENT){case 1:return 5121;case 2:return 5123;case 4:return 5125;default:return 5126}}configure(B){return this.config=B,this}makeBuffer(B,J=34962){const V=this.app.gl,I=V.createBuffer();if(!I)throw new Error("failed to create a buffer");return V.bindBuffer(J,I),V.bufferData(J,B,V.STATIC_DRAW),V.bindBuffer(J,null),I}initializeBuffers(){const B=this.app.gl.createVertexArray();if(!B)throw new Error("VAO creation failed");this.buffers.vao=B,this.app.gl.bindVertexArray(B),this.buffers.faces=this.makeBuffer(this.mesh.config.faces,this.app.gl.ELEMENT_ARRAY_BUFFER);const J=this.shader.mappings;if(this.buffers.position=this.makeBuffer(this.mesh.config.positions),this.bindAttrib(this.buffers.position,J.attributes.vertex,3,this.app.gl.FLOAT),this.mesh.config.normals)this.buffers.normal=this.makeBuffer(this.mesh.config.normals),this.bindAttrib(this.buffers.normal,J.attributes.normal,3,this.app.gl.FLOAT,!0);if(this.mesh.config.colors)this.buffers.color=this.makeBuffer(this.mesh.config.colors),this.bindAttrib(this.buffers.color,J.attributes.vertexColor,4,this.colorDataType||this.app.gl.UNSIGNED_BYTE);if(this.mesh.config.uvs)this.buffers.uv=this.makeBuffer(this.mesh.config.uvs),this.bindAttrib(this.buffers.uv,J.attributes.uv0,2,this.app.gl.FLOAT);this.app.gl.bindVertexArray(null)}async initializeTextures(){const{gl:B}=this.app;for(let[J,V]of Object.entries(this.shader.textures)){await V.loadImage();const I=B.createTexture();if(!I)throw new Error("failed to allocate texture");const L=V.texture;B.bindTexture(B.TEXTURE_2D,I),B.texImage2D(B.TEXTURE_2D,0,B.RGBA,V.width,V.height,0,B.RGBA,B.UNSIGNED_BYTE,L),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_S,B.REPEAT),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_T,B.REPEAT),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MAG_FILTER,B.NEAREST),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MIN_FILTER,B.NEAREST),this.buffers.textures[J]=I}}bindTextures(){const{gl:B}=this.app,J=this.app.gl.TEXTURE0,V=Object.entries(this.buffers.textures),I=[];return V.forEach(([L,N],R)=>{const W=this.shader.mappings.uniforms[L];if(!W)return console.warn("had no uniform to set for",{textures:V,key:L,tex:N,uniform:W,index:R}),!1;B.activeTexture(J+R),B.bindTexture(B.TEXTURE_2D,N),B.uniform1i(W,R),I.push(()=>{B.activeTexture(J+R),B.bindTexture(B.TEXTURE_2D,null)})}),I}bindAttrib(B,J,V,I,L=!1){const N=this.app.gl;N.bindBuffer(N.ARRAY_BUFFER,B);const R=Number.isSafeInteger(J)?J:this.shader.attrib(J);if(R!==-1)N.vertexAttribPointer(R,V,I,L,0,0),N.enableVertexAttribArray(R);N.bindBuffer(N.ARRAY_BUFFER,null)}initializeShader(B,J){const V=g.invert(g.create(),this.camera.toMat4()),I=this.app.gl,{uniforms:L}=this.shader.mappings;this.shader.use(),I.uniform1f(L.time,B),I.uniform4fv(L.light0Color,[1,1,1,1]),I.uniformMatrix4fv(L.view,!1,V),I.uniformMatrix4fv(L.projection,!1,this.projectionMatrix),I.uniform3fv(L.light0,this.light.position),I.uniformMatrix4fv(L.objectToWorld,!1,J.toMat4()),I.uniformMatrix4fv(L.objectToWorldInv,!1,g.invert(g.create(),J.toMat4()))}async onStart(B,J){J.loading("baking vectors"),J.telemetry?.addRenderers(1),J.telemetry?.addTriangles(this.mesh.config.faces.length),J.telemetry?.addVertexes(this.mesh.config.vertexCount),g.perspective(this.projectionMatrix,this.app.config.fov||45,this.app.aspect,this.app.config.zNear||0.1,this.app.config.zFar||100),this.shader.compile(),this.shader.link(),this.initializeBuffers(),this.shader.link(),await this.initializeTextures()}onRenderableUpdate(B,J){const V=this.app.gl;V.bindVertexArray(this.buffers.vao||null),V.bindBuffer(V.ELEMENT_ARRAY_BUFFER,this.buffers.faces||null),V.bindBuffer(V.ARRAY_BUFFER,this.buffers.position||null),this.initializeShader(B,J);const I=this.bindTextures();V.drawElements(this.config.drawMode??V.TRIANGLES,this.mesh.config.faces.length,this.faceDataType,0);const L=V.getError();if(L!==0)throw console.log({err:L}),new Error(`(MeshRenderer) webgl failure: ${L}`);V.bindVertexArray(null),V.bindBuffer(V.ELEMENT_ARRAY_BUFFER,null),V.bindBuffer(V.ARRAY_BUFFER,null),I.forEach((N)=>N())}}class WB extends d{B;el;frameTimes=[];maxFrameTimes=100;lastFrameTime=0;activeTriangles=0;activeVertexes=0;activeRenderers=0;activeTextures=0;constructor(B,J="#telemetry"){super(B);this.app=B;if(this.el=document.querySelector(J),this.el&&location.search.includes("telemetry"))this.el.style.display="block"}insertTime(B){if(this.frameTimes.push(B),this.frameTimes.length>this.maxFrameTimes)this.frameTimes.shift()}async onStart(){this.lastFrameTime=0,this.frameTimes=[],setTimeout(()=>this.setText(),0),setInterval(()=>{this.setText()},1001)}setText(){const B=this.frameTimes.reduce((V,I)=>V+I,0)/this.frameTimes.length,J=1000/B;this.el.innerHTML=`${J.toFixed(1)} FPS (${B.toFixed(3)} ms)
update :: b: ${this.app.registry.onBeforeUpdate.length} | u: ${this.app.registry.onUpdate.length} | a: ${this.app.registry.onAfterUpdate.length} | d: ${this.app.registry.onDraw.length}
render :: mr: ${this.activeRenderers} | v: ${this.activeVertexes} | t: ${this.activeTriangles}
others :: tex: ${this.activeTextures}`}onAfterUpdate(B){const J=B-this.lastFrameTime;this.insertTime(J),this.lastFrameTime=B}addTriangles(B){this.activeTriangles+=B}addVertexes(B){this.activeVertexes+=B}addRenderers(B){this.activeRenderers+=B}addTextures(B){this.activeTextures+=B}}class UB{B;canvas;telemetry;gl;loadingMessages=new Set(["[noeidelon] [stage 2]"]);registry={onBeforeUpdate:[],onAfterUpdate:[],onUpdate:[],onStart:[],onDraw:[]};constructor(B={}){this.config=B;try{this.canvas=document.querySelector("canvas"),this.canvas.width=window.innerWidth,this.canvas.height=window.innerHeight;const J=this.canvas.getContext("webgl2");if(!J)throw new Error("Canvas was unable to get a webgl2 context");const V=this.gl=J;if(V.viewport(0,0,V.drawingBufferWidth,V.drawingBufferHeight),this.gl.getExtension("EXT_texture_filter_anisotropic"),location.search.includes("telemetry"))this.telemetry=new WB(this)}catch(J){const V=document.querySelector("main");if(V)V.innerHTML="
your browser didn't let me set up webgl.
";throw new Error(`Unable to initialize WebGL. Your browser or machine may not support it.\n -> ${J}`)}}get aspect(){return this.canvas.clientWidth/this.canvas.clientHeight}clear(){const B=this.gl;B.clearColor(0,0,0,1),B.clearDepth(1),B.enable(B.DEPTH_TEST),B.depthFunc(B.LEQUAL),B.clear(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT)}loading(B){this.loadingMessages.add(B.toLowerCase()),document.querySelector("#loading-text").innerHTML=[...this.loadingMessages].join("
")}ready(){document.querySelector("#loading")?.classList.remove("loading-active")}onBeforeUpdate(B){this.registry.onBeforeUpdate.push(B)}onAfterUpdate(B){this.registry.onAfterUpdate.push(B)}onUpdate(B){this.registry.onUpdate.push(B)}onStart(B){this.registry.onStart.push(B)}onDraw(B){this.registry.onDraw.push(B)}doUpdate(B){this.registry.onBeforeUpdate.forEach((J)=>J(B,this)),this.registry.onUpdate.forEach((J)=>J(B,this)),this.registry.onAfterUpdate.forEach((J)=>J(B,this)),this.registry.onDraw.forEach((J)=>J(B,this))}async doStart(B=0){this.loading("setting launch parameters"),this.clear();try{for(let J of this.registry.onStart)await J(B,this)}catch(J){if(this.loading('[panic] failed to start noeidelon'),this.telemetry)this.loading(`${J}`);return}this.ready()}async oneShot(B=0){await this.doStart(B),this.doUpdate(B)}async start(){await this.doStart();const B=(J)=>{this.doUpdate(J),requestAnimationFrame(B)};requestAnimationFrame(B)}}class a extends d{B;J;V;constructor(B,J,V){super(B);this.app=B;this.transform=J;this.renderer=V}onDraw(B){this.renderer.onRenderableUpdate(B,this.transform)}}class kB{B;constructor(B){this.config=B}get name(){return this.config.name}}var t=new kB({colors:null,faces:new Uint8Array([0,1,2,1,0,3,0,2,4,0,4,5,0,5,3,1,3,6,2,1,7,4,2,8,9,10,11,12,9,13,1,6,7,2,7,8,10,8,11,9,11,13,12,13,6,7,6,14,8,7,14,11,8,14,13,11,14,6,13,14,15,16,17,17,16,18,19,20,21,18,16,22,22,16,15,23,24,25]),name:"src/meshes/trianglething/trianglething.ply",normals:new Float32Array([0,-1,0.00000083803394,-0.5257306,-0.44721383,0.723607,-0.8506533,-0.44721213,-0.2763879,0.5257306,-0.4472139,0.723607,0,-0.44721153,-0.89442825,0.8506533,-0.4472122,-0.27638793,0,0.44721153,0.89442825,-0.8506533,0.44721216,0.27638793,-0.5257306,0.4472139,-0.72360694,0.8506533,-0.4472122,-0.27638793,0,-0.44721153,-0.89442825,0.5257306,0.4472139,-0.72360694,0.5257306,-0.4472139,0.723607,0.85065323,0.4472122,0.2763879,0,1,-0.0000008165459,0.8999471,-0.43599886,0.00000024163015,-0.00000005150958,1,0,-0.000000030203772,-0.4359989,0.8999472,-0.8999471,-0.4359989,-0.00000024291313,-0.000000030203772,-0.4359989,0.8999472,0,-0.43599886,-0.8999471,0.8999471,-0.43599886,0.00000024163015,0,-0.43599886,-0.8999471,-0.000000030203772,-0.4359989,0.8999472,-0.8999471,-0.4359989,-0.00000024291313,0,-0.43599886,-0.8999471]),positions:new Float32Array([0,2.6090002,0,-0.36800402,2.9959497,0.50652003,-0.5954481,2.9959497,-0.19346952,0.36800402,2.9959497,0.50652003,0,2.9959497,-0.62609756,0.5954481,2.9959497,-0.19346952,0,3.6220508,0.62609756,-0.5954481,3.6220508,0.19346952,-0.36800402,3.6220508,-0.50652003,0.5954481,2.9959497,-0.19346952,0,2.9959497,-0.62609756,0.36800402,3.6220508,-0.50652003,0.36800402,2.9959497,0.50652003,0.5954481,3.6220508,0.19346952,0,4.0090003,0,1.0000001,0,0,0,2.5000002,0,-0.000000043711395,0,1.0000001,-1.0000001,0,-0.00000008742279,-0.000000043711395,0,1.0000001,0.000000011924882,0,-1.0000001,1.0000001,0,0,0.000000011924882,0,-1.0000001,-0.000000043711395,0,1.0000001,-1.0000001,0,-0.00000008742279,0.000000011924882,0,-1.0000001]),uvs:new Float32Array([0.7660872,0.5526656,0.6449925,0.52286637,0.8418907,0.33128682,0.60803074,0.79587877,0.96344936,0.40123126,0.8416727,0.64077806,0.50600564,0.49428308,0.704352,0.31297976,0.79145527,0.046412975,0.35179207,0.26814616,0.47356877,0.028599411,0.5382167,0.15491244,0.118150145,0.42324704,0.40614995,0.39580685,0.5992601,0.26365823,0.4984935,0.5027367,0.24900003,0.7522302,-0.00049349666,0.50273675,-0.00049346685,1.0017238,0.7633698,0.99398905,0.99752307,0.7598357,0.9975231,0.99398893,0.49849355,1.0017238,0.99646366,0.7612665,0.99646366,0.9954198,0.7623104,0.9954198]),vertexCount:26});var YB="../texture0-577d5216cdab32bc.png";var XB="../texture1-e472a46c91711e86.png";class l{B;static VERTEX=35633;static FRAGMENT=35632;constructor(B){this.config=B}vertexCode="";fragmentCode="";_app;program=null;mappings={};textures={};get gl(){const B=this._app?.gl;if(!B)throw new Error("GL context not defined at shader compile time.");return B}app(B){return this._app=B,this.program=B.gl.createProgram(),this}vertex(B){return this.vertexCode=B,this}fragment(B){return this.fragmentCode=B,this}attrib(B){return this.gl.getAttribLocation(this.program,B)}uniform(B){return this.gl.getUniformLocation(this.program,B)}generateMappings(B){return{attributes:{normal:this.attrib(B.attributes.normal),uv0:this.attrib(B.attributes.uv0),vertex:this.attrib(B.attributes.vertex),vertexColor:this.attrib(B.attributes.vertexColor)},uniforms:{albedo:this.uniform(B.uniforms.albedo),light0:this.uniform(B.uniforms.light0),light0Color:this.uniform(B.uniforms.light0Color),objectToWorld:this.uniform(B.uniforms.objectToWorld),objectToWorldInv:this.uniform(B.uniforms.objectToWorldInv),projection:this.uniform(B.uniforms.projection),texture0:this.uniform(B.uniforms.texture0),texture1:this.uniform(B.uniforms.texture1),time:this.uniform(B.uniforms.time),view:this.uniform(B.uniforms.view)}}}attach(B,J){const V=this.gl,I=V.createShader(B);if(!I)throw new Error(`failed to init ${MV(B)} shader`);V.shaderSource(I,J),V.compileShader(I),V.attachShader(this.program,I)}addTexture(B,J){return this.textures[B]=J,this}compile(){const B=this.gl;this.attach(B.FRAGMENT_SHADER,this.fragmentCode),this.attach(B.VERTEX_SHADER,this.vertexCode)}link(){if(this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))throw new Error("Unable to initialize the shader program: "+this.gl.getProgramInfoLog(this.program));this.mappings=this.generateMappings(this.config)}bindAttrib(B,J){this.gl.bindAttribLocation(this.program,B,J)}use(){this._app?.gl.useProgram(this.program)}}var MV=(B)=>{switch(B){case l.FRAGMENT:return"fragment";case l.VERTEX:return"vertex";default:return"some unknown type of"}};var BB=`#version 300 es +precision highp float;uniform sampler2D u_texture_0;uniform sampler2D u_texture_1;in vec2 uv0;in vec3 normal;in vec3 light_pos;out vec4 fragColor;void main(){vec4 normalTex=texture(u_texture_1,uv0);vec3 normal=normalize(normal*normalTex.xyz);float light=dot(normal,light_pos);fragColor=vec4(1.0);fragColor.rgb=texture(u_texture_0,uv0).rgb;fragColor.rgb*=max(light,0.1);fragColor.a=1.0;}`;var BJ=`#version 300 es +uniform mat4 u_view;uniform mat4 u_projection;uniform mat4 u_object_to_world;uniform mat4 u_object_to_world_inv;uniform vec3 u_light_0;in vec4 a_vertex;in vec2 a_uv0;in vec3 a_normal;in vec4 a_vertex_color;out vec2 uv0;out vec3 normal;out vec4 vertex_color;out vec3 light_pos;void main(){mat4 worldInv=inverse(u_view);mat4 MVW=u_projection*u_view*u_object_to_world;gl_Position=MVW*a_vertex;uv0=a_uv0;normal=normalize(mat3(worldInv)*a_normal);vertex_color=a_vertex_color;light_pos=normalize(mat3(u_object_to_world_inv)*u_light_0);}`;var SV={attributes:{vertex:"a_vertex",uv0:"a_uv0",normal:"a_normal",vertexColor:"a_vertex_color"},uniforms:{view:"u_view",projection:"u_projection",objectToWorld:"u_object_to_world",objectToWorldInv:"u_object_to_world_inv",light0:"u_light_0",light0Color:"u_light_0_color",time:"u_time",albedo:"u_albedo",texture0:"u_texture_0",texture1:"u_texture_1"}},JJ=(B)=>new l(SV).vertex(BJ).fragment(BB).app(B);class JB{B;J;texture=null;width=0;height=0;constructor(B,J){this.app=B;this.url=J}setImage(B,J,V){return this.texture=B,this.width=J,this.height=V,this}async loadImage(){if(this.app.telemetry?.addTextures(-1),this.app.loading("Fetching textures..."),this.url==="manual"){if(this.texture===null)throw new Error("manual specified, but texture was not ready...");return}const B=new Image;return new Promise((J,V)=>{B.onload=async()=>{this.texture=await createImageBitmap(B,{imageOrientation:"flipY"}),this.width=this.texture.width,this.height=this.texture.height,this.app.telemetry?.addTextures(2),J(void 0)},B.onerror=(I)=>{this.app.telemetry?.addTextures(1),V(new Error(`texture load of ${this.url} failed: ${I.toString()}`))},B.src=this.url})}}var VJ=`#version 300 es +uniform mat4 u_view;uniform mat4 u_projection;uniform mat4 u_object_to_world;uniform mat4 u_object_to_world_inv;uniform vec3 u_light_0;in vec4 a_vertex;in vec2 a_uv0;in vec3 a_normal;in vec4 a_vertex_color;out vec2 uv0;out vec3 normal;out vec4 vertex_color;out vec3 light_pos; +#define ROUNDING_FACTOR 230.0f +void main(){mat4 worldInv=inverse(u_view);mat4 MVW=u_projection*u_view*u_object_to_world;vec4 realPosition=MVW*a_vertex;realPosition.xyz=round(vec3(realPosition.xyz*ROUNDING_FACTOR))/ROUNDING_FACTOR;gl_Position=realPosition;uv0=a_uv0;normal=normalize(mat3(worldInv)*a_normal);vertex_color=a_vertex_color;light_pos=normalize(mat3(u_object_to_world_inv)*u_light_0);}`;var KV={attributes:{vertex:"a_vertex",uv0:"a_uv0",normal:"a_normal",vertexColor:"a_vertex_color"},uniforms:{view:"u_view",projection:"u_projection",objectToWorld:"u_object_to_world",objectToWorldInv:"u_object_to_world_inv",light0:"u_light_0",light0Color:"u_light_0_color",time:"u_time",albedo:"u_albedo",texture0:"u_texture_0",texture1:"u_texture_1"}},IJ=(B)=>new l(KV).vertex(VJ).fragment(BB).app(B);var v=new UB({fov:45}),LJ=new c([3,3,5],u([-15,40,0])),NJ=new c([1,1,0]),MB=new c(tB(0),u([0,0,0])),EB=new c([-3,0,1],u([0,0,0])),RJ=new JB(v,YB),WJ=new JB(v,XB);v.onUpdate(()=>{f.rotateY(MB.rotation,MB.rotation,0.001),f.rotateY(EB.rotation,EB.rotation,0.001)});new a(v,MB,new o(v,t,IJ(v).addTexture("texture0",RJ).addTexture("texture1",WJ),LJ,NJ).configure({}));new a(v,EB,new o(v,t,JJ(v).addTexture("texture0",RJ).addTexture("texture1",WJ),LJ,NJ).configure({}));v.start(); diff --git a/html/texture0-577d5216cdab32bc.png b/html/texture0-577d5216cdab32bc.png new file mode 100644 index 0000000..4635a2c Binary files /dev/null and b/html/texture0-577d5216cdab32bc.png differ diff --git a/html/texture1-e472a46c91711e86.png b/html/texture1-e472a46c91711e86.png new file mode 100644 index 0000000..377d94d Binary files /dev/null and b/html/texture1-e472a46c91711e86.png differ diff --git a/index.d.ts b/index.d.ts index c321ae3..4d2a951 100644 --- a/index.d.ts +++ b/index.d.ts @@ -30,3 +30,8 @@ declare module "*.md" { const content: string; export default content; } + +declare module "*.png" { + const path: string; + export default path; +} diff --git a/package.json b/package.json index 8a28ec2..4e1a814 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "ignore": [ "html/", "README.md", - "src/meshes/*.ts" + "src/meshes/**/*.ts" ], "delay": 1000, "exec": "bun run . --" diff --git a/src/003-scene/main.ts b/src/003-scene/main.ts index 0543292..549a620 100644 --- a/src/003-scene/main.ts +++ b/src/003-scene/main.ts @@ -3,9 +3,12 @@ import { WebGLApp } from "../renderer/webgl"; import { Renderable } from "../renderer/renderable"; import { Transform, etoq, v3 } from "../renderer/transform"; import { quat } from "gl-matrix"; -import trianglething from "../meshes/trianglething"; +import { trianglething, texture0, texture1 } from "../meshes/trianglething"; import teapot from "../meshes/teapot"; import { basic } from "../common-shaders/basic"; +import { Texture } from "../renderer/texture"; +import { errorShader } from "../common-shaders/error"; +import { basicVertexRounding } from "../common-shaders/basic-vertex-rounding"; const app = new WebGLApp({ fov: 45 }); @@ -13,21 +16,42 @@ const camera = new Transform([3, 3, 5], etoq([-15, 40, 0])); const light = new Transform([1, 1, 0]); const transform = new Transform(v3(0), etoq([0, 0, 0])); -const transform2 = new Transform([-2, 0, 1], etoq([0, 90 + 62, 0])); +const transform2 = new Transform([-3, 0, 1], etoq([0, 0, 0])); + +const trithingTexture = new Texture(app, texture0); +const trithingTextureNormals = new Texture(app, texture1); app.onUpdate(() => { quat.rotateY(transform.rotation, transform.rotation, 0.001); + quat.rotateY(transform2.rotation, transform2.rotation, 0.001); }); new Renderable( app, - transform2, - new MeshRenderer(app, trianglething, basic(app), camera, light).configure({}) + transform, + new MeshRenderer( + app, + trianglething, + basicVertexRounding(app) + .addTexture("texture0", trithingTexture) + .addTexture("texture1", trithingTextureNormals), + camera, + light + ).configure({}) ); + new Renderable( app, - transform, - new MeshRenderer(app, teapot, basic(app), camera, light).configure({}) + transform2, + new MeshRenderer( + app, + trianglething, + basic(app) + .addTexture("texture0", trithingTexture) + .addTexture("texture1", trithingTextureNormals), + camera, + light + ).configure({}) ); app.start(); diff --git a/src/common-shaders/basic-vertex-rounding.ts b/src/common-shaders/basic-vertex-rounding.ts new file mode 100644 index 0000000..bfdf1fb --- /dev/null +++ b/src/common-shaders/basic-vertex-rounding.ts @@ -0,0 +1,29 @@ +import { Shader, ShaderConfig } from "../renderer/shader"; +import { WebGLApp } from "../renderer/webgl"; +import frag from "./basic.frag"; +import vert from "./basic-vertex-rounding.vert"; + +export const basicShaderConfig: ShaderConfig = { + attributes: { + vertex: "a_vertex", + uv0: "a_uv0", + normal: "a_normal", + vertexColor: "a_vertex_color", + }, + + uniforms: { + view: "u_view", + projection: "u_projection", + objectToWorld: "u_object_to_world", + objectToWorldInv: "u_object_to_world_inv", + light0: "u_light_0", + light0Color: "u_light_0_color", + time: "u_time", + albedo: "u_albedo", + texture0: "u_texture_0", + texture1: "u_texture_1", + }, +}; + +export const basicVertexRounding = (app: WebGLApp) => + new Shader(basicShaderConfig).vertex(vert).fragment(frag).app(app); diff --git a/src/common-shaders/basic-vertex-rounding.vert b/src/common-shaders/basic-vertex-rounding.vert new file mode 100644 index 0000000..c46b22a --- /dev/null +++ b/src/common-shaders/basic-vertex-rounding.vert @@ -0,0 +1,35 @@ +#version 300 es +uniform mat4 u_view; +uniform mat4 u_projection; +uniform mat4 u_object_to_world; +uniform mat4 u_object_to_world_inv; +uniform vec3 u_light_0; +// uniform vec4 u_light_0_color; +// uniform float u_time; +// uniform vec4 u_albedo; + +in vec4 a_vertex; +in vec2 a_uv0; +in vec3 a_normal; +in vec4 a_vertex_color; + +out vec2 uv0; +out vec3 normal; +out vec4 vertex_color; +out vec3 light_pos; + +#define ROUNDING_FACTOR 230.0f + +void main() { + mat4 worldInv = inverse(u_view); + mat4 MVW = u_projection * u_view * u_object_to_world; + vec4 realPosition = MVW * a_vertex; + realPosition.xyz = round(vec3(realPosition.xyz * ROUNDING_FACTOR)) / ROUNDING_FACTOR; + gl_Position = realPosition; + + uv0 = a_uv0; + normal = normalize(mat3(worldInv) * a_normal); + vertex_color = a_vertex_color; + light_pos = normalize(mat3(u_object_to_world_inv) * u_light_0); + +} \ No newline at end of file diff --git a/src/common-shaders/basic.frag b/src/common-shaders/basic.frag index 66e8b56..7ab8758 100644 --- a/src/common-shaders/basic.frag +++ b/src/common-shaders/basic.frag @@ -10,19 +10,23 @@ precision highp float; // uniform float u_time; // uniform vec4 u_albedo; +uniform sampler2D u_texture_0; +uniform sampler2D u_texture_1; + in vec2 uv0; in vec3 normal; in vec3 light_pos; out vec4 fragColor; - void main() { - vec3 normal = normalize(normal); + vec4 normalTex = texture(u_texture_1, uv0); + vec3 normal = normalize(normal * normalTex.xyz); + float light = dot(normal, light_pos); - - fragColor = vec4(1.0); + fragColor.rgb = texture(u_texture_0, uv0).rgb; fragColor.rgb *= max(light, 0.1); + fragColor.a = 1.0; } diff --git a/src/meshes/trianglething.ply b/src/meshes/trianglething.ply deleted file mode 100644 index b86126b..0000000 --- a/src/meshes/trianglething.ply +++ /dev/null @@ -1,76 +0,0 @@ -ply -format ascii 1.0 -comment Created in Blender version 3.6.4 -element vertex 31 -property float x -property float y -property float z -property float nx -property float ny -property float nz -property uchar red -property uchar green -property uchar blue -property uchar alpha -property float s -property float t -element face 26 -property list uchar uint vertex_indices -end_header -0 2.609 0 0 -1 8.3803394e-07 0 1 255 255 0.00013659838 0.8180941 --0.368004 2.9959495 0.50652 -0.5257306 -0.44721383 0.723607 0 1 255 255 0.15755458 0.7272099 --0.595448 2.9959495 -0.19346951 -0.8506533 -0.44721213 -0.2763879 0 1 255 255 0.1575546 0.9089782 -0 2.609 0 0 -1 8.3803394e-07 0 1 255 255 0.00013659043 0.6363257 -0.368004 2.9959495 0.50652 0.5257306 -0.4472139 0.723607 0 1 255 255 0.15755458 0.54544157 -0 2.609 0 0 -1 8.3803394e-07 0 1 255 255 0.0001365666 0.09102075 --0.595448 2.9959495 -0.19346951 -0.8506533 -0.44721213 -0.2763879 0 1 255 255 0.15755455 0.00013656964 -0 2.9959495 -0.6260975 0 -0.44721153 -0.89442825 0 1 255 255 0.15755457 0.18190491 -0 2.609 0 0 -1 8.3803394e-07 0 1 255 255 0.00013657454 0.2727891 -0.595448 2.9959495 -0.19346951 0.8506533 -0.4472122 -0.27638793 0 1 255 255 0.15755457 0.36367324 -0 2.609 0 0 -1 8.3803394e-07 0 1 255 255 0.00013658249 0.45455742 -0 3.6220505 0.6260975 0 0.44721153 0.89442825 0 1 255 255 0.31497157 0.6363257 --0.595448 3.6220505 0.19346951 -0.8506533 0.44721216 0.27638793 0 1 255 255 0.31497157 0.8180941 --0.368004 3.6220505 -0.50652 -0.5257306 0.4472139 -0.72360694 0 1 255 255 0.31497154 0.09102073 -0.368004 3.6220505 -0.50652 0.5257306 0.4472139 -0.72360694 0 1 255 255 0.31497154 0.27278906 -0.595448 3.6220505 0.19346951 0.85065323 0.4472122 0.2763879 0 1 255 255 0.31497154 0.45455742 --0.368004 3.6220505 -0.50652 -0.5257306 0.4472139 -0.72360694 0 1 255 255 0.31497157 0.9998634 -0 4.0090003 0 0 1 -8.165459e-07 0 1 255 255 0.47238955 0.72720987 -0 4.0090003 0 0 1 -8.165459e-07 0 1 255 255 0.47238958 0.9089782 -0 4.0090003 0 0 1 -8.165459e-07 0 1 255 255 0.47238955 0.1819049 -0 4.0090003 0 0 1 -8.165459e-07 0 1 255 255 0.47238955 0.36367324 -0 4.0090003 0 0 1 -8.165459e-07 0 1 255 255 0.47238955 0.54544157 -1 0 0 0.8999471 -0.43599886 2.4163015e-07 0 1 255 255 0.8119813 0.33945516 -0 2.5 0 -5.150958e-08 1 0 0 1 255 255 0.642322 0.16979587 --4.3711392e-08 0 1 -3.0203772e-08 -0.4359989 0.8999472 0 1 255 255 0.8119813 0.00013659486 --1 0 -8.7422784e-08 -0.8999471 -0.4359989 -2.4291313e-07 0 1 255 255 0.47266275 0.00013660162 --4.3711392e-08 0 1 -3.0203772e-08 -0.4359989 0.8999472 0 1 255 255 0.81198126 0.6790469 -1.19248815e-08 0 -1 0 -0.43599886 -0.8999471 0 1 255 255 0.47266275 0.33972836 -1 0 0 0.8999471 -0.43599886 2.4163015e-07 0 1 255 255 0.47266272 0.6790469 -1.19248815e-08 0 -1 0 -0.43599886 -0.8999471 0 1 255 255 0.47266275 0.33945513 --1 0 -8.7422784e-08 -0.8999471 -0.4359989 -2.4291313e-07 0 1 255 255 0.81198126 0.3397284 -3 0 1 2 -3 1 3 4 -3 5 6 7 -3 8 7 9 -3 10 9 4 -3 1 4 11 -3 2 1 12 -3 7 6 13 -3 9 7 14 -3 4 9 15 -3 1 11 12 -3 2 12 16 -3 7 13 14 -3 9 14 15 -3 4 15 11 -3 12 11 17 -3 16 12 18 -3 14 13 19 -3 15 14 20 -3 11 15 21 -3 22 23 24 -3 24 23 25 -3 26 27 28 -3 25 23 29 -3 29 23 22 -3 26 30 27 diff --git a/src/meshes/trianglething.ts b/src/meshes/trianglething.ts deleted file mode 100644 index 99d8548..0000000 --- a/src/meshes/trianglething.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Mesh } from "../renderer/mesh"; - -// prettier-ignore -export default new Mesh({ - colors: new Uint8Array([0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255,0,1,255,255]), - faces: new Uint8Array([0,1,2,1,3,4,5,6,7,8,7,9,10,9,4,1,4,11,2,1,12,7,6,13,9,7,14,4,9,15,1,11,12,2,12,16,7,13,14,9,14,15,4,15,11,12,11,17,16,12,18,14,13,19,15,14,20,11,15,21,22,23,24,24,23,25,26,27,28,25,23,29,29,23,22,26,30,27]), - name: "src/meshes/trianglething.ply", - normals: new Float32Array([0,-1,8.3803394e-7,-0.5257306,-0.44721383,0.723607,-0.8506533,-0.44721213,-0.2763879,0,-1,8.3803394e-7,0.5257306,-0.4472139,0.723607,0,-1,8.3803394e-7,-0.8506533,-0.44721213,-0.2763879,0,-0.44721153,-0.89442825,0,-1,8.3803394e-7,0.8506533,-0.4472122,-0.27638793,0,-1,8.3803394e-7,0,0.44721153,0.89442825,-0.8506533,0.44721216,0.27638793,-0.5257306,0.4472139,-0.72360694,0.5257306,0.4472139,-0.72360694,0.85065323,0.4472122,0.2763879,-0.5257306,0.4472139,-0.72360694,0,1,-8.165459e-7,0,1,-8.165459e-7,0,1,-8.165459e-7,0,1,-8.165459e-7,0,1,-8.165459e-7,0.8999471,-0.43599886,2.4163015e-7,-5.150958e-8,1,0,-3.0203772e-8,-0.4359989,0.8999472,-0.8999471,-0.4359989,-2.4291313e-7,-3.0203772e-8,-0.4359989,0.8999472,0,-0.43599886,-0.8999471,0.8999471,-0.43599886,2.4163015e-7,0,-0.43599886,-0.8999471,-0.8999471,-0.4359989,-2.4291313e-7]), - positions: new Float32Array([0,2.609,0,-0.368004,2.9959495,0.50652,-0.595448,2.9959495,-0.19346951,0,2.609,0,0.368004,2.9959495,0.50652,0,2.609,0,-0.595448,2.9959495,-0.19346951,0,2.9959495,-0.6260975,0,2.609,0,0.595448,2.9959495,-0.19346951,0,2.609,0,0,3.6220505,0.6260975,-0.595448,3.6220505,0.19346951,-0.368004,3.6220505,-0.50652,0.368004,3.6220505,-0.50652,0.595448,3.6220505,0.19346951,-0.368004,3.6220505,-0.50652,0,4.0090003,0,0,4.0090003,0,0,4.0090003,0,0,4.0090003,0,0,4.0090003,0,1,0,0,0,2.5,0,-4.3711392e-8,0,1,-1,0,-8.7422784e-8,-4.3711392e-8,0,1,1.19248815e-8,0,-1,1,0,0,1.19248815e-8,0,-1,-1,0,-8.7422784e-8]), - uvs: new Float32Array([0.00013659838,0.8180941,0.15755458,0.7272099,0.1575546,0.9089782,0.00013659043,0.6363257,0.15755458,0.54544157,0.0001365666,0.09102075,0.15755455,0.00013656964,0.15755457,0.18190491,0.00013657454,0.2727891,0.15755457,0.36367324,0.00013658249,0.45455742,0.31497157,0.6363257,0.31497157,0.8180941,0.31497154,0.09102073,0.31497154,0.27278906,0.31497154,0.45455742,0.31497157,0.9998634,0.47238955,0.72720987,0.47238958,0.9089782,0.47238955,0.1819049,0.47238955,0.36367324,0.47238955,0.54544157,0.8119813,0.33945516,0.642322,0.16979587,0.8119813,0.00013659486,0.47266275,0.00013660162,0.81198126,0.6790469,0.47266275,0.33972836,0.47266272,0.6790469,0.47266275,0.33945513,0.81198126,0.3397284]), - vertexCount: 31 -}); diff --git a/src/meshes/trianglething/index.ts b/src/meshes/trianglething/index.ts new file mode 100644 index 0000000..f3bd934 --- /dev/null +++ b/src/meshes/trianglething/index.ts @@ -0,0 +1,5 @@ +import trianglething from "./trianglething"; +import texture0 from "./textures/texture0.png"; +import texture1 from "./textures/texture1.png"; + +export { trianglething, texture0, texture1 }; diff --git a/src/meshes/trianglething/textures/texture0.png b/src/meshes/trianglething/textures/texture0.png new file mode 100644 index 0000000..4635a2c Binary files /dev/null and b/src/meshes/trianglething/textures/texture0.png differ diff --git a/src/meshes/trianglething/textures/texture1.png b/src/meshes/trianglething/textures/texture1.png new file mode 100644 index 0000000..377d94d Binary files /dev/null and b/src/meshes/trianglething/textures/texture1.png differ diff --git a/src/meshes/trianglething/textures/uv-normals.xcf b/src/meshes/trianglething/textures/uv-normals.xcf new file mode 100644 index 0000000..6d70e17 Binary files /dev/null and b/src/meshes/trianglething/textures/uv-normals.xcf differ diff --git a/src/meshes/trianglething/textures/uv.png b/src/meshes/trianglething/textures/uv.png new file mode 100644 index 0000000..7c530d6 Binary files /dev/null and b/src/meshes/trianglething/textures/uv.png differ diff --git a/src/meshes/trianglething/textures/uv.xcf b/src/meshes/trianglething/textures/uv.xcf new file mode 100644 index 0000000..cc1b171 Binary files /dev/null and b/src/meshes/trianglething/textures/uv.xcf differ diff --git a/src/meshes/trianglething/trianglething.blend b/src/meshes/trianglething/trianglething.blend new file mode 100644 index 0000000..618f25d Binary files /dev/null and b/src/meshes/trianglething/trianglething.blend differ diff --git a/src/meshes/trianglething/trianglething.ply b/src/meshes/trianglething/trianglething.ply new file mode 100644 index 0000000..38ef3a9 --- /dev/null +++ b/src/meshes/trianglething/trianglething.ply @@ -0,0 +1,67 @@ +ply +format ascii 1.0 +comment Created in Blender version 3.6.4 +element vertex 26 +property float x +property float y +property float z +property float nx +property float ny +property float nz +property float s +property float t +element face 26 +property list uchar uint vertex_indices +end_header +0 2.6090002 0 0 -1 8.3803394e-07 0.7660872 0.5526656 +-0.36800402 2.9959497 0.50652003 -0.5257306 -0.44721383 0.723607 0.6449925 0.52286637 +-0.5954481 2.9959497 -0.19346952 -0.8506533 -0.44721213 -0.2763879 0.8418907 0.33128682 +0.36800402 2.9959497 0.50652003 0.5257306 -0.4472139 0.723607 0.60803074 0.79587877 +0 2.9959497 -0.62609756 0 -0.44721153 -0.89442825 0.96344936 0.40123126 +0.5954481 2.9959497 -0.19346952 0.8506533 -0.4472122 -0.27638793 0.8416727 0.64077806 +0 3.6220508 0.62609756 0 0.44721153 0.89442825 0.50600564 0.49428308 +-0.5954481 3.6220508 0.19346952 -0.8506533 0.44721216 0.27638793 0.704352 0.31297976 +-0.36800402 3.6220508 -0.50652003 -0.5257306 0.4472139 -0.72360694 0.79145527 0.046412975 +0.5954481 2.9959497 -0.19346952 0.8506533 -0.4472122 -0.27638793 0.35179207 0.26814616 +0 2.9959497 -0.62609756 0 -0.44721153 -0.89442825 0.47356877 0.028599411 +0.36800402 3.6220508 -0.50652003 0.5257306 0.4472139 -0.72360694 0.5382167 0.15491244 +0.36800402 2.9959497 0.50652003 0.5257306 -0.4472139 0.723607 0.118150145 0.42324704 +0.5954481 3.6220508 0.19346952 0.85065323 0.4472122 0.2763879 0.40614995 0.39580685 +0 4.0090003 0 0 1 -8.165459e-07 0.5992601 0.26365823 +1.0000001 0 0 0.8999471 -0.43599886 2.4163015e-07 0.4984935 0.5027367 +0 2.5000002 0 -5.150958e-08 1 0 0.24900003 0.7522302 +-4.3711395e-08 0 1.0000001 -3.0203772e-08 -0.4359989 0.8999472 -0.00049349666 0.50273675 +-1.0000001 0 -8.742279e-08 -0.8999471 -0.4359989 -2.4291313e-07 -0.00049346685 1.0017238 +-4.3711395e-08 0 1.0000001 -3.0203772e-08 -0.4359989 0.8999472 0.7633698 0.99398905 +1.1924882e-08 0 -1.0000001 0 -0.43599886 -0.8999471 0.99752307 0.7598357 +1.0000001 0 0 0.8999471 -0.43599886 2.4163015e-07 0.9975231 0.99398893 +1.1924882e-08 0 -1.0000001 0 -0.43599886 -0.8999471 0.49849355 1.0017238 +-4.3711395e-08 0 1.0000001 -3.0203772e-08 -0.4359989 0.8999472 0.99646366 0.7612665 +-1.0000001 0 -8.742279e-08 -0.8999471 -0.4359989 -2.4291313e-07 0.99646366 0.9954198 +1.1924882e-08 0 -1.0000001 0 -0.43599886 -0.8999471 0.7623104 0.9954198 +3 0 1 2 +3 1 0 3 +3 0 2 4 +3 0 4 5 +3 0 5 3 +3 1 3 6 +3 2 1 7 +3 4 2 8 +3 9 10 11 +3 12 9 13 +3 1 6 7 +3 2 7 8 +3 10 8 11 +3 9 11 13 +3 12 13 6 +3 7 6 14 +3 8 7 14 +3 11 8 14 +3 13 11 14 +3 6 13 14 +3 15 16 17 +3 17 16 18 +3 19 20 21 +3 18 16 22 +3 22 16 15 +3 23 24 25 diff --git a/src/meshes/trianglething/trianglething.ts b/src/meshes/trianglething/trianglething.ts new file mode 100644 index 0000000..df2ecd3 --- /dev/null +++ b/src/meshes/trianglething/trianglething.ts @@ -0,0 +1,12 @@ +import { Mesh } from "../../renderer/mesh"; + +// prettier-ignore +export default new Mesh({ + colors: null, + faces: new Uint8Array([0,1,2,1,0,3,0,2,4,0,4,5,0,5,3,1,3,6,2,1,7,4,2,8,9,10,11,12,9,13,1,6,7,2,7,8,10,8,11,9,11,13,12,13,6,7,6,14,8,7,14,11,8,14,13,11,14,6,13,14,15,16,17,17,16,18,19,20,21,18,16,22,22,16,15,23,24,25]), + name: "src/meshes/trianglething/trianglething.ply", + normals: new Float32Array([0,-1,8.3803394e-7,-0.5257306,-0.44721383,0.723607,-0.8506533,-0.44721213,-0.2763879,0.5257306,-0.4472139,0.723607,0,-0.44721153,-0.89442825,0.8506533,-0.4472122,-0.27638793,0,0.44721153,0.89442825,-0.8506533,0.44721216,0.27638793,-0.5257306,0.4472139,-0.72360694,0.8506533,-0.4472122,-0.27638793,0,-0.44721153,-0.89442825,0.5257306,0.4472139,-0.72360694,0.5257306,-0.4472139,0.723607,0.85065323,0.4472122,0.2763879,0,1,-8.165459e-7,0.8999471,-0.43599886,2.4163015e-7,-5.150958e-8,1,0,-3.0203772e-8,-0.4359989,0.8999472,-0.8999471,-0.4359989,-2.4291313e-7,-3.0203772e-8,-0.4359989,0.8999472,0,-0.43599886,-0.8999471,0.8999471,-0.43599886,2.4163015e-7,0,-0.43599886,-0.8999471,-3.0203772e-8,-0.4359989,0.8999472,-0.8999471,-0.4359989,-2.4291313e-7,0,-0.43599886,-0.8999471]), + positions: new Float32Array([0,2.6090002,0,-0.36800402,2.9959497,0.50652003,-0.5954481,2.9959497,-0.19346952,0.36800402,2.9959497,0.50652003,0,2.9959497,-0.62609756,0.5954481,2.9959497,-0.19346952,0,3.6220508,0.62609756,-0.5954481,3.6220508,0.19346952,-0.36800402,3.6220508,-0.50652003,0.5954481,2.9959497,-0.19346952,0,2.9959497,-0.62609756,0.36800402,3.6220508,-0.50652003,0.36800402,2.9959497,0.50652003,0.5954481,3.6220508,0.19346952,0,4.0090003,0,1.0000001,0,0,0,2.5000002,0,-4.3711395e-8,0,1.0000001,-1.0000001,0,-8.742279e-8,-4.3711395e-8,0,1.0000001,1.1924882e-8,0,-1.0000001,1.0000001,0,0,1.1924882e-8,0,-1.0000001,-4.3711395e-8,0,1.0000001,-1.0000001,0,-8.742279e-8,1.1924882e-8,0,-1.0000001]), + uvs: new Float32Array([0.7660872,0.5526656,0.6449925,0.52286637,0.8418907,0.33128682,0.60803074,0.79587877,0.96344936,0.40123126,0.8416727,0.64077806,0.50600564,0.49428308,0.704352,0.31297976,0.79145527,0.046412975,0.35179207,0.26814616,0.47356877,0.028599411,0.5382167,0.15491244,0.118150145,0.42324704,0.40614995,0.39580685,0.5992601,0.26365823,0.4984935,0.5027367,0.24900003,0.7522302,-0.00049349666,0.50273675,-0.00049346685,1.0017238,0.7633698,0.99398905,0.99752307,0.7598357,0.9975231,0.99398893,0.49849355,1.0017238,0.99646366,0.7612665,0.99646366,0.9954198,0.7623104,0.9954198]), + vertexCount: 26 +}); diff --git a/src/renderer/mesh-renderer.ts b/src/renderer/mesh-renderer.ts index b8128f6..9f8dd00 100644 --- a/src/renderer/mesh-renderer.ts +++ b/src/renderer/mesh-renderer.ts @@ -20,7 +20,8 @@ export class MeshRenderer extends Behavior { normal?: WebGLBuffer; color?: WebGLBuffer; faces?: WebGLBuffer; - } = {}; + textures: Record; + } = { textures: {} }; faceDataType: number; colorDataType: number | null; @@ -130,6 +131,72 @@ export class MeshRenderer extends Behavior { this.app.gl.bindVertexArray(null); } + async initializeTextures() { + const { gl } = this.app; + + for (const [name, textureObject] of Object.entries(this.shader.textures)) { + await textureObject.loadImage(); + const glTex = gl.createTexture(); + if (!glTex) { + throw new Error("failed to allocate texture"); + } + const tex = textureObject.texture as ImageBitmap; + gl.bindTexture(gl.TEXTURE_2D, glTex); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + textureObject.width, + textureObject.height, + 0, + gl.RGBA, + gl.UNSIGNED_BYTE, + tex + ); + + // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); + + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + + this.buffers.textures[name] = glTex; + } + } + + bindTextures() { + const { gl } = this.app; + const intStart = this.app.gl.TEXTURE0; + const textures = Object.entries(this.buffers.textures); + const destructors: (() => void)[] = []; + + textures.forEach(([key, tex], index) => { + const uniform = (this.shader.mappings.uniforms as any)[key]; + if (!uniform) { + console.warn("had no uniform to set for", { + textures, + key, + tex, + uniform, + index, + }); + return false; + } + + gl.activeTexture(intStart + index); + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.uniform1i(uniform, index); + + destructors.push(() => { + gl.activeTexture(intStart + index); + gl.bindTexture(gl.TEXTURE_2D, null); + }); + }); + + return destructors; + } + bindAttrib( buffer: WebGLBuffer, attribute: string | number, @@ -178,7 +245,7 @@ export class MeshRenderer extends Behavior { ); } - onStart(_: never, app: WebGLApp) { + async onStart(_: never, app: WebGLApp) { app.loading("baking vectors"); app.telemetry?.addRenderers(1); app.telemetry?.addTriangles(this.mesh.config.faces.length); @@ -196,6 +263,8 @@ export class MeshRenderer extends Behavior { this.shader.link(); this.initializeBuffers(); this.shader.link(); + + await this.initializeTextures(); } onRenderableUpdate(time: number, transform: Transform) { @@ -206,7 +275,7 @@ export class MeshRenderer extends Behavior { gl.bindBuffer(gl.ARRAY_BUFFER, this.buffers.position || null); this.initializeShader(time, transform); - + const textureDestructors = this.bindTextures(); gl.drawElements( this.config.drawMode ?? gl.TRIANGLES, this.mesh.config.faces.length, @@ -225,5 +294,11 @@ export class MeshRenderer extends Behavior { gl.bindVertexArray(null); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); gl.bindBuffer(gl.ARRAY_BUFFER, null); + + textureDestructors.forEach((i) => i()); } } + +const isPowerOfTwo = (x: number) => { + return (x & (x - 1)) === 0; +}; diff --git a/src/renderer/shader.ts b/src/renderer/shader.ts index 398d8ae..0a85fde 100644 --- a/src/renderer/shader.ts +++ b/src/renderer/shader.ts @@ -1,3 +1,4 @@ +import { Texture } from "./texture"; import { WebGLApp } from "./webgl"; /** @@ -47,6 +48,7 @@ export class Shader { private _app?: WebGLApp; public program: WebGLProgram | null = null; public mappings: InternalMapping = {} as any; + public textures: Record = {}; get gl() { const gl = this._app?.gl; @@ -118,6 +120,12 @@ export class Shader { gl.attachShader(this.program as WebGLProgram, shader); } + /// Slot must be the name of the relevant uniform pointer, e.g. texture0 + addTexture(slot: string, texture: Texture) { + this.textures[slot] = texture; + return this; + } + compile() { const gl = this.gl; this.attach(gl.FRAGMENT_SHADER, this.fragmentCode); diff --git a/src/renderer/telemetry.ts b/src/renderer/telemetry.ts index 56d8363..25e7128 100644 --- a/src/renderer/telemetry.ts +++ b/src/renderer/telemetry.ts @@ -9,6 +9,7 @@ export class Telemetry extends Behavior { public activeTriangles: number = 0; public activeVertexes: number = 0; public activeRenderers: number = 0; + public activeTextures: number = 0; constructor( public app: WebGLApp, @@ -55,7 +56,9 @@ export class Telemetry extends Behavior { this.app.registry.onAfterUpdate.length } | d: ${this.app.registry.onDraw.length}
render :: mr: ${ this.activeRenderers - } | v: ${this.activeVertexes} | t: ${this.activeTriangles}`; + } | v: ${this.activeVertexes} | t: ${ + this.activeTriangles + }
others :: tex: ${this.activeTextures}`; } onAfterUpdate(time: number) { @@ -75,4 +78,8 @@ export class Telemetry extends Behavior { addRenderers(n: number) { this.activeRenderers += n; } + + addTextures(n: number) { + this.activeTextures += n; + } } diff --git a/src/renderer/texture.ts b/src/renderer/texture.ts index 658a2e9..b6a4b21 100644 --- a/src/renderer/texture.ts +++ b/src/renderer/texture.ts @@ -1,17 +1,73 @@ import { Behavior } from "./behavior"; import { WebGLApp } from "./webgl"; -export class Texture extends Behavior { - public texture: Uint8Array | null = null; +export class Texture { + public texture: ImageBitmap | Uint8Array | null = null; + public width: number = 0; + public height: number = 0; constructor( public app: WebGLApp, public url: string - ) { - super(app); + ) {} + + setImage(data: Uint8Array, width: number, height: number) { + this.texture = data; + this.width = width; + this.height = height; + return this; } - async onStart(_: never, app: WebGLApp) { - app.loading("Fetching textures..."); + async loadImage() { + this.app.telemetry?.addTextures(-1); + this.app.loading("Fetching textures..."); + + if (this.url === "manual") { + if (this.texture === null) { + throw new Error("manual specified, but texture was not ready..."); + } + return; + } + + const image = new Image(); + return new Promise((resolve, reject) => { + image.onload = async () => { + this.texture = await createImageBitmap(image, { + imageOrientation: "flipY", + }); + this.width = this.texture.width; + this.height = this.texture.height; + this.app.telemetry?.addTextures(2); + resolve(void 0); + }; + + image.onerror = (e) => { + this.app.telemetry?.addTextures(1); + reject( + new Error(`texture load of ${this.url} failed: ${e.toString()}`) + ); + }; + + image.src = this.url; + }); } } + +export const White = (app: WebGLApp) => + new Texture(app, "manual").setImage( + new Uint8Array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]), + 2, + 2 + ); +export const Black = (app: WebGLApp) => + new Texture(app, "manual").setImage( + new Uint8Array([0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1]), + 2, + 2 + ); +export const WhyBroke = (app: WebGLApp) => + new Texture(app, "manual").setImage( + new Uint8Array([1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1]), + 2, + 2 + ); diff --git a/src/renderer/webgl.ts b/src/renderer/webgl.ts index 1d9ea2f..4bd0f2b 100644 --- a/src/renderer/webgl.ts +++ b/src/renderer/webgl.ts @@ -46,6 +46,7 @@ export class WebGLApp { gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); // this.gl.getExtension("OES_element_index_uint"); // default + this.gl.getExtension("EXT_texture_filter_anisotropic"); if (location.search.includes("telemetry")) { this.telemetry = new Telemetry(this);