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

Frustum.intersectsSprite()

The Frustum.intersectsSprite() method is a method of the Frustum class in the three.js library. It is used to test whether a sprite is visible within the frustum.

Syntax

Frustum.intersectsSprite(sprite: Sprite): Boolean
  • sprite is a Sprite object.
  • Boolean returns true if the sprite is visible within the frustum, otherwise it returns false.

Description

A Frustum object is used to define the viewable region of the camera. It is used to determine which objects are visible within the camera's view. The Frustum.intersectsSprite() method determines whether a given sprite is visible within the camera's view.

Examples

// create a sprite
const sprite = new THREE.Sprite(material);

// create a frustum
const frustum = new THREE.Frustum();

// set the frustum's matrix to the camera's projection matrix
frustum.setFromProjectionMatrix(camera.projectionMatrix);

// test whether the sprite is visible within the frustum
const isVisible = frustum.intersectsSprite(sprite);

Notes

  • This method only works for Sprite objects, not for other types of objects.
  • This method does not take into account any culling or occlusion techniques used by the renderer. It only tests whether the sprite is within the frustum as defined by the camera's projection matrix.
  • This method does not take into account any transformations applied to the sprite. It assumes that the sprite is positioned and scaled according to its position and scale properties.

See Also