|
@@ -245,7 +245,7 @@ Aa=new THREE.Vector3,k,Za,Gb,Wa,pb,cb,a=16;k=document.createElement("canvas");k.
|
|
2);l.width=m;l.height=n;Sa.set(-p,-r,p,r);Ea.set(-p,-r,p,r);x=1;t=0;A=E=C=z=w=null};this.setClearColor=function(a,b){q.copy(a);s=b!==void 0?b:1;Ea.set(-p,-r,p,r)};this.setClearColorHex=function(a,b){q.setHex(a);s=b!==void 0?b:1;Ea.set(-p,-r,p,r)};this.clear=function(){o.setTransform(1,0,0,-1,p,r);if(Ea.isEmpty()===false){Ea.minSelf(Sa);Ea.inflate(2);s<1&&o.clearRect(Math.floor(Ea.getX()),Math.floor(Ea.getY()),Math.floor(Ea.getWidth()),Math.floor(Ea.getHeight()));if(s>0){c(THREE.NormalBlending);b(1);
|
|
2);l.width=m;l.height=n;Sa.set(-p,-r,p,r);Ea.set(-p,-r,p,r);x=1;t=0;A=E=C=z=w=null};this.setClearColor=function(a,b){q.copy(a);s=b!==void 0?b:1;Ea.set(-p,-r,p,r)};this.setClearColorHex=function(a,b){q.setHex(a);s=b!==void 0?b:1;Ea.set(-p,-r,p,r)};this.clear=function(){o.setTransform(1,0,0,-1,p,r);if(Ea.isEmpty()===false){Ea.minSelf(Sa);Ea.inflate(2);s<1&&o.clearRect(Math.floor(Ea.getX()),Math.floor(Ea.getY()),Math.floor(Ea.getWidth()),Math.floor(Ea.getHeight()));if(s>0){c(THREE.NormalBlending);b(1);
|
|
e("rgba("+Math.floor(q.r*255)+","+Math.floor(q.g*255)+","+Math.floor(q.b*255)+","+s+")");o.fillRect(Math.floor(Ea.getX()),Math.floor(Ea.getY()),Math.floor(Ea.getWidth()),Math.floor(Ea.getHeight()))}Ea.empty()}};this.render=function(a,l){function m(a){var b,c,d,e;ra.setRGB(0,0,0);Ga.setRGB(0,0,0);Ta.setRGB(0,0,0);b=0;for(c=a.length;b<c;b++){d=a[b];e=d.color;if(d instanceof THREE.AmbientLight){ra.r=ra.r+e.r;ra.g=ra.g+e.g;ra.b=ra.b+e.b}else if(d instanceof THREE.DirectionalLight){Ga.r=Ga.r+e.r;Ga.g=
|
|
e("rgba("+Math.floor(q.r*255)+","+Math.floor(q.g*255)+","+Math.floor(q.b*255)+","+s+")");o.fillRect(Math.floor(Ea.getX()),Math.floor(Ea.getY()),Math.floor(Ea.getWidth()),Math.floor(Ea.getHeight()))}Ea.empty()}};this.render=function(a,l){function m(a){var b,c,d,e;ra.setRGB(0,0,0);Ga.setRGB(0,0,0);Ta.setRGB(0,0,0);b=0;for(c=a.length;b<c;b++){d=a[b];e=d.color;if(d instanceof THREE.AmbientLight){ra.r=ra.r+e.r;ra.g=ra.g+e.g;ra.b=ra.b+e.b}else if(d instanceof THREE.DirectionalLight){Ga.r=Ga.r+e.r;Ga.g=
|
|
Ga.g+e.g;Ga.b=Ga.b+e.b}else if(d instanceof THREE.PointLight){Ta.r=Ta.r+e.r;Ta.g=Ta.g+e.g;Ta.b=Ta.b+e.b}}}function n(a,b,c,d){var e,f,g,h,k,i;e=0;for(f=a.length;e<f;e++){g=a[e];h=g.color;if(g instanceof THREE.DirectionalLight){k=g.matrixWorld.getPosition();i=c.dot(k);if(!(i<=0)){i=i*g.intensity;d.r=d.r+h.r*i;d.g=d.g+h.g*i;d.b=d.b+h.b*i}}else if(g instanceof THREE.PointLight){k=g.matrixWorld.getPosition();i=c.dot(Aa.sub(k,b).normalize());if(!(i<=0)){i=i*(g.distance==0?1:1-Math.min(b.distanceTo(k)/
|
|
Ga.g+e.g;Ga.b=Ga.b+e.b}else if(d instanceof THREE.PointLight){Ta.r=Ta.r+e.r;Ta.g=Ta.g+e.g;Ta.b=Ta.b+e.b}}}function n(a,b,c,d){var e,f,g,h,k,i;e=0;for(f=a.length;e<f;e++){g=a[e];h=g.color;if(g instanceof THREE.DirectionalLight){k=g.matrixWorld.getPosition();i=c.dot(k);if(!(i<=0)){i=i*g.intensity;d.r=d.r+h.r*i;d.g=d.g+h.g*i;d.b=d.b+h.b*i}}else if(g instanceof THREE.PointLight){k=g.matrixWorld.getPosition();i=c.dot(Aa.sub(k,b).normalize());if(!(i<=0)){i=i*(g.distance==0?1:1-Math.min(b.distanceTo(k)/
|
|
-g.distance,1));if(i!=0){i=i*g.intensity;d.r=d.r+h.r*i;d.g=d.g+h.g*i;d.b=d.b+h.b*i}}}}}function q(a,f,g){b(g.opacity);c(g.blending);var h,k,i,j,l,m;if(g instanceof THREE.ParticleBasicMaterial){if(g.map===null){i=f.object.scale.x;j=f.object.scale.y;i=i*f.scale.x*p;j=j*f.scale.y*r;ta.set(a.x-i,a.y-j,a.x+i,a.y+j);if(Sa.intersects(ta)===false)return;e(g.color.getContextStyle());o.save();o.translate(a.x,a.y);o.rotate(-f.rotation);o.scale(i,j);o.fillRect(-1,-1,1,1)}else{g=g.map.image;l=g.width>>1;m=g.height>>
|
|
|
|
|
|
+g.distance,1));if(i!=0){i=i*g.intensity;d.r=d.r+h.r*i;d.g=d.g+h.g*i;d.b=d.b+h.b*i}}}}}function q(a,f,g){b(g.opacity);c(g.blending);var h,k,i,j,l,m;if(g instanceof THREE.ParticleBasicMaterial){if(g.map===null){i=f.object.scale.x;j=f.object.scale.y;i=i*f.scale.x*p;j=j*f.scale.y*r;ta.set(a.x-i,a.y-j,a.x+i,a.y+j);if(Sa.intersects(ta)===false)return;e(g.color.getContextStyle());o.save();o.translate(a.x,a.y);o.rotate(-f.rotation);o.scale(i,j);o.fillRect(-1,-1,2,2)}else{g=g.map.image;l=g.width>>1;m=g.height>>
|
|
1;i=f.scale.x*p;j=f.scale.y*r;h=i*l;k=j*m;ta.set(a.x-h,a.y-k,a.x+h,a.y+k);if(Sa.intersects(ta)===false)return;o.save();o.translate(a.x,a.y);o.rotate(-f.rotation);o.scale(i,-j);o.translate(-l,-m);o.drawImage(g,0,0)}o.restore()}else if(g instanceof THREE.ParticleCanvasMaterial){h=f.scale.x*p;k=f.scale.y*r;ta.set(a.x-h,a.y-k,a.x+h,a.y+k);if(Sa.intersects(ta)!==false){d(g.color.getContextStyle());e(g.color.getContextStyle());o.save();o.translate(a.x,a.y);o.rotate(-f.rotation);o.scale(h,k);g.program(o);
|
|
1;i=f.scale.x*p;j=f.scale.y*r;h=i*l;k=j*m;ta.set(a.x-h,a.y-k,a.x+h,a.y+k);if(Sa.intersects(ta)===false)return;o.save();o.translate(a.x,a.y);o.rotate(-f.rotation);o.scale(i,-j);o.translate(-l,-m);o.drawImage(g,0,0)}o.restore()}else if(g instanceof THREE.ParticleCanvasMaterial){h=f.scale.x*p;k=f.scale.y*r;ta.set(a.x-h,a.y-k,a.x+h,a.y+k);if(Sa.intersects(ta)!==false){d(g.color.getContextStyle());e(g.color.getContextStyle());o.save();o.translate(a.x,a.y);o.rotate(-f.rotation);o.scale(h,k);g.program(o);
|
|
o.restore()}}}function s(a,e,f,g){b(g.opacity);c(g.blending);o.beginPath();o.moveTo(a.positionScreen.x,a.positionScreen.y);o.lineTo(e.positionScreen.x,e.positionScreen.y);o.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(C!==a)C=o.lineWidth=a;a=g.linecap;if(E!==a)E=o.lineCap=a;a=g.linejoin;if(A!==a)A=o.lineJoin=a;d(g.color.getContextStyle());o.stroke();ta.inflate(g.linewidth*2)}}function t(a,d,e,g,h,k,j,m){f.info.render.vertices=f.info.render.vertices+3;f.info.render.faces++;
|
|
o.restore()}}}function s(a,e,f,g){b(g.opacity);c(g.blending);o.beginPath();o.moveTo(a.positionScreen.x,a.positionScreen.y);o.lineTo(e.positionScreen.x,e.positionScreen.y);o.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(C!==a)C=o.lineWidth=a;a=g.linecap;if(E!==a)E=o.lineCap=a;a=g.linejoin;if(A!==a)A=o.lineJoin=a;d(g.color.getContextStyle());o.stroke();ta.inflate(g.linewidth*2)}}function t(a,d,e,g,h,k,j,m){f.info.render.vertices=f.info.render.vertices+3;f.info.render.faces++;
|
|
b(m.opacity);c(m.blending);B=a.positionScreen.x;G=a.positionScreen.y;Q=d.positionScreen.x;F=d.positionScreen.y;ba=e.positionScreen.x;X=e.positionScreen.y;x(B,G,Q,F,ba,X);if(m instanceof THREE.MeshBasicMaterial)if(m.map!==null){if(m.map.mapping instanceof THREE.UVMapping){bb=j.uvs[0];kd(B,G,Q,F,ba,X,bb[g].u,bb[g].v,bb[h].u,bb[h].v,bb[k].u,bb[k].v,m.map)}}else if(m.envMap!==null){if(m.envMap.mapping instanceof THREE.SphericalReflectionMapping){a=l.matrixWorldInverse;Aa.copy(j.vertexNormalsWorld[g]);
|
|
b(m.opacity);c(m.blending);B=a.positionScreen.x;G=a.positionScreen.y;Q=d.positionScreen.x;F=d.positionScreen.y;ba=e.positionScreen.x;X=e.positionScreen.y;x(B,G,Q,F,ba,X);if(m instanceof THREE.MeshBasicMaterial)if(m.map!==null){if(m.map.mapping instanceof THREE.UVMapping){bb=j.uvs[0];kd(B,G,Q,F,ba,X,bb[g].u,bb[g].v,bb[h].u,bb[h].v,bb[k].u,bb[k].v,m.map)}}else if(m.envMap!==null){if(m.envMap.mapping instanceof THREE.SphericalReflectionMapping){a=l.matrixWorldInverse;Aa.copy(j.vertexNormalsWorld[g]);
|
|
@@ -664,7 +664,7 @@ a.vertices[g].y,g=a.vertices[g].z,m=a.vertices[h].x,n=a.vertices[h].y,a=a.vertic
|
|
THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
|
|
THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
|
|
THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);for(var b=b||12,c=c||2*Math.PI,d=[],e=(new THREE.Matrix4).makeRotationZ(c/b),f=0;f<a.length;f++){d[f]=a[f].clone();this.vertices.push(d[f])}for(var g=b+1,c=0;c<g;c++)for(f=0;f<d.length;f++){d[f]=e.multiplyVector3(d[f].clone());this.vertices.push(d[f])}for(c=0;c<b;c++){d=0;for(e=a.length;d<e-1;d++){this.faces.push(new THREE.Face4(c*e+d,(c+1)%g*e+d,(c+1)%g*e+(d+1)%e,c*e+(d+1)%e));this.faceVertexUvs[0].push([new THREE.UV(1-c/b,d/e),new THREE.UV(1-
|
|
THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);for(var b=b||12,c=c||2*Math.PI,d=[],e=(new THREE.Matrix4).makeRotationZ(c/b),f=0;f<a.length;f++){d[f]=a[f].clone();this.vertices.push(d[f])}for(var g=b+1,c=0;c<g;c++)for(f=0;f<d.length;f++){d[f]=e.multiplyVector3(d[f].clone());this.vertices.push(d[f])}for(c=0;c<b;c++){d=0;for(e=a.length;d<e-1;d++){this.faces.push(new THREE.Face4(c*e+d,(c+1)%g*e+d,(c+1)%g*e+(d+1)%e,c*e+(d+1)%e));this.faceVertexUvs[0].push([new THREE.UV(1-c/b,d/e),new THREE.UV(1-
|
|
(c+1)/b,d/e),new THREE.UV(1-(c+1)/b,(d+1)/e),new THREE.UV(1-c/b,(d+1)/e)])}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
(c+1)/b,d/e),new THREE.UV(1-(c+1)/b,(d+1)/e),new THREE.UV(1-c/b,(d+1)/e)])}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
-THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var e=a/2,f=b/2,c=c||1,d=d||1,g=c+1,h=d+1,i=a/c,j=b/d,l=new THREE.Vector3(0,1,0),a=0;a<h;a++)for(b=0;b<g;b++)this.vertices.push(new THREE.Vector3(b*i-e,0,a*j-f));for(a=0;a<d;a++)for(b=0;b<c;b++){e=new THREE.Face4(b+g*a,b+g*(a+1),b+1+g*(a+1),b+1+g*a);e.normal.copy(l);e.vertexNormals.push(l.clone(),l.clone(),l.clone(),l.clone());this.faces.push(e);this.faceVertexUvs[0].push([new THREE.UV(b/c,1-a/d),new THREE.UV(b/c,1-(a+1)/d),new THREE.UV((b+
|
|
|
|
|
|
+THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var e=a/2,f=b/2,c=c||1,d=d||1,g=c+1,h=d+1,i=a/c,j=b/d,l=new THREE.Vector3(0,0,1),a=0;a<h;a++)for(b=0;b<g;b++)this.vertices.push(new THREE.Vector3(b*i-e,-(a*j-f),0));for(a=0;a<d;a++)for(b=0;b<c;b++){e=new THREE.Face4(b+g*a,b+g*(a+1),b+1+g*(a+1),b+1+g*a);e.normal.copy(l);e.vertexNormals.push(l.clone(),l.clone(),l.clone(),l.clone());this.faces.push(e);this.faceVertexUvs[0].push([new THREE.UV(b/c,1-a/d),new THREE.UV(b/c,1-(a+1)/d),new THREE.UV((b+
|
|
1)/c,1-(a+1)/d),new THREE.UV((b+1)/c,1-a/d)])}this.computeCentroids()};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
1)/c,1-(a+1)/d),new THREE.UV((b+1)/c,1-a/d)])}this.computeCentroids()};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);var a=a||50,d=d!==void 0?d:0,e=e!==void 0?e:Math.PI*2,f=f!==void 0?f:0,g=g!==void 0?g:Math.PI,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),h,i,j=[],l=[];for(i=0;i<=c;i++){var m=[],n=[];for(h=0;h<=b;h++){var p=h/b,r=i/c,o=new THREE.Vector3;o.x=-a*Math.cos(d+p*e)*Math.sin(f+r*g);o.y=a*Math.cos(f+r*g);o.z=a*Math.sin(d+p*e)*Math.sin(f+r*g);this.vertices.push(o);m.push(this.vertices.length-1);n.push(new THREE.UV(p,
|
|
THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);var a=a||50,d=d!==void 0?d:0,e=e!==void 0?e:Math.PI*2,f=f!==void 0?f:0,g=g!==void 0?g:Math.PI,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),h,i,j=[],l=[];for(i=0;i<=c;i++){var m=[],n=[];for(h=0;h<=b;h++){var p=h/b,r=i/c,o=new THREE.Vector3;o.x=-a*Math.cos(d+p*e)*Math.sin(f+r*g);o.y=a*Math.cos(f+r*g);o.z=a*Math.sin(d+p*e)*Math.sin(f+r*g);this.vertices.push(o);m.push(this.vertices.length-1);n.push(new THREE.UV(p,
|
|
1-r))}j.push(m);l.push(n)}for(i=0;i<c;i++)for(h=0;h<b;h++){var d=j[i][h+1],e=j[i][h],f=j[i+1][h],g=j[i+1][h+1],m=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),p=this.vertices[f].clone().normalize(),r=this.vertices[g].clone().normalize(),o=l[i][h+1].clone(),q=l[i][h].clone(),s=l[i+1][h].clone(),x=l[i+1][h+1].clone();if(Math.abs(this.vertices[d].y)==a){this.faces.push(new THREE.Face3(d,f,g,[m,p,r]));this.faceVertexUvs[0].push([o,s,x])}else if(Math.abs(this.vertices[f].y)==
|
|
1-r))}j.push(m);l.push(n)}for(i=0;i<c;i++)for(h=0;h<b;h++){var d=j[i][h+1],e=j[i][h],f=j[i+1][h],g=j[i+1][h+1],m=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),p=this.vertices[f].clone().normalize(),r=this.vertices[g].clone().normalize(),o=l[i][h+1].clone(),q=l[i][h].clone(),s=l[i+1][h].clone(),x=l[i+1][h+1].clone();if(Math.abs(this.vertices[d].y)==a){this.faces.push(new THREE.Face3(d,f,g,[m,p,r]));this.faceVertexUvs[0].push([o,s,x])}else if(Math.abs(this.vertices[f].y)==
|