BufferGeometry
Object3D
Raycaster
Camera
CubeCamera
PerspectiveCamera
OrthographicCamera
StereoCamera
Clock
Curve
CurvePath
Path
Shape
ShapePath
ArrowHelper
AxesHelper
BoxHelper
Box3Helper
CameraHelper
DirectionalLightHelper
GridHelper
PolarGridHelper
HemisphereLightHelper
PlaneHelper
PointLightHelper
SkeletonHelper
SpotLightHelper
Light
PointLight
RectAreaLight
SpotLight
DirectionalLight
HemisphereLight
LightShadow
PointLightShadow
AnimationLoader
AudioLoader
BufferGeometryLoader
CompressedTextureLoader
CubeTextureLoader
DataTextureLoader
FileLoader
ImageBitmapLoader
ImageLoader
Loader
LoaderUtils
MaterialLoader
ObjectLoader
TextureLoader
LoadingManager
Material
Box2
Box3
Color
Cylindrical
Euler
Frustum
Interpolant
Line3
MathUtils
Matrix3
Matrix4
Plane
Quaternion
AnimationAction
AnimationClip
AnimationMixer
AnimationObjectGroup
AnimationUtils
keyframeTrack
PropertyBinding
PropertyMixer
BooleanKeyframeTrack
QuaternionKeyframeTrack
StringKeyframeTrack
Audio
AudioAnalyser
AudioContext
AudioListener
PositionalAudio

Cylindrical.set()

该方法用于设置圆柱体坐标系沿着极径和极角方向偏移的值。

语法

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 }

说明

该方法用于设置圆柱体坐标系的偏移量,并根据偏移量重新计算圆柱体在直角坐标系下的坐标值。

圆柱体的坐标系如下图所示:

cylindrical-coordinate.png

radius参数为圆柱体沿着极径偏移的值,theta为沿着极角偏移的值,y为沿y轴偏移的值。

需要注意的是,theta参数应为弧度制,当使用角度制时需要将角度转换为弧度。