该方法用于设置圆柱体坐标系沿着极径和极角方向偏移的值。
set(radius, theta, y)
radius
:圆柱体沿极径方向偏移的值,类型为Number
。theta
:圆柱体沿极角方向偏移的值,类型为Number
。应为弧度制。y
:圆柱体沿y轴方向偏移的值,类型为Number
。无返回值。
// 创建Cylindrical对象
const cylindrical = new THREE.Cylindrical();
// 设置坐标系偏移量
cylindrical.set(1, Math.PI / 2, 2);
// 输出结果
console.log(cylindrical);
// 输出:Cylindrical { radius: 1, theta: 1.5707963267948966, y: 2 }
该方法用于设置圆柱体坐标系的偏移量,并根据偏移量重新计算圆柱体在直角坐标系下的坐标值。
圆柱体的坐标系如下图所示:
radius
参数为圆柱体沿着极径偏移的值,theta
为沿着极角偏移的值,y
为沿y轴偏移的值。
需要注意的是,theta参数应为弧度制,当使用角度制时需要将角度转换为弧度。