TorusGeometry 圆环

—> Geometry

通过 TorusGeometry, 你可以得到一个像甜甜圈、游泳圈一样的有趣图形. 但 radialSegments, tubularSegments 的默认值不高, 展现 出的形状有棱角, 需要设置得高一些, 才能像个环形.

function TorusGeometry( radius, tube, radialSegments, tubularSegments, arc ) { } var geometry = new THREE.TorusGeometry(3, 1, 40, 40, Math.PI*2), material = new THREE.MeshBasicMaterial({color: 0x663399, side: THREE.DoubleSide}), torus = new THREE.Mesh( geometry, material ); scene.add( torus );

Parameters

radius tube radialSegments tubularSegments arc
1 0.4 8 6 Math.PI * 2
圆环半径 管半径 圆环的圆周分段数 管的圆周分段数 弧度

Methods 继承自 Geometry 并自动调用

fromBufferGeometry( new TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) )
mergeVertices( )

TorusBufferGeometry

function TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) { } var geometry = new THREE.TorusBufferGeometry(3, 1, 40, 40, Math.PI*2), material = new THREE.MeshBasicMaterial({color: 0x663399, side: THREE.DoubleSide}), torus = new THREE.Mesh( geometry, material ); scene.add( torus );

Methods 继承自 BufferGeometry 并自动调用

setIndex( )
addAttribute( )

图解API

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