-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHollowMarthenModel.gltf
1 lines (1 loc) · 21.4 KB
/
HollowMarthenModel.gltf
1
{"buffers":[{"uri":"data:application/octet-stream;base64,AACgQgAAIEIAAAAAAACgQgAAIMIAAAAAAACgQgAAIEIAAAAAAACgQgAAIMIAAAAAVnGBQgAAIEJeFzxCVnGBQgAAIMJeFzxCVnGBQgAAIEJeFzxCVnGBQgAAIMJeFzxCWMXFQQAAIEJGK5hCWMXFQQAAIMJGK5hCWMXFQQAAIEJGK5hCWMXFQQAAIMJGK5hCWMXFwQAAIEJGK5hCWMXFwQAAIMJGK5hCWMXFwQAAIEJGK5hCWMXFwQAAIMJGK5hCVnGBwgAAIEJeFzxCVnGBwgAAIMJeFzxCVnGBwgAAIEJeFzxCVnGBwgAAIMJeFzxCAACgwgAAIEJ+fTAoAACgwgAAIMJ+fTAoAACgwgAAIEJ+fTAoAACgwgAAIMJ+fTAoVnGBwgAAIEJeFzzCVnGBwgAAIMJeFzzCVnGBwgAAIEJeFzzCVnGBwgAAIMJeFzzCWMXFwQAAIEJGK5jCWMXFwQAAIMJGK5jCWMXFwQAAIEJGK5jCWMXFwQAAIMJGK5jCWMXFQQAAIEJGK5jCWMXFQQAAIMJGK5jCWMXFQQAAIEJGK5jCWMXFQQAAIMJGK5jCVnGBQgAAIEJeFzzCVnGBQgAAIMJeFzzCVnGBQgAAIEJeFzzCVnGBQgAAIMJeFzzCAACgQgAAIEJ+fbCoAACgQgAAIMJ+fbCoAACgQgAAIEJ+fbCoAACgQgAAIMJ+fbCoAAAEAAEAAQAEAAUAAgADAAYAAwAHAAYAAAACAAQAAgAGAAQAAQAFAAMAAwAFAAcABAAIAAUABQAIAAkABgAHAAoABwALAAoABAAGAAgABgAKAAgABQAJAAcABwAJAAsACAAMAAkACQAMAA0ACgALAA4ACwAPAA4ACAAKAAwACgAOAAwACQANAAsACwANAA8ADAAQAA0ADQAQABEADgAPABIADwATABIADAAOABAADgASABAADQARAA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AAcXhzPwAAAAB6N54+TxtePwAAAABEmP4+cXhzPwAAAAB6N54+cXhzPwAAAAB6N54+TxtePwAAAABEmP4+pbM9PwAAAAAi5is/cXhzvwAAAAB6N56+cXhzvwAAAAB6N56+TxtevwAAAABEmP6+cXhzvwAAAAB6N56+pbM9vwAAAAAi5iu/TxtevwAAAABEmP6+cXhzPwAAAAB6N54+cXhzvwAAAAB6N56+TxtePwAAAABEmP4+cXhzvwAAAAB6N56+TxtevwAAAABEmP6+TxtePwAAAABEmP4+cXhzPwAAAAB6N54+pbM9PwAAAAAi5is/cXhzvwAAAAB6N56+cXhzvwAAAAB6N56+pbM9PwAAAAAi5is/pbM9vwAAAAAi5iu/TxtePwAAAABEmP4+prrRPgAAAABqiWk/pbM9PwAAAAAi5is/pbM9PwAAAAAi5is/prrRPgAAAABqiWk/prpRPgAAAAC0kno/TxtevwAAAABEmP6+pbM9vwAAAAAi5iu/prrRvgAAAABqiWm/pbM9vwAAAAAi5iu/prpRvgAAAAC0knq/prrRvgAAAABqiWm/TxtePwAAAABEmP4+TxtevwAAAABEmP6+prrRPgAAAABqiWk/TxtevwAAAABEmP6+prrRvgAAAABqiWm/prrRPgAAAABqiWk/pbM9PwAAAAAi5is/prpRPgAAAAC0kno/pbM9vwAAAAAi5iu/pbM9vwAAAAAi5iu/prpRPgAAAAC0kno/prpRvgAAAAC0knq/prrRPgAAAABqiWk/prpRvgAAAAC0kno/prpRPgAAAAC0kno/prpRPgAAAAC0kno/prpRvgAAAAC0kno/prrRvgAAAABqiWk/prrRvgAAAABqiWm/prpRvgAAAAC0knq/prpRPgAAAAC0knq/prpRvgAAAAC0knq/prrRPgAAAABqiWm/prpRPgAAAAC0knq/prrRPgAAAABqiWk/prrRvgAAAABqiWm/prpRvgAAAAC0kno/prrRvgAAAABqiWm/prpRPgAAAAC0knq/prpRvgAAAAC0kno/prpRPgAAAAC0kno/prrRvgAAAABqiWk/prpRvgAAAAC0knq/prpRvgAAAAC0knq/prrRvgAAAABqiW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/+IJ+PwAAAACwhdw9+IJ+PwAAAACwhdw9pbM9vwAAAAAi5iu/pbM9PwAAAAAi5is/TxtevwAAAABEmP6+prrRvgAAAABqiWm/pbM9vwAAAAAi5iu/pbM9vwAAAAAi5iu/prrRvgAAAABqiWm/prpRvgAAAAC0knq/TxtePwAAAABEmP4+pbM9PwAAAAAi5is/prrRPgAAAABqiWk/pbM9PwAAAAAi5is/prpRPgAAAAC0kno/prrRPgAAAABqiWk/TxtevwAAAABEmP6+TxtePwAAAABEmP4+prrRvgAAAABqiWm/TxtePwAAAABEmP4+prrRPgAAAABqiWk/prrRvgAAAABqiWm/pbM9vwAAAAAi5iu/prpRvgAAAAC0knq/pbM9PwAAAAAi5is/pbM9PwAAAAAi5is/prpRvgAAAAC0knq/prpRPgAAAAC0kno/prrRvgAAAABqiWm/prpRPgAAAAC0knq/prpRvgAAAAC0knq/prpRvgAAAAC0knq/prpRPgAAAAC0knq/prrRPgAAAABqiWm/prrRPgAAAABqiWk/prpRPgAAAAC0kno/prpRvgAAAAC0kno/prpRPgAAAAC0kno/prrRvgAAAABqiWk/prpRvgAAAAC0kno/prrRvgAAAABqiWm/prrRPgAAAABqiWk/prpRPgAAAAC0knq/prrRPgAAAABqiWk/prpRvgAAAAC0kno/prpRPgAAAAC0knq/prpRvgAAAAC0knq/prrRPgAAAABqiWm/prpRPgAAAAC0kno/prpRPgAAAAC0kno/prrRPgAAAABqiWm/prrRvgAAAABqiWk/prpRPgAAAAC0knq/pbM9PwAAAAAi5iu/prrRPgAAAABqiWm/prrRPgAAAABqiWm/pbM9PwAAAAAi5iu/TxtePwAAAABEmP6+prpRvgAAAAC0kno/prrRvgAAAABqiWk/pbM9vwAAAAAi5is/prrRvgAAAABqiWk/TxtevwAAAABEmP4+pbM9vwAAAAAi5is/prpRPgAAAAC0knq/prpRvgAAAAC0kno/pbM9PwAAAAAi5iu/prpRvgAAAAC0kno/pbM9vwAAAAAi5is/pbM9PwAAAAAi5iu/prrRPgAAAABqiWm/TxtePwAAAABEmP6+prrRvgAAAABqiWk/prrRvgAAAABqiWk/TxtePwAAAABEmP6+TxtevwAAAABEmP4+pbM9PwAAAAAi5iu/cXhzPwAAAAB6N56+TxtePwAAAABEmP6+TxtePwAAAABEmP6+cXhzPwAAAAB6N56+cXhzPwAAAAB6N56+pbM9vwAAAAAi5is/TxtevwAAAABEmP4+cXhzvwAAAAB6N54+TxtevwAAAABEmP4+cXhzvwAAAAB6N54+cXhzvwAAAAB6N54+pbM9PwAAAAAi5iu/pbM9vwAAAAAi5is/cXhzPwAAAAB6N56+pbM9vwAAAAAi5is/cXhzvwAAAAB6N54+cXhzPwAAAAB6N56+TxtePwAAAABEmP6+cXhzPwAAAAB6N56+TxtevwAAAABEmP4+TxtevwAAAABEmP4+cXhzPwAAAAB6N56+cXhzvwAAAAB6N54+","byteLength":6768}],"bufferViews":[{"buffer":0,"byteOffset":0,"byteLength":528,"target":34962},{"buffer":0,"byteOffset":1008,"byteLength":2880,"target":34962},{"buffer":0,"byteOffset":3888,"byteLength":2880,"target":34962},{"buffer":0,"byteOffset":528,"byteLength":480,"target":34963}],"accessors":[{"bufferView":0,"byteOffset":0,"componentType":5126,"count":44,"type":"VEC3","max":[],"min":[]},{"bufferView":1,"byteOffset":0,"componentType":5126,"count":240,"type":"VEC3","max":[],"min":[]},{"bufferView":2,"byteOffset":0,"componentType":5126,"count":240,"type":"VEC3","max":[],"min":[]},{"bufferView":3,"byteOffset":0,"componentType":5123,"count":240,"type":"SCALAR","max":[],"min":[]}],"samplers":[],"images":[],"textures":[],"materials":[{"type":"Basic Material","name":"Cylinder","vertexShader":"\n#define PI 3.1415926535897932384626433832795\nattribute vec4 a_position;\n\nuniform mat4 u_worldMatrix;\nuniform mat4 u_viewMatrix;\nuniform vec4 u_color;\n\nvarying vec4 v_color;\n\nvoid main() { \n gl_Position = u_viewMatrix * u_worldMatrix * a_position;\n v_color = u_color;\n}\n","fragmentShader":"\nprecision highp float;\nvarying vec4 v_color;\n\nvoid main() {\n gl_FragColor = v_color / 255.0;\n}\n","uniforms":{"color":[52,25,0,255]}},{"type":"Phong Material","name":"Cylinder-phong","vertexShader":"\nprecision mediump float;\n\nattribute vec3 a_position;\nattribute vec3 a_faceNormal;\nattribute vec3 a_vertexNormal;\nattribute vec2 a_displacementUV;\nattribute vec2 a_diffuseUV;\nattribute vec2 a_specularUV;\nattribute vec2 a_normalUV;\nattribute vec3 a_tangent;\nattribute vec3 a_bitangent;\n\nuniform mat4 u_worldMatrix;\nuniform mat4 u_viewMatrix;\nuniform sampler2D u_displacementMap;\nuniform float u_displacementScale;\nuniform float u_displacementBias;\n\nvarying vec3 normalSurface;\nvarying vec3 vertexPosition;\nvarying vec2 diffuseUV;\nvarying vec2 specularUV;\nvarying mat3 v_tbn;\nvarying vec2 v_texcoord;\nvarying vec3 v_pos;\n\nvoid main() {\n vec4 displacement = texture2D(u_displacementMap, a_displacementUV);\n\n vec4 displacementVector = normalize(vec4(a_vertexNormal.xyz, 0.0)) * (displacement.r * u_displacementScale + u_displacementBias);\n\n vec4 vertexPosition4 = u_worldMatrix * (vec4(a_position, 1.0) + displacementVector);\n vertexPosition = vec3(vertexPosition4) / vertexPosition4.w;\n normalSurface = (u_viewMatrix * u_worldMatrix * vec4(a_faceNormal, 1.0)).xyz;\n diffuseUV = a_diffuseUV;\n specularUV = a_specularUV;\n \n vec3 T = normalize(vec3(u_worldMatrix * vec4(a_tangent, 0.0)));\n vec3 B = normalize(vec3(u_worldMatrix * vec4(a_bitangent, 0.0)));\n \n vec3 normalTemp = cross(a_tangent, a_bitangent);\n vec3 N = normalize(vec3(u_worldMatrix * vec4(normalTemp, 0.0)));\n\n v_tbn = mat3(T, B, N);\n v_texcoord = a_normalUV;\n v_pos = a_position;\n \n gl_Position = u_viewMatrix * vertexPosition4;\n}\n","fragmentShader":"\nprecision mediump float;\n\n// Tecture sampler\nuniform sampler2D u_diffuseMap;\nuniform sampler2D u_specularMap;\nuniform sampler2D u_normalMap;\nuniform bool u_hasNormalMap;\nuniform float u_hasDiffuseMap;\nuniform float u_hasSpecularMap;\n\n// Material uniform\nuniform float u_shininess;\nuniform vec4 u_ambientColor;\nuniform vec4 u_diffuseColor;\nuniform vec4 u_specularColor;\n\n// Light uniform\nuniform int u_numLights;\n\n// Light properties\nuniform float u_lightType_0;\nuniform vec3 u_lightPosition_0;\nuniform vec4 u_lightColor_0;\nuniform vec4 u_lightAmbient_0;\nuniform vec4 u_lightDiffuse_0;\nuniform vec4 u_lightSpecular_0;\nuniform vec3 u_lightTarget_0;\nuniform float u_lightConstant_0;\nuniform float u_lightLinear_0;\nuniform float u_lightQuadratic_0;\n\nuniform float u_lightType_1;\nuniform vec3 u_lightPosition_1;\nuniform vec4 u_lightColor_1;\nuniform vec4 u_lightAmbient_1;\nuniform vec4 u_lightDiffuse_1;\nuniform vec4 u_lightSpecular_1;\nuniform vec3 u_lightTarget_1;\nuniform float u_lightConstant_1;\nuniform float u_lightLinear_1;\nuniform float u_lightQuadratic_1;\n\nuniform float u_mode;\n\nvarying vec3 normalSurface;\nvarying vec3 vertexPosition;\nvarying vec2 diffuseUV;\nvarying vec2 specularUV;\n\nvarying mat3 v_tbn;\nvarying vec2 v_texcoord;\n\nvoid main() {\n vec3 N;\n \n if (u_hasNormalMap) {\n N = texture2D(u_normalMap, v_texcoord).rgb;\n N = N * 2.0 - 1.0;\n N = normalize(v_tbn * N);\n } else {\n N = normalize(normalSurface);\n }\n \n vec3 finalAmbient = vec3(0.0);\n vec3 finalDiffuse = vec3(0.0);\n vec3 finalSpecular = vec3(0.0);\n\n // Convert colors from 0-255 to 0-1\n vec3 ambientColor = u_ambientColor.rgb / 255.0;\n vec3 diffuseColor = u_diffuseColor.rgb / 255.0;\n vec3 specularColor = u_specularColor.rgb / 255.0;\n\n for (int i = 0; i < 2; i++) {\n vec3 L;\n if (i == 0 && u_lightType_0 == 0.0) {\n // Directional Light\n L = normalize(u_lightTarget_0 - vertexPosition);\n } else if (i == 1 && u_lightType_1 == 0.0) {\n // Directional Light\n L = normalize(u_lightTarget_1 - vertexPosition);\n } else if (i == 0 && u_lightType_0 == 1.0) {\n // Point Light\n L = normalize(u_lightPosition_0 - vertexPosition);\n } else {\n // Point Light\n L = normalize(u_lightPosition_1 - vertexPosition);\n }\n\n vec3 lightAmbient = (i == 0) ? (u_lightAmbient_0.rgb / 255.0) : (u_lightAmbient_1.rgb / 255.0);\n vec3 lightDiffuse = (i == 0) ? (u_lightDiffuse_0.rgb / 255.0) : (u_lightDiffuse_1.rgb / 255.0);\n vec3 lightSpecular = (i == 0) ? (u_lightSpecular_0.rgb / 255.0) : (u_lightSpecular_1.rgb / 255.0);\n\n // Lambert's cosine law\n float lambertian = max(dot(N, L), 0.0);\n float specular = 0.0;\n if (lambertian > 0.0) {\n vec3 R = reflect(-L, N); // Reflected light vector\n vec3 V = normalize(-vertexPosition); // Vector to viewer\n \n // Compute the specular term\n float specAngle = max(dot(R, V), 0.0);\n specular = pow(specAngle, u_shininess);\n }\n\n // Directional light calculation\n vec3 directionalAmbient = lightAmbient * ambientColor;\n vec3 directionalDiffuse = lightDiffuse * lambertian * diffuseColor;\n vec3 directionalSpecular = lightSpecular * specular * specularColor;\n\n // Point light calculation 1\n float distance1 = length(u_lightPosition_0 - vertexPosition);\n float attenuation1 = 1.0 / (u_lightConstant_0 + u_lightLinear_0 * distance1 + u_lightQuadratic_0 * distance1 * distance1);\n\n vec3 pointAmbient1 = attenuation1 * lightAmbient * ambientColor;\n vec3 pointDiffuse1 = attenuation1 * lightDiffuse * lambertian * diffuseColor;\n vec3 pointSpecular1 = attenuation1 * lightSpecular * specular * specularColor;\n\n // Point light calculation 2\n float distance2 = length(u_lightPosition_1 - vertexPosition);\n float attenuation2 = 1.0 / (u_lightConstant_1 + u_lightLinear_1 * distance2 + u_lightQuadratic_1 * distance2 * distance2);\n\n vec3 pointAmbient2 = attenuation2 * lightAmbient * ambientColor;\n vec3 pointDiffuse2 = attenuation2 * lightDiffuse * lambertian * diffuseColor;\n vec3 pointSpecular2 = attenuation2 * lightSpecular * specular * specularColor;\n\n // Processing by u_mode\n // Mode 1 : 1st Directional, 2nd Point\n if (u_mode == 1.0) {\n if (i == 0) {\n finalAmbient += directionalAmbient;\n finalDiffuse += directionalDiffuse;\n finalSpecular += directionalSpecular;\n } else if (i == 1) {\n finalAmbient += pointAmbient2;\n finalDiffuse += pointDiffuse2;\n finalSpecular += pointSpecular2;\n }\n }\n // Mode 2 : 1st Point, 2nd Directional\n else if (u_mode == 2.0) {\n if (i == 0) {\n finalAmbient += pointAmbient1;\n finalDiffuse += pointDiffuse1;\n finalSpecular += pointSpecular1;\n } else if (i == 1) {\n finalAmbient += directionalAmbient;\n finalDiffuse += directionalDiffuse;\n finalSpecular += directionalSpecular;\n }\n }\n // Mode 3 : 1st Directional, 2nd None\n else if (u_mode == 3.0 && i == 0) {\n finalAmbient += directionalAmbient;\n finalDiffuse += directionalDiffuse;\n finalSpecular += directionalSpecular;\n }\n // Mode 4 : 1st Point, 2nd None\n else if (u_mode == 4.0) {\n finalAmbient += pointAmbient1;\n finalDiffuse += pointAmbient1;\n finalSpecular += pointAmbient1;\n }\n }\n\n // Using texture sampler\n vec3 fixedDiffuse = finalDiffuse;\n if (u_hasDiffuseMap == 1.0) {\n fixedDiffuse = fixedDiffuse * texture2D(u_diffuseMap, diffuseUV).rgb;\n }\n\n vec3 fixedSpecular = finalSpecular;\n\n if (u_hasSpecularMap == 1.0) {\n fixedSpecular = finalSpecular * texture2D(u_specularMap, specularUV).rgb;\n }\n\n vec3 finalColor = finalAmbient + fixedDiffuse + fixedSpecular;\n gl_FragColor = vec4(finalColor, 1.0);\n \n}\n","uniforms":{"ambientColor":[52,25,0,255],"diffuseColor":[204,102,0,255],"specularColor":[255,255,255,255],"shininess":60,"diffuseMaps":[],"normalMaps":[],"displacementMaps":[],"specularMaps":[],"diffuseMap":-1,"normalMap":-1,"displacementMap":-1,"specularMap":-1}}],"meshes":[{"primitives":[{"attributes":{"POSITION":0,"FACE_NORMAL":1,"VERTEX_NORMAL":2},"basicMaterial":0,"phongMaterial":1,"indices":3}]}],"cameras":[],"lights":[],"nodes":[{"id":"18f9b58f-540b-4f01-91fc-5c0a53b4a361","name":"Cylinder","translation":[10,10,10],"rotation":[0.24999999999999997,0.24999999999999997,0.06698729810778066,0.9330127018922194],"scale":[1,1,1],"children":[],"mesh":0}],"scenes":[{"nodes":[0],"activeCamera":-1,"activeLight":[-1]}],"animations":[{"name":"cylinder-rotation","frames":[{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[0,0,0]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[10,10,10]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[20,20,20]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[30,30,30]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[40,40,40]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[50,50,50]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[60,60,60]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[70,70,70]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[80,80,80]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[90,90,90]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[100,100,100]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[110,110,110]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[120,120,120]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[130,130,130]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[140,140,140]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[150,150,150]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[160,160,160]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[170,170,170]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[180,180,180]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[190,190,190]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[200,200,200]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[210,210,210]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[220,220,220]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[230,230,230]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[240,240,240]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[250,250,250]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[260,260,260]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[270,270,270]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[280,280,280]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[290,290,290]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[300,300,300]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[310,310,310]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[320,320,320]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[330,330,330]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[340,340,340]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[350,350,350]}}]},{"nodeKeyframePairs":[{"node":0,"keyframe":{"rotation":[360,360,360]}}]}]}],"scene":0}