|
@@ -89,6 +89,10 @@ function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart,
|
|
|
|
|
|
var v = iy / heightSegments;
|
|
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 ++ ) {
|
|
for ( ix = 0; ix <= widthSegments; ix ++ ) {
|
|
|
|
|
|
var u = ix / widthSegments;
|
|
var u = ix / widthSegments;
|
|
@@ -103,12 +107,12 @@ function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart,
|
|
|
|
|
|
// normal
|
|
// normal
|
|
|
|
|
|
- normal.set( vertex.x, vertex.y, vertex.z ).normalize();
|
|
|
|
|
|
+ normal.copy( vertex ).normalize();
|
|
normals.push( normal.x, normal.y, normal.z );
|
|
normals.push( normal.x, normal.y, normal.z );
|
|
|
|
|
|
// uv
|
|
// uv
|
|
|
|
|
|
- uvs.push( u, 1 - v );
|
|
|
|
|
|
+ uvs.push( u + uOffset, 1 - v );
|
|
|
|
|
|
verticesRow.push( index ++ );
|
|
verticesRow.push( index ++ );
|
|
|
|
|