提交 6012c3f4 编写于 作者: M Mugen87

Geometries: More clean up

上级 a5449d21
...@@ -149,6 +149,8 @@ function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, ...@@ -149,6 +149,8 @@ function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments,
} }
// indices
// 1. you need three indices to draw a single face // 1. you need three indices to draw a single face
// 2. a single segment consists of two faces // 2. a single segment consists of two faces
// 3. so we need to generate six (2*3) indices per segment // 3. so we need to generate six (2*3) indices per segment
...@@ -157,7 +159,6 @@ function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, ...@@ -157,7 +159,6 @@ function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments,
for ( ix = 0; ix < gridX; ix ++ ) { for ( ix = 0; ix < gridX; ix ++ ) {
// indices
var a = numberOfVertices + ix + gridX1 * iy; var a = numberOfVertices + ix + gridX1 * iy;
var b = numberOfVertices + ix + gridX1 * ( iy + 1 ); var b = numberOfVertices + ix + gridX1 * ( iy + 1 );
var c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 ); var c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 );
...@@ -168,7 +169,7 @@ function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, ...@@ -168,7 +169,7 @@ function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments,
indices.push( a, b, d ); indices.push( a, b, d );
indices.push( b, c, d ); indices.push( b, c, d );
// update counter // increase counter
groupCount += 6; groupCount += 6;
......
...@@ -97,6 +97,7 @@ function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegment ...@@ -97,6 +97,7 @@ function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegment
normals.push( 0, 0, 1 ); normals.push( 0, 0, 1 );
// uv // uv
uv.x = ( vertex.x / outerRadius + 1 ) / 2; uv.x = ( vertex.x / outerRadius + 1 ) / 2;
uv.y = ( vertex.y / outerRadius + 1 ) / 2; uv.y = ( vertex.y / outerRadius + 1 ) / 2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册