|
圆锥体用下面的类,就可以了
THING.factory.classes['Cylinder'].prototype.createGeometry = function (e) {
var t = e.height || 1
, i = e.radius || .5
, n = e.radiusTop != undefined ? e.radiusTop : i
, r = e.radiusBottom != undefined ? e.radiusBottom : i
, o = e.radiusSegments || 8
, s = e.heightSegments || 1
, a = e.heightSegments || !1
, u = e.heightSegments || 0
, l = e.heightSegments || 2 * Math.PI;
return new THREE.CylinderGeometry(n, r, t, o, s, a, u, l)
}
var cylinder = app.create({
type: 'Cylinder',
height: 2, // 高度
radiusTop: 0,
radiusBottom: 2,
radiusSegments: 64, // 半径切面密度,数值越高圆柱体越圆滑
position: [0, 2, 0], // 圆柱体中心在世界坐标系下的位置
}); |
|