Mr.doob 12 лет назад
Родитель
Сommit
8cb7093b5a

+ 1 - 1
examples/webgl_animation_cloth.html

@@ -195,7 +195,7 @@
 				var clothMaterial = new THREE.MeshPhongMaterial( { alphaTest: 0.5, ambient: 0xffffff, color: 0xffffff, specular: 0x030303, emissive: 0x111111, shiness: 10, map: clothTexture, side: THREE.DoubleSide } );
 
 				// cloth geometry
-				clothGeometry = new THREE.ParametricGeometry( clothFunction, cloth.w, cloth.h, true );
+				clothGeometry = new THREE.ParametricGeometry( clothFunction, cloth.w, cloth.h );
 				clothGeometry.dynamic = true;
 				clothGeometry.computeFaceNormals();
 

+ 6 - 17
src/extras/geometries/ParametricGeometry.js

@@ -3,11 +3,11 @@
  * Parametric Surfaces Geometry
  * based on the brilliant article by @prideout http://prideout.net/blog/?p=44
  *
- * new THREE.ParametricGeometry( parametricFunction, uSegments, ySegements, useTris );
+ * new THREE.ParametricGeometry( parametricFunction, uSegments, ySegements );
  *
  */
 
-THREE.ParametricGeometry = function ( func, slices, stacks, useTris ) {
+THREE.ParametricGeometry = function ( func, slices, stacks ) {
 
 	THREE.Geometry.call( this );
 
@@ -15,8 +15,6 @@ THREE.ParametricGeometry = function ( func, slices, stacks, useTris ) {
 	var faces = this.faces;
 	var uvs = this.faceVertexUvs[ 0 ];
 
-	useTris = (useTris === undefined) ? false : useTris;
-
 	var i, il, j, p;
 	var u, v;
 
@@ -54,20 +52,11 @@ THREE.ParametricGeometry = function ( func, slices, stacks, useTris ) {
 			uvc = new THREE.Vector2( j / slices, ( i + 1 ) / stacks );
 			uvd = new THREE.Vector2( ( j + 1 ) / slices, ( i + 1 ) / stacks );
 
-			if ( useTris ) {
-
-				faces.push( new THREE.Face3( a, b, c ) );
-				faces.push( new THREE.Face3( b, d, c ) );
-
-				uvs.push( [ uva, uvb, uvc ] );
-				uvs.push( [ uvb, uvd, uvc ] );
-
-			} else {
-
-				faces.push( new THREE.Face4( a, b, d, c ) );
-				uvs.push( [ uva, uvb, uvd, uvc ] );
+			faces.push( new THREE.Face3( a, b, c ) );
+			uvs.push( [ uva, uvb, uvc ] );
 
-			}
+			faces.push( new THREE.Face3( a, c, d ) );
+			uvs.push( [ uva, uvc, uvd ] );
 
 		}
 

+ 5 - 2
src/extras/geometries/TubeGeometry.js

@@ -110,8 +110,11 @@ THREE.TubeGeometry = function( path, segments, radius, radialSegments, closed )
 			uvc = new THREE.Vector2( ( i + 1 ) / this.segments, ( j + 1 ) / this.radialSegments );
 			uvd = new THREE.Vector2( i / this.segments, ( j + 1 ) / this.radialSegments );
 
-			this.faces.push( new THREE.Face4( a, b, c, d ) );
-			this.faceVertexUvs[ 0 ].push( [ uva, uvb, uvc, uvd ] );
+			this.faces.push( new THREE.Face3( a, b, c ) );
+			this.faceVertexUvs[ 0 ].push( [ uva, uvb, uvc ] );
+
+			this.faces.push( new THREE.Face3( a, c, d ) );
+			this.faceVertexUvs[ 0 ].push( [ uva, uvc, uvd ] );
 
 		}
 	}