2
0
Mr.doob 6 жил өмнө
parent
commit
de34d4e695
3 өөрчлөгдсөн 317 нэмэгдсэн , 309 устгасан
  1. 6 2
      build/three.js
  2. 305 305
      build/three.min.js
  3. 6 2
      build/three.module.js

+ 6 - 2
build/three.js

@@ -30386,6 +30386,10 @@
 
 			var v = iy / heightSegments;
 
+			// special case for the poles
+
+			var uOffset = ( iy == 0 ) ? 0.5 / widthSegments : ( ( iy == heightSegments ) ? - 0.5 / widthSegments : 0 );
+
 			for ( ix = 0; ix <= widthSegments; ix ++ ) {
 
 				var u = ix / widthSegments;
@@ -30400,12 +30404,12 @@
 
 				// normal
 
-				normal.set( vertex.x, vertex.y, vertex.z ).normalize();
+				normal.copy( vertex ).normalize();
 				normals.push( normal.x, normal.y, normal.z );
 
 				// uv
 
-				uvs.push( u, 1 - v );
+				uvs.push( u + uOffset, 1 - v );
 
 				verticesRow.push( index ++ );
 

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 305 - 305
build/three.min.js


+ 6 - 2
build/three.module.js

@@ -30380,6 +30380,10 @@ function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart,
 
 		var v = iy / heightSegments;
 
+		// special case for the poles
+
+		var uOffset = ( iy == 0 ) ? 0.5 / widthSegments : ( ( iy == heightSegments ) ? - 0.5 / widthSegments : 0 );
+
 		for ( ix = 0; ix <= widthSegments; ix ++ ) {
 
 			var u = ix / widthSegments;
@@ -30394,12 +30398,12 @@ function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart,
 
 			// normal
 
-			normal.set( vertex.x, vertex.y, vertex.z ).normalize();
+			normal.copy( vertex ).normalize();
 			normals.push( normal.x, normal.y, normal.z );
 
 			// uv
 
-			uvs.push( u, 1 - v );
+			uvs.push( u + uOffset, 1 - v );
 
 			verticesRow.push( index ++ );
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно