1 /**
  2  * @author oosmoxiecode
  3  * @author mrdoob / http://mrdoob.com/
  4  * based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3DLite/src/away3dlite/primitives/Torus.as?r=2888
  5  */
  6 
  7 /**@constructor*/
  8 THREE.TorusGeometry = function ( radius, tube, radialSegments, tubularSegments, arc ) {
  9 
 10 	THREE.Geometry.call( this );
 11 
 12 	var scope = this;
 13 
 14 	this.radius = radius || 100;
 15 	this.tube = tube || 40;
 16 	this.radialSegments = radialSegments || 8;
 17 	this.tubularSegments = tubularSegments || 6;
 18 	this.arc = arc || Math.PI * 2;
 19 
 20 	var center = new THREE.Vector3(), uvs = [], normals = [];
 21 
 22 	for ( var j = 0; j <= this.radialSegments; j ++ ) {
 23 
 24 		for ( var i = 0; i <= this.tubularSegments; i ++ ) {
 25 
 26 			var u = i / this.tubularSegments * this.arc;
 27 			var v = j / this.radialSegments * Math.PI * 2;
 28 
 29 			center.x = this.radius * Math.cos( u );
 30 			center.y = this.radius * Math.sin( u );
 31 
 32 			var vertex = new THREE.Vector3();
 33 			vertex.x = ( this.radius + this.tube * Math.cos( v ) ) * Math.cos( u );
 34 			vertex.y = ( this.radius + this.tube * Math.cos( v ) ) * Math.sin( u );
 35 			vertex.z = this.tube * Math.sin( v );
 36 
 37 			this.vertices.push( vertex );
 38 
 39 			uvs.push( new THREE.UV( i / this.tubularSegments, j / this.radialSegments ) );
 40 			normals.push( vertex.clone().subSelf( center ).normalize() );
 41 
 42 		}
 43 	}
 44 
 45 
 46 	for ( var j = 1; j <= this.radialSegments; j ++ ) {
 47 
 48 		for ( var i = 1; i <= this.tubularSegments; i ++ ) {
 49 
 50 			var a = ( this.tubularSegments + 1 ) * j + i - 1;
 51 			var b = ( this.tubularSegments + 1 ) * ( j - 1 ) + i - 1;
 52 			var c = ( this.tubularSegments + 1 ) * ( j - 1 ) + i;
 53 			var d = ( this.tubularSegments + 1 ) * j + i;
 54 
 55 			var face = new THREE.Face4( a, b, c, d, [ normals[ a ], normals[ b ], normals[ c ], normals[ d ] ] );
 56 			face.normal.addSelf( normals[ a ] );
 57 			face.normal.addSelf( normals[ b ] );
 58 			face.normal.addSelf( normals[ c ] );
 59 			face.normal.addSelf( normals[ d ] );
 60 			face.normal.normalize();
 61 
 62 			this.faces.push( face );
 63 
 64 			this.faceVertexUvs[ 0 ].push( [ uvs[ a ].clone(), uvs[ b ].clone(), uvs[ c ].clone(), uvs[ d ].clone() ] );
 65 		}
 66 
 67 	}
 68 
 69 	this.computeCentroids();
 70 
 71 };
 72 
 73 THREE.TorusGeometry.prototype = Object.create( THREE.Geometry.prototype );
 74 

nike free rn new balance hombre baratas cinturones gucci ugg rebajas cinturon gucci ray ban baratas nike cortez peuterey mujer christian louboutin madrid mbt zapatos gafas ray ban baratas mbt ofertas air max blancas mbt barcelona nike air max 90 woolrich barcelona nike mujer botas ugg gafas de sol carrera aratas air max 2016 baratas oakley baratas nike air max 2016

mbt skor nike sverige louboutin skor hollister sverige polo ralph lauren skjorta woolrich jacka dam canada goose jacka woolrich jacka ray ban rea canada goose rea michael kors rea new balance skor ralph lauren skjorta new balance rea uggs sverige lacoste rea christian louboutin skor moncler jacka nike shox barbour jacka uggs rea