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

Plane.setComponents()

The Plane.setComponents() method is used to set the components of a plane. A plane is a mathematical concept that defines an infinite, flat surface in three-dimensional space. In three.js, a plane is represented by a Plane object.

Syntax

setComponents(normal: Vector3, constant: number): Plane

The setComponents() method takes two arguments:

  • normal: A Vector3 object representing the normal of the plane.
  • constant: A number representing the distance of the plane from the origin.

The method returns the same Plane object that it was called on.

Example

const plane = new THREE.Plane();
const normal = new THREE.Vector3(0, 1, 0);
const constant = 0;

plane.setComponents(normal, constant);

In this example, a new Plane object is created. The setComponents() method is called on the plane object, passing in a normal vector of [0, 1, 0] and a constant of 0. This sets the components of the plane to be a flat surface that is parallel to the XZ plane and passes through the origin.

Notes

  • The normal argument must be a normalized Vector3 object. If it is not normalized, the setComponents() method will normalize it before setting it as the plane's normal.
  • The constant argument represents the distance of the plane from the origin along its normal vector. In other words, it determines where the plane intersects the Y-axis (in this example).
  • The components of a plane can also be set using the Plane.set() method, which takes four arguments representing the components of the plane's equation: a, b, c, and d.