提交 30267e32 编写于 作者: W WestLangley

SphereBufferGeometry: Fix edge case logic

上级 d12cde6b
......@@ -30,7 +30,7 @@ THREE.SphereBufferGeometry = function ( radius, widthSegments, heightSegments, p
thetaStart = thetaStart !== undefined ? thetaStart : 0;
thetaLength = thetaLength !== undefined ? thetaLength : Math.PI;
var isSector = thetaStart > 0 || thetaStart + thetaLength < Math.PI;
var thetaEnd = thetaStart + thetaLength;
var vertexCount = ( ( widthSegments + 1 ) * ( heightSegments + 1 ) );
......@@ -81,8 +81,8 @@ THREE.SphereBufferGeometry = function ( radius, widthSegments, heightSegments, p
var v3 = vertices[ y + 1 ][ x ];
var v4 = vertices[ y + 1 ][ x + 1 ];
if ( y !== 0 || isSector === true ) indices.push( v1, v2, v4 );
if ( y !== heightSegments - 1 || isSector === true ) indices.push( v2, v3, v4 );
if ( y !== 0 || thetaStart > 0 ) indices.push( v1, v2, v4 );
if ( y !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( v2, v3, v4 );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册