|
@@ -474,8 +474,8 @@ t[y]);this.sides.px&&u("z","y",1*n,-1,e,c,-v,this.materials[0]);this.sides.nx&&u
|
|
|
h.position.y==t.position.y&&h.position.z==t.position.z){c[e]=m;k=!0;break}}if(!k)c[e]=b.length,b.push(new THREE.Vertex(h.position.clone()))}e=0;for(f=p.faces.length;e<f;e++)h=p.faces[e],h.a=c[h.a],h.b=c[h.b],h.c=c[h.c],h.d=c[h.d];p.vertices=b})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
|
|
|
THREE.CylinderGeometry=function(b,c,e,f,k){THREE.Geometry.call(this);var b=b!=null?b:20,c=c!=null?c:20,e=e||100,m=e/2,f=f||8,k=k||1,h,n,t=[],u=[];for(n=0;n<=k;n++){var p=[],v=[],x=n/k,w=x*(c-b)+b;for(h=0;h<=f;h++){var z=h/f;this.vertices.push(new THREE.Vertex(new THREE.Vector3(w*Math.sin(z*Math.PI*2),-x*e+m,w*Math.cos(z*Math.PI*2))));p.push(this.vertices.length-1);v.push(new THREE.UV(z,x))}t.push(p);u.push(v)}for(n=0;n<k;n++)for(h=0;h<f;h++){var e=t[n][h],p=t[n+1][h],v=t[n+1][h+1],x=t[n][h+1],w=this.vertices[e].position.clone().setY(0).normalize(),
|
|
|
z=this.vertices[p].position.clone().setY(0).normalize(),y=this.vertices[v].position.clone().setY(0).normalize(),B=this.vertices[x].position.clone().setY(0).normalize(),D=u[n][h].clone(),G=u[n+1][h].clone(),H=u[n+1][h+1].clone(),E=u[n][h+1].clone();this.faces.push(new THREE.Face4(e,p,v,x,[w,z,y,B]));this.faceVertexUvs[0].push([D,G,H,E])}if(b>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(h=0;h<f;h++)e=t[0][h],p=t[0][h+1],v=this.vertices.length-1,w=new THREE.Vector3(0,1,0),z=
|
|
|
-new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),D=u[0][h].clone(),G=u[0][h+1].clone(),H=new THREE.UV,this.faces.push(new THREE.Face3(e,p,v,[w,z,y])),this.faceVertexUvs[0].push([D,G,H])}if(c>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(h=0;h<f;h++)e=t[n][h],p=this.vertices.length-1,v=t[n][h+1],w=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),D=u[n][h].clone(),G=new THREE.UV(1,1),H=u[n][h+1].clone(),this.faces.push(new THREE.Face3(e,p,
|
|
|
-v,[w,z,y])),this.faceVertexUvs[0].push([D,G,H])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.ExtrudeGeometry=function(b,c){if(typeof b!="undefined"){THREE.Geometry.call(this);var b=b instanceof Array?b:[b],e,f=b.length,k;this.shapebb=b[f-1].getBoundingBox();for(e=0;e<f;e++)k=b[e],this.addShape(k,c);this.computeCentroids();this.computeFaceNormals()}};
|
|
|
+new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),D=u[0][h].clone(),G=u[0][h+1].clone(),H=new THREE.UV(G.u,0),this.faces.push(new THREE.Face3(e,p,v,[w,z,y])),this.faceVertexUvs[0].push([D,G,H])}if(c>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(h=0;h<f;h++)e=t[n][h+1],p=t[n][h],v=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),D=u[n][h+1].clone(),G=u[n][h].clone(),H=new THREE.UV(G.u,1),this.faces.push(new THREE.Face3(e,
|
|
|
+p,v,[w,z,y])),this.faceVertexUvs[0].push([D,G,H])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.ExtrudeGeometry=function(b,c){if(typeof b!="undefined"){THREE.Geometry.call(this);var b=b instanceof Array?b:[b],e,f=b.length,k;this.shapebb=b[f-1].getBoundingBox();for(e=0;e<f;e++)k=b[e],this.addShape(k,c);this.computeCentroids();this.computeFaceNormals()}};
|
|
|
THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
|
|
|
THREE.ExtrudeGeometry.prototype.addShape=function(b,c){function e(b,c,e){c||console.log("die");return c.clone().multiplyScalar(e).addSelf(b)}function f(b,c,e){var f=THREE.ExtrudeGeometry.__v1,h=THREE.ExtrudeGeometry.__v2,k=THREE.ExtrudeGeometry.__v3,m=THREE.ExtrudeGeometry.__v4,n=THREE.ExtrudeGeometry.__v5,o=THREE.ExtrudeGeometry.__v6;f.set(b.x-c.x,b.y-c.y);h.set(b.x-e.x,b.y-e.y);f=f.normalize();h=h.normalize();k.set(-f.y,f.x);m.set(h.y,-h.x);n.copy(b).addSelf(k);o.copy(b).addSelf(m);if(n.equals(o))return m.clone();
|
|
|
n.copy(c).addSelf(k);o.copy(e).addSelf(m);k=f.dot(m);m=o.subSelf(n).dot(m);k==0&&(console.log("Either infinite or no solutions!"),m==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));m/=k;if(m<0)return c=Math.atan2(c.y-b.y,c.x-b.x),b=Math.atan2(e.y-b.y,e.x-b.x),c>b&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function k(b){for(L=b.length;--L>=0;){ga=L;da=L-1;da<0&&(da=b.length-
|