Capítulo 532 de 859

Chapter 532: CSMFrustum

Core Idea

Represents the frustum of a CSM instance.

Key Concepts

  • vertices : Object: An object representing the vertices of the near and far plane in view space.
  • zFar : number: The zFar value.
  • zNear : number: The zNear value. This value depends on whether the CSM is used with WebGL or WebGPU. Both API use different conventions for their projectio…

Code Examples

import { CSMFrustum } from 'three/addons/csm/CSMFrustum.js';
  • What it demonstrates: Typical usage of CSMFrustum.

Reference Tables

Constructor

Signature
new CSMFrustum( data : CSMFrustum~Data )

Properties

PropertyDescription
.vertices : ObjectAn object representing the vertices of the near and far plane in view space.
.zFar : numberThe zFar value.
.zNear : numberThe zNear value. This value depends on whether the CSM is used with WebGL or WebGPU. Both API use different conventions for their projection matrices.

Methods

MethodDescription
.setFromProjectionMatrix( projectionMatrix : Matrix4, maxFar : number ) : ObjectSetups this CSM frustum from the given projection matrix and max far value.
.split( breaks : Array.<number>, target : Array.<CSMFrustum> )Splits the CSM frustum by the given array. The new CSM frustum are pushed into the given target array.
.toSpace( cameraMatrix : Matrix4, target : CSMFrustum )Transforms the given target CSM frustum into the different coordinate system defined by the given camera matrix.

Key Takeaways

  1. Most relevant properties: vertices, zFar, zNear.
  2. Key methods: setFromProjectionMatrix, split, toSpace.

Connects To