请选择 进入手机版 | 继续访问电脑版
分享
查看: 1196|回复: 1

[求助] 怎么做一个圆锥体啊,急!!!

[复制链接]

怎么做一个圆锥体啊,急!!!

发表于 2021-6-28 18:43:47 来自 求助 阅读模式 倒序浏览
zzv_icon1196 zzr_icon1 查看全部
需要在项目里加圆锥体,没找到方法
avatar

12

主题

31

帖子

179

积分

注册会员

Rank: 2

积分
179
橙歌 发表于 2021-6-28 18:46:25 显示全部楼层
圆锥体用下面的类,就可以了
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], // 圆柱体中心在世界坐标系下的位置
});
avatar
游客~
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

130700ppkpl8x3t7tt1b1t