ShapeGeometry demo: geometry/shape.html ExtrudeGeometry demo: geometry/shape_3d.html
其他列子参考
BoxGeometry(width : Float, height : Float, depth : Float, widthSegments : Integer, heightSegments : Integer, depthSegments : Integer)
BoxBufferGeometry(....)
两者参数相同:
var geometry = new THREE.BoxGeometry( 1, 1, 1 );
var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
var cube = new THREE.Mesh( geometry, material );
scene.add( cube );
CircleGeometry(radius : Float, segments : Integer, thetaStart : Float, thetaLength : Float)
(可选)半径 默认1;(可选)分段默认8,最小3;(可选)开始角度默认0;(可选)周长 2*PI
ConeGeometry(radius : Float, height : Float, radialSegments : Integer, heightSegments : Integer, openEnded : Boolean, thetaStart : Float, thetaLength : Float)
openEnded: 默认false,true则底部不显示
CylinderGeometry(radiusTop, radiusBottom, height, radiusSegments, heightSegments, openEnded, thetaStart, thetaLength)
openEnded: 默认false,true则底部不显示
DodecahedronGeometry(radius, detail)
detail: 默认0,设置后添加顶点不再是十二面体
EdgesGeometry( geometry : Geometry, thresholdAngle : Integer )
ExtrudeGeometry(shapes : Array, options : Object)
options包括以下参数
IcosahederonGeometry(radius, detail)
LatheGeometry(points : Array, segments : Integer, phiStart : Float, phiLength : Float) 分段默认12
OctahedronGeometry(radius : Float, detail : Integer) 分段默认12
ParametricGeometry(func : Function, slices : Integer, stacks : Integer)
PlaneGeometry(width : Float, height : Float, widthSegments : Integer, heightSegments : Integer)
OctahedronGeometry(radius : Float, detail : Integer)PolyhedronGeometry(vertices, faces, radius, detail)
RingGeometry(innerRadius : Float, outerRadius : Float, thetaSegments : Integer, phiSegments : Integer, thetaStart : Float, thetaLength : Float) 参数均可选默认值依次为0/50/8/8/0/2*Math.PI
ShapeGeometry(shapes : Array, curveSegments : Integer)
和SVG中的
SphereGeometry(radius : Float, widthSegments : Integer, heightSegments : Integer, phiStart : Float, phiLength : Float, thetaStart : Float, thetaLength : Float)
TetrahedronGeometry(radius : Float, detail : Integer)
TextGeometry(text : String, parameters : Object)
parameters可选参数
- font: THREE.Font,
- size: 100,
- height: 50,
- curveSegments: 12,
- bevelEnabled: false, 是否打开斜面
- bevelThickness: 10,斜面的深度
- bevelSize: 8,离文本轮廓多远是斜面
- bevelSegments: 3 斜面分段
TorusGeometry(radius : Float, tube : Float, radialSegments : Integer, tubularSegments : Integer, arc : Float)
TorusKnotGeometry(radius : Float, tube : Float, tubularSegments : Integer, radialSegments : Integer, p : Integer, q : Integer)
TubeGeometry(path : Curve, tubularSegments : Integer, radius : Float, radialSegments : Integer, closed : Boolean)
WireframeGeometry( geometry : Geometry )
可以用来生成一个给定的三维点阵列的凸包。这个任务的平均时间复杂度被认为是O(nlog(N)。
可以用来创建一个贴花网格,服务于不同的目的,如添加独特的细节模型,执行动态的视觉环境变化或覆盖接缝