|
@@ -178,7 +178,7 @@ B.geometries[l];if(n.type=="cube"){I=new THREE.CubeGeometry(n.width,n.height,n.d
|
|
|
n.heightSegs);M.geometries[l]=I}else if(n.type=="torus"){I=new THREE.TorusGeometry(n.radius,n.tube,n.segmentsR,n.segmentsT);M.geometries[l]=I}else if(n.type=="icosahedron"){I=new THREE.IcosahedronGeometry(n.radius,n.subdivisions);M.geometries[l]=I}else if(n.type=="bin_mesh")c.load(d(n.url,B.urlBaseType),f(l));else if(n.type=="ascii_mesh")G.load(d(n.url,B.urlBaseType),f(l));else if(n.type=="embedded_mesh"){n=B.embeds[n.id];n.metadata=B.metadata;n&&G.createModel(n,g(l),"")}}for(q in B.textures){l=B.textures[q];
|
|
|
if(l.url instanceof Array){D=D+l.url.length;for(n=0;n<l.url.length;n++)i.onLoadStart()}else{D=D+1;i.onLoadStart()}}P=D;for(q in B.textures){l=B.textures[q];if(l.mapping!=void 0&&THREE[l.mapping]!=void 0)l.mapping=new THREE[l.mapping];if(l.url instanceof Array){n=[];for(X=0;X<l.url.length;X++)n[X]=d(l.url[X],B.urlBaseType);n=THREE.ImageUtils.loadTextureCube(n,l.mapping,a)}else{n=THREE.ImageUtils.loadTexture(d(l.url,B.urlBaseType),l.mapping,a);if(THREE[l.minFilter]!=void 0)n.minFilter=THREE[l.minFilter];
|
|
|
if(THREE[l.magFilter]!=void 0)n.magFilter=THREE[l.magFilter];if(l.repeat){n.repeat.set(l.repeat[0],l.repeat[1]);if(l.repeat[0]!=1)n.wrapS=THREE.RepeatWrapping;if(l.repeat[1]!=1)n.wrapT=THREE.RepeatWrapping}l.offset&&n.offset.set(l.offset[0],l.offset[1]);if(l.wrap){X={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(X[l.wrap[0]]!==void 0)n.wrapS=X[l.wrap[0]];if(X[l.wrap[1]]!==void 0)n.wrapT=X[l.wrap[1]]}}M.textures[q]=n}for(o in B.materials){u=B.materials[o];for(H in u.parameters)if(H==
|
|
|
-"envMap"||H=="map"||H=="lightMap")u.parameters[H]=M.textures[u.parameters[H]];else if(H=="shading")u.parameters[H]=u.parameters[H]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(H=="blending")u.parameters[H]=THREE[u.parameters[H]]?THREE[u.parameters[H]]:THREE.NormalBlending;else if(H=="combine")u.parameters[H]=u.parameters[H]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(H=="vertexColors")if(u.parameters[H]=="face")u.parameters[H]=THREE.FaceColors;else if(u.parameters[H])u.parameters[H]=
|
|
|
+"envMap"||H=="map"||H=="lightMap")u.parameters[H]=M.textures[u.parameters[H]];else if(H=="shading")u.parameters[H]=u.parameters[H]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(H=="blending")u.parameters[H]=u.parameters[H]in THREE?THREE[u.parameters[H]]:THREE.NormalBlending;else if(H=="combine")u.parameters[H]=u.parameters[H]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(H=="vertexColors")if(u.parameters[H]=="face")u.parameters[H]=THREE.FaceColors;else if(u.parameters[H])u.parameters[H]=
|
|
|
THREE.VertexColors;if(u.parameters.opacity!==void 0&&u.parameters.opacity<1)u.parameters.transparent=true;if(u.parameters.normalMap){q=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(q.uniforms);l=u.parameters.color;n=u.parameters.specular;X=u.parameters.ambient;c=u.parameters.shininess;a.tNormal.texture=M.textures[u.parameters.normalMap];if(u.parameters.normalMapFactor)a.uNormalScale.value=u.parameters.normalMapFactor;if(u.parameters.map){a.tDiffuse.texture=u.parameters.map;a.enableDiffuse.value=
|
|
|
true}if(u.parameters.lightMap){a.tAO.texture=u.parameters.lightMap;a.enableAO.value=true}if(u.parameters.specularMap){a.tSpecular.texture=M.textures[u.parameters.specularMap];a.enableSpecular.value=true}a.uDiffuseColor.value.setHex(l);a.uSpecularColor.value.setHex(n);a.uAmbientColor.value.setHex(X);a.uShininess.value=c;if(u.parameters.opacity)a.uOpacity.value=u.parameters.opacity;N=new THREE.ShaderMaterial({fragmentShader:q.fragmentShader,vertexShader:q.vertexShader,uniforms:a,lights:true,fog:true})}else N=
|
|
|
new THREE[u.type](u.parameters);M.materials[o]=N}e();i.callbackSync(M);h()};THREE.TextureLoader=function(){THREE.EventTarget.call(this);this.crossOrigin=null};
|