CylinderGeometry 圆柱

—> Geometry

Cylinder 的本意是圆柱, 但如同 CircleGeometry 一样, 通过不同的设置, 可以展现多种形状:

function CylinderGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ){ } var geometry = new THREE.CylinderGeometry( 2, 2, 6, 64 ), material = new THREE.MeshBasicMaterial({color: 0x663399, side: THREE.DoubleSide}), cylinder = new THREE.Mesh( geometry, material ); scene.add( cylinder );

Parameters

radiusTop radiusBottom height radialSegments heightSegments openEnded thetaStart thetaLength
1 1 1 8 ( >=3 ) 1 false 0 Math.PI * 2
顶部半径 底部半径 顶部和底部的圆周分段数 侧面分段数 是否打开 开始角度 闭合角度

Methods 继承自 Geometry 并自动调用

fromBufferGeometry( new CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) )
mergeVertices( )

CylinderBufferGeometry

function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { } var geometry = new THREE.CylinderBufferGeometry( 2, 2, 6, 64 ), material = new THREE.MeshBasicMaterial({color: 0x663399, side: THREE.DoubleSide}), cylinder = new THREE.Mesh( geometry, material ); scene.add( cylinder );

图解API

纹理Texture来渲染圆柱模型. 点开查看