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

OrthographicCamera.clearViewOffset()

OrthographicCamera.clearViewOffset()方法可以用来恢复相机原始的视口位置和大小。

描述

默认情况下,OrthographicCamera的视口位置和大小由OrthographicCamera.setViewOffset()方法设置。但如果你想恢复相机到没有设置视口偏移的状态,那么可以使用OrthographicCamera.clearViewOffset()方法。

语法

camera.clearViewOffset();

参数

该方法没有参数。

示例

var camera = new THREE.OrthographicCamera( -10, 10, 10, -10, 1, 1000 );

// 设置视口偏移
camera.setViewOffset( window.innerWidth / 2, window.innerHeight / 2, window.innerWidth / 2, window.innerHeight / 2, window.innerWidth, window.innerHeight );

// 恢复原始视口
camera.clearViewOffset();

相关方法

  • OrthographicCamera.setViewOffset()

参考链接