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

PointLightShadow.updateMatrices()

简介

PointLightShadow.updateMatrices() 是three.js中点光源阴影的方法之一,用于更新点光源阴影的矩阵。该方法会运用点光源的位置信息和阴影相机的位置及投影矩阵,计算出点光源阴影的矩阵。

语法

PointLightShadow.updateMatrices()

参数

PointLightShadow.updateMatrices() 方法不接受任何参数。

返回值

PointLightShadow.updateMatrices() 方法没有返回值。

示例

var pointLight = new THREE.PointLight(0xffffff, 1, 100);
pointLight.position.set(0, 5, 0);

var pointLightShadow = new THREE.PointLightShadow(pointLight);
pointLightShadow.camera.near = 1;
pointLightShadow.camera.far = 100;
pointLightShadow.mapSize.set(1024, 1024);

pointLight.shadow = pointLightShadow;

pointLightShadow.updateMatrices();

在上面的示例中,我们创建了一个点光源,并用该点光源创建一个点光源阴影对象。接着,我们设置了阴影相机的近平面和远平面,以及阴影贴图的尺寸。最后,我们调用了 updateMatrices() 方法来更新点光源阴影的矩阵。

参考文献