|
@@ -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 ] );
|
|
|
|
|
|
}
|
|
|
|