|
@@ -495,7 +495,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
|
|
for ( i = 0; i < flen; i ++ ) {
|
|
for ( i = 0; i < flen; i ++ ) {
|
|
|
|
|
|
face = faces[ i ];
|
|
face = faces[ i ];
|
|
- f3( face[ 2 ]+ offset, face[ 1 ]+ offset, face[ 0 ] + offset, true );
|
|
|
|
|
|
+ f3( face[ 2 ]+ offset, face[ 1 ]+ offset, face[ 0 ] + offset );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -507,7 +507,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
|
|
for ( i = 0; i < flen; i ++ ) {
|
|
for ( i = 0; i < flen; i ++ ) {
|
|
|
|
|
|
face = faces[ i ];
|
|
face = faces[ i ];
|
|
- f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset, false );
|
|
|
|
|
|
+ f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -518,7 +518,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
|
|
for ( i = 0; i < flen; i ++ ) {
|
|
for ( i = 0; i < flen; i ++ ) {
|
|
|
|
|
|
face = faces[ i ];
|
|
face = faces[ i ];
|
|
- f3( face[ 2 ], face[ 1 ], face[ 0 ], true );
|
|
|
|
|
|
+ f3( face[ 2 ], face[ 1 ], face[ 0 ] );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -527,7 +527,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
|
|
for ( i = 0; i < flen; i ++ ) {
|
|
for ( i = 0; i < flen; i ++ ) {
|
|
|
|
|
|
face = faces[ i ];
|
|
face = faces[ i ];
|
|
- f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps, false );
|
|
|
|
|
|
+ f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps );
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -593,7 +593,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- function f3( a, b, c, isBottom ) {
|
|
|
|
|
|
+ function f3( a, b, c ) {
|
|
|
|
|
|
a += shapesOffset;
|
|
a += shapesOffset;
|
|
b += shapesOffset;
|
|
b += shapesOffset;
|
|
@@ -602,7 +602,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
|
|
// normal, color, material
|
|
// normal, color, material
|
|
scope.faces.push( new THREE.Face3( a, b, c, null, null, material ) );
|
|
scope.faces.push( new THREE.Face3( a, b, c, null, null, material ) );
|
|
|
|
|
|
- var uvs = isBottom ? uvgen.generateBottomUV( scope, shape, options, a, b, c ) : uvgen.generateTopUV( scope, shape, options, a, b, c );
|
|
|
|
|
|
+ var uvs = uvgen.generateTopUV( scope, a, b, c );
|
|
|
|
|
|
scope.faceVertexUvs[ 0 ].push( uvs );
|
|
scope.faceVertexUvs[ 0 ].push( uvs );
|
|
|
|
|
|
@@ -618,8 +618,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
|
|
scope.faces.push( new THREE.Face3( a, b, d, null, null, extrudeMaterial ) );
|
|
scope.faces.push( new THREE.Face3( a, b, d, null, null, extrudeMaterial ) );
|
|
scope.faces.push( new THREE.Face3( b, c, d, null, null, extrudeMaterial ) );
|
|
scope.faces.push( new THREE.Face3( b, c, d, null, null, extrudeMaterial ) );
|
|
|
|
|
|
- var uvs = uvgen.generateSideWallUV( scope, shape, wallContour, options, a, b, c, d,
|
|
|
|
- stepIndex, stepsLength, contourIndex1, contourIndex2 );
|
|
|
|
|
|
+ var uvs = uvgen.generateSideWallUV( scope, a, b, c, d );
|
|
|
|
|
|
scope.faceVertexUvs[ 0 ].push( [ uvs[ 0 ], uvs[ 1 ], uvs[ 3 ] ] );
|
|
scope.faceVertexUvs[ 0 ].push( [ uvs[ 0 ], uvs[ 1 ], uvs[ 3 ] ] );
|
|
scope.faceVertexUvs[ 0 ].push( [ uvs[ 1 ], uvs[ 2 ], uvs[ 3 ] ] );
|
|
scope.faceVertexUvs[ 0 ].push( [ uvs[ 1 ], uvs[ 2 ], uvs[ 3 ] ] );
|
|
@@ -630,11 +629,13 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
|
|
|
|
|
|
THREE.ExtrudeGeometry.WorldUVGenerator = {
|
|
THREE.ExtrudeGeometry.WorldUVGenerator = {
|
|
|
|
|
|
- generateTopUV: function( geometry, extrudedShape, extrudeOptions, indexA, indexB, indexC ) {
|
|
|
|
-
|
|
|
|
- var a = geometry.vertices[ indexA ];
|
|
|
|
- var b = geometry.vertices[ indexB ];
|
|
|
|
- var c = geometry.vertices[ indexC ];
|
|
|
|
|
|
+ generateTopUV: function ( geometry, indexA, indexB, indexC ) {
|
|
|
|
+
|
|
|
|
+ var vertices = geometry.vertices;
|
|
|
|
+
|
|
|
|
+ var a = vertices[ indexA ];
|
|
|
|
+ var b = vertices[ indexB ];
|
|
|
|
+ var c = vertices[ indexC ];
|
|
|
|
|
|
return [
|
|
return [
|
|
new THREE.Vector2( a.x, a.y ),
|
|
new THREE.Vector2( a.x, a.y ),
|
|
@@ -644,20 +645,14 @@ THREE.ExtrudeGeometry.WorldUVGenerator = {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- generateBottomUV: function( geometry, extrudedShape, extrudeOptions, indexA, indexB, indexC ) {
|
|
|
|
-
|
|
|
|
- return this.generateTopUV( geometry, extrudedShape, extrudeOptions, indexA, indexB, indexC );
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
|
|
+ generateSideWallUV: function ( geometry, indexA, indexB, indexC, indexD ) {
|
|
|
|
|
|
- generateSideWallUV: function( geometry, extrudedShape, wallContour, extrudeOptions,
|
|
|
|
- indexA, indexB, indexC, indexD, stepIndex, stepsLength,
|
|
|
|
- contourIndex1, contourIndex2 ) {
|
|
|
|
|
|
+ var vertices = geometry.vertices;
|
|
|
|
|
|
- var a = geometry.vertices[ indexA ];
|
|
|
|
- var b = geometry.vertices[ indexB ];
|
|
|
|
- var c = geometry.vertices[ indexC ];
|
|
|
|
- var d = geometry.vertices[ indexD ];
|
|
|
|
|
|
+ var a = vertices[ indexA ];
|
|
|
|
+ var b = vertices[ indexB ];
|
|
|
|
+ var c = vertices[ indexC ];
|
|
|
|
+ var d = vertices[ indexD ];
|
|
|
|
|
|
if ( Math.abs( a.y - b.y ) < 0.01 ) {
|
|
if ( Math.abs( a.y - b.y ) < 0.01 ) {
|
|
return [
|
|
return [
|