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

Object3D.translateZ()

方法描述

该方法用于将Object3D对象沿着Z轴上移动一定的距离。

语法

Object3D.translateZ(distance)

参数

distance:Number类型,表示移动的距离,可以为正数和负数。

返回值

该方法没有返回值。

示例

var object = new THREE.Object3D();
object.translateZ(10);

上述代码将Object3D对象沿着Z轴正方向移动了10个单位。

var object = new THREE.Object3D();
object.translateZ(-5);

上述代码将Object3D对象沿着Z轴负方向移动了5个单位。

注意事项

当使用该方法时,Object3D对象的位置将被更改,但是该对象的旋转、缩放等属性不会受到影响。

参考文献

https://threejs.org/docs/#api/zh/core/Object3D.translateZ