diff --git a/build/Three.js b/build/Three.js index 3654d55d..c64ad08c 100755 --- a/build/Three.js +++ b/build/Three.js @@ -336,7 +336,7 @@ za*X+ca,J+za*(X+1)+ca,J+1+za*(X+1)+ca,J+1+za*X+ca,null,N));t.uvs.push([new THREE k[B]);this.sides.px&&m("z","y",1*j,-1,b,c,-w,this.materials[0]);this.sides.nx&&m("z","y",-1*j,-1,b,c,w,this.materials[1]);this.sides.py&&m("x","z",1*j,1,a,b,u,this.materials[2]);this.sides.ny&&m("x","z",1*j,-1,a,b,-u,this.materials[3]);this.sides.pz&&m("x","y",1*j,-1,a,c,o,this.materials[4]);this.sides.nz&&m("x","y",-1*j,-1,a,c,-o,this.materials[5]);(function(){for(var F=[],x=[],G=0,y=t.vertices.length;G0){h(0,0,-m-(g||0));for(d=a;d0){h(0,0,m+(e||0)); -for(d=a+a/2;d<2*a;d++)j.faces.push(new THREE.Face4((2*d-2*a+2)%a+a,(2*d-2*a+1)%a+a,(2*d-2*a)%a+a,2*a+1))}this.computeCentroids();this.computeFaceNormals()};Cylinder.prototype=new THREE.Geometry;Cylinder.prototype.constructor=Cylinder; +for(d=a+a/2;d<2*a;d++)j.faces.push(new THREE.Face4(2*a+1,(2*d-2*a+2)%a+a,(2*d-2*a+1)%a+a,(2*d-2*a)%a+a))}this.computeCentroids();this.computeFaceNormals()};Cylinder.prototype=new THREE.Geometry;Cylinder.prototype.constructor=Cylinder; var Icosahedron=function(a){function c(w,u,o){var v=Math.sqrt(w*w+u*u+o*o);return e.vertices.push(new THREE.Vertex(new THREE.Vector3(w/v,u/v,o/v)))-1}function b(w,u,o,v){v.faces.push(new THREE.Face3(w,u,o))}function d(w,u){var o=e.vertices[w].position,v=e.vertices[u].position;return c((o.x+v.x)/2,(o.y+v.y)/2,(o.z+v.z)/2)}var e=this,g=new THREE.Geometry,h;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;c(-1,a,0);c(1,a,0);c(-1,-a,0);c(1,-a,0);c(0,-1,a);c(0,1,a);c(0,-1,-a);c(0, 1,-a);c(a,0,-1);c(a,0,1);c(-a,0,-1);c(-a,0,1);b(0,11,5,g);b(0,5,1,g);b(0,1,7,g);b(0,7,10,g);b(0,10,11,g);b(1,5,9,g);b(5,11,4,g);b(11,10,2,g);b(10,7,6,g);b(7,1,8,g);b(3,9,4,g);b(3,4,2,g);b(3,2,6,g);b(3,6,8,g);b(3,8,9,g);b(4,9,5,g);b(2,4,11,g);b(6,2,10,g);b(8,6,7,g);b(9,8,1,g);for(a=0;a0){f(0,0,-l-(e||0));for(c=a;c0){f(0,0,l+(g||0)); -for(c=a+a/2;c<2*a;c++)h.faces.push(new THREE.Face4((2*c-2*a+2)%a+a,(2*c-2*a+1)%a+a,(2*c-2*a)%a+a,2*a+1))}this.computeCentroids();this.computeFaceNormals()};Cylinder.prototype=new THREE.Geometry;Cylinder.prototype.constructor=Cylinder; +for(c=a+a/2;c<2*a;c++)h.faces.push(new THREE.Face4(2*a+1,(2*c-2*a+2)%a+a,(2*c-2*a+1)%a+a,(2*c-2*a)%a+a))}this.computeCentroids();this.computeFaceNormals()};Cylinder.prototype=new THREE.Geometry;Cylinder.prototype.constructor=Cylinder; var Icosahedron=function(a){function d(t,n,m){var p=Math.sqrt(t*t+n*n+m*m);return g.vertices.push(new THREE.Vertex(new THREE.Vector3(t/p,n/p,m/p)))-1}function b(t,n,m,p){p.faces.push(new THREE.Face3(t,n,m))}function c(t,n){var m=g.vertices[t].position,p=g.vertices[n].position;return d((m.x+p.x)/2,(m.y+p.y)/2,(m.z+p.z)/2)}var g=this,e=new THREE.Geometry,f;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;d(-1,a,0);d(1,a,0);d(-1,-a,0);d(1,-a,0);d(0,-1,a);d(0,1,a);d(0,-1,-a);d(0, 1,-a);d(a,0,-1);d(a,0,1);d(-a,0,-1);d(-a,0,1);b(0,11,5,e);b(0,5,1,e);b(0,1,7,e);b(0,7,10,e);b(0,10,11,e);b(1,5,9,e);b(5,11,4,e);b(11,10,2,e);b(10,7,6,e);b(7,1,8,e);b(3,9,4,e);b(3,4,2,e);b(3,2,6,e);b(3,6,8,e);b(3,8,9,e);b(4,9,5,e);b(2,4,11,e);b(6,2,10,e);b(8,6,7,e);b(9,8,1,e);for(a=0;a 0 ) { + if ( botRad > 0 ) { - v( 0, 0, - halfHeight - ( botOffset || 0 ) ); + v( 0, 0, - halfHeight - ( botOffset || 0 ) ); - for ( i = numSegs; i < numSegs + ( numSegs / 2 ); i++ ) { + for ( i = numSegs; i < numSegs + ( numSegs / 2 ); i++ ) { - f4( 2 * numSegs, - ( 2 * i - 2 * numSegs ) % numSegs, - ( 2 * i - 2 * numSegs + 1 ) % numSegs, - ( 2 * i - 2 * numSegs + 2 ) % numSegs ); + f4( + 2 * numSegs, + ( 2 * i - 2 * numSegs ) % numSegs, + ( 2 * i - 2 * numSegs + 1 ) % numSegs, + ( 2 * i - 2 * numSegs + 2 ) % numSegs + ); - } + } - } + } - // Top circle faces + // Top circle faces - if ( topRad > 0 ) { + if ( topRad > 0 ) { - v( 0, 0, halfHeight + ( topOffset || 0 ) ); + v( 0, 0, halfHeight + ( topOffset || 0 ) ); - for ( i = numSegs + ( numSegs / 2 ); i < 2 * numSegs; i ++ ) { + for ( i = numSegs + ( numSegs / 2 ); i < 2 * numSegs; i ++ ) { - f4( 2 * numSegs + 1, - ( 2 * i - 2 * numSegs + 2 ) % numSegs + numSegs, - ( 2 * i - 2 * numSegs + 1 ) % numSegs + numSegs, - ( 2 * i - 2 * numSegs ) % numSegs + numSegs ); + f4( + 2 * numSegs + 1, + ( 2 * i - 2 * numSegs + 2 ) % numSegs + numSegs, + ( 2 * i - 2 * numSegs + 1 ) % numSegs + numSegs, + ( 2 * i - 2 * numSegs ) % numSegs + numSegs + ); - } + } - } + } - this.computeCentroids(); - this.computeFaceNormals(); - //this.computeVertexNormals(); + this.computeCentroids(); + this.computeFaceNormals(); + // this.computeVertexNormals(); - function v( x, y, z ) { + function v( x, y, z ) { - scope.vertices.push( new THREE.Vertex( new THREE.Vector3( x, y, z ) ) ); + scope.vertices.push( new THREE.Vertex( new THREE.Vector3( x, y, z ) ) ); - } + } - function f4( a, b, c, d ) { + function f4( a, b, c, d ) { - scope.faces.push( new THREE.Face4( a, b, c, d ) ); + scope.faces.push( new THREE.Face4( a, b, c, d ) ); - } + } }; Cylinder.prototype = new THREE.Geometry(); -Cylinder.prototype.constructor = Cylinder; \ No newline at end of file +Cylinder.prototype.constructor = Cylinder;