planet/docs/main.js

2 lines
116 KiB
JavaScript
Raw Permalink Normal View History

2020-01-19 06:18:43 +00:00
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=16)}([function(e,t,r){e.exports=r.p+"dcbe4e47e8a4cb4c76f00dc2ca584ea3.bin"},function(e,t){e.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},function(e,t,r){e.exports=r.p+"8c72ff38eff4b3d878b6e59563fb2558.bin"},function(e,t,r){e.exports=r.p+"c40f782b6d48c16bbdfa867a67914314.bin"},function(e,t,r){e.exports=r.p+"670398984b2a839f0da3039cd8ae215a.bin"},function(e,t,r){e.exports=r.p+"4cc86edf6517c35dd8aecdbf6a4b1a2e.bin"},function(e,t,r){e.exports=r.p+"aad316ae2f3185e637764ab20f4536ee.bin"},function(e,t,r){e.exports=r.p+"c5d1e42d1b2c2960ef12ca75b5e71fc1.bin"},function(e,t,r){e.exports=r.p+"80e3348d39fbc859dfe0bb2cda08c5b1.bin"},function(e,t,r){e.exports=r.p+"8ab0cc172cd882ef6b69422eaa5a502d.bin"},function(e,t,r){e.exports=r.p+"88a1fb4d8c42c36a027c7ab503de7511.bin"},function(e,t,r){e.exports=r.p+"a7a417e76651f9fa75e63e45e22095e6.bin"},function(e,t,r){e.exports=r.p+"b8f9c879c9c795656294aa401ac3854c.bin"},function(e,t,r){e.exports=r.p+"5293ee29e3db7bbd05f03823aa9bd53a.bin"},function(e,t,r){e.exports=r.p+"6f2d59ca82e22144ee26889cc862912f.bin"},function(e,t,r){e.exports=r.p+"f988ae2257d2f750090c9bda21c58f10.bin"},function(e,t,r){"use strict";r.r(t);var n=r(2),a=r.n(n),i=r(3),o=r.n(i),f=r(4),u=r.n(f),s=r(5),c=r.n(s),l=r(0),d=r.n(l),m=r(6),p=r.n(m),h=r(7),b=r.n(h),v=r(8),g=r.n(v),y=r(9),x=r.n(y),w=r(10),k=r.n(w),_=r(11),A=r.n(_),S=r(12),E=r.n(S),T=r(13),j=r.n(T),D=r(14),O=r.n(D),C=r(15),F=r.n(C);const z={hexsphere_0:a.a,hexsphere_1:o.a,hexsphere_2:u.a,hexsphere_3:c.a,hexsphere_4:d.a,hexsphere_5:p.a,hexsphere_6:b.a,icosahedron_0:g.a,icosahedron_1:x.a,icosahedron_2:k.a,icosahedron_3:A.a,icosahedron_4:E.a,icosahedron_5:j.a,icosahedron_6:O.a,icosahedron_7:F.a},L=r(17)({extensions:["OES_element_index_uint"]}),M=r(18)(L,{center:[0,0,0],distance:3});let P=null;const B=e=>{fetch(e).then(e=>e.arrayBuffer()).then(e=>{let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);const a={positions:new Float32Array(e,8,3*r),normals:new Float32Array(e,12*r+8,3*r),colors:new Float32Array(e,24*r+8,3*r),cells:new Uint32Array(e,36*r+8,3*n)};P=(e=>L({vert:"\n precision mediump float;\n uniform mat4 projection, view;\n attribute vec3 position, normal, color;\n varying vec3 fragNormal, fragPosition, fragColor;\n void main() {\n fragNormal = normal;\n fragPosition = position;\n fragColor = color;\n gl_Position = projection * view * vec4(position, 1.0);\n }",frag:"\n precision mediump float;\n struct Light {\n vec3 color;\n vec3 position;\n };\n uniform Light lights[1];\n varying vec3 fragNormal, fragPosition, fragColor;\n void main() {\n vec3 normal = normalize(fragNormal);\n vec3 light = vec3(0.1, 0.1, 0.1);\n for (int i = 0; i < 1; i++) {\n vec3 lightDir = normalize(lights[i].position - fragPosition);\n float diffuse = max(0.0, dot(lightDir, normal));\n light += diffuse * lights[i].color;\n }\n gl_FragColor = vec4(fragColor * light, 1.0);\n }",attributes:{position:e.positions,normal:e.normals,color:e.colors},elements:e.cells,uniforms:{"lights[0].color":[1,1,1],"lights[0].position":({tick:e})=>{const t=.
//# sourceMappingURL=main.js.map