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

PerspectiveCamera.getFilmHeight()

该方法返回透视相机的贴近面高度。

语法

camera.getFilmHeight()

返回值

返回值是一个数值,表示相机的贴近面高度。

描述

透视相机的贴近面是相机到物体之间的距离,该距离定义了可视区域内能够看到的空间范围。该方法返回的是相机贴近面高度,也就是可视区域在垂直方向的范围。如果需要获取相机的贴近面宽度,可以通过调用 PerspectiveCamera.getFilmWidth() 方法。

示例

下面的示例演示了如何使用 PerspectiveCamera.getFilmHeight() 来获取透视相机的贴近面高度:

const camera = new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 0.1, 1000);
const filmHeight = camera.getFilmHeight();
console.log(`透视相机贴近面高度为 ${filmHeight}`);

输出结果为:

透视相机贴近面高度为 7.358689524589973

参考文献