提交 cd71783f 编写于 作者: W WestLangley

Compute flat normals when detail is zero

上级 e573be00
......@@ -74,7 +74,16 @@ function PolyhedronBufferGeometry( vertices, indices, radius, detail ) {
this.addAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) );
this.addAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) );
this.addAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) );
this.normalizeNormals();
if ( detail === 0 ) {
BufferGeometry.prototype.computeVertexNormals.call( this ); // flat normals
} else {
this.normalizeNormals(); // smooth normals
}
// helper functions
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册