Three.js API手册

动画
AnimationAction AnimationClip AnimationMixer AnimationObjectGroup AnimationUtils KeyframeTrack PropertyBinding PropertyMixer
动画 / 轨道
BooleanKeyframeTrack ColorKeyframeTrack NumberKeyframeTrack QuaternionKeyframeTrack StringKeyframeTrack VectorKeyframeTrack
音频
Audio AudioAnalyser AudioContext AudioListener PositionalAudio
摄像机
ArrayCamera Camera CubeCamera OrthographicCamera PerspectiveCamera StereoCamera
常量
Animation Core CustomBlendingEquation DrawModes Materials Renderer Textures
核心
BufferAttribute BufferGeometry Clock DirectGeometry EventDispatcher Face3 Geometry InstancedBufferAttribute InstancedBufferGeometry InstancedInterleavedBuffer InterleavedBuffer InterleavedBufferAttribute Layers Object3D Raycaster Uniform
核心 / BufferAttributes
BufferAttribute_Types
弃用列表
DeprecatedList
附件
Earcut ShapeUtils
附件 / 核心
Curve CurvePath Font Interpolations Path Shape ShapePath
附件 / 曲线
ArcCurve CatmullRomCurve3 CubicBezierCurve CubicBezierCurve3 EllipseCurve LineCurve LineCurve3 QuadraticBezierCurve QuadraticBezierCurve3 SplineCurve
附件 / 物体
ImmediateRenderObject
几何体
BoxBufferGeometry BoxGeometry CircleBufferGeometry CircleGeometry ConeBufferGeometry ConeGeometry CylinderBufferGeometry CylinderGeometry DodecahedronBufferGeometry DodecahedronGeometry EdgesGeometry ExtrudeBufferGeometry ExtrudeGeometry IcosahedronBufferGeometry IcosahedronGeometry LatheBufferGeometry LatheGeometry OctahedronBufferGeometry OctahedronGeometry ParametricBufferGeometry ParametricGeometry PlaneBufferGeometry PlaneGeometry PolyhedronBufferGeometry PolyhedronGeometry RingBufferGeometry RingGeometry ShapeBufferGeometry ShapeGeometry SphereBufferGeometry SphereGeometry TetrahedronBufferGeometry TetrahedronGeometry TextBufferGeometry TextGeometry TorusBufferGeometry TorusGeometry TorusKnotBufferGeometry TorusKnotGeometry TubeBufferGeometry TubeGeometry WireframeGeometry
辅助对象
ArrowHelper AxesHelper BoxHelper Box3Helper CameraHelper DirectionalLightHelper FaceNormalsHelper GridHelper PolarGridHelper PositionalAudioHelper HemisphereLightHelper PlaneHelper PointLightHelper RectAreaLightHelper SkeletonHelper SpotLightHelper VertexNormalsHelper
灯光
AmbientLight DirectionalLight HemisphereLight Light PointLight RectAreaLight SpotLight
灯光 / 阴影
DirectionalLightShadow LightShadow SpotLightShadow
加载器
AnimationLoader AudioLoader BufferGeometryLoader Cache CompressedTextureLoader CubeTextureLoader DataTextureLoader FileLoader FontLoader ImageBitmapLoader ImageLoader Loader LoaderUtils MaterialLoader ObjectLoader TextureLoader
加载器 / 管理器
DefaultLoadingManager LoadingManager
材质
LineBasicMaterial LineDashedMaterial Material MeshBasicMaterial MeshDepthMaterial MeshDistanceMaterial MeshLambertMaterial MeshMatcapMaterial MeshNormalMaterial MeshPhongMaterial MeshPhysicalMaterial MeshStandardMaterial MeshToonMaterial PointsMaterial RawShaderMaterial ShaderMaterial ShadowMaterial SpriteMaterial
数学库
Box2 Box3 Color Cylindrical Euler Frustum Interpolant Line3 Math Matrix3 Matrix4 Plane Quaternion Ray Sphere Spherical Triangle Vector2 Vector3 Vector4
数学库 / 插值
CubicInterpolant DiscreteInterpolant LinearInterpolant QuaternionLinearInterpolant
物体
Bone Group Line LineLoop LineSegments LOD Mesh Points Skeleton SkinnedMesh Sprite
渲染器
WebGLMultisampleRenderTarget WebGLRenderer WebGLRenderTarget WebGLRenderTargetCube
渲染器 / 着色器
ShaderChunk ShaderLib UniformsLib UniformsUtils
场景
Fog FogExp2 Scene
纹理贴图
CanvasTexture CompressedTexture CubeTexture DataTexture DataTexture3D DepthTexture Texture VideoTexture
在线工具推荐: Three.js AI纹理开发包 - YOLO合成数据生成器 - GLTF/GLB在线编辑 - 3D模型格式在线转换 - 可编程3D场景编辑器

平面(Plane)

在三维空间中无限延伸的二维平面,平面方程用单位长度的法向量和常数表示为海塞法向量Hessian normal form形式。

构造器(Constructor)

Plane( normal : Vector3, constant : Float )

normal - (可选参数) 定义单位长度的平面法向量Vector3。默认值为 (1, 0, 0)
constant - (可选参数) 从原点到平面的有符号距离。 默认值为 0.

属性(Properties)

# .normal : Vector3

# .constant : Float

方法(Methods)

# .applyMatrix4 ( matrix : Matrix4, optionalNormalMatrix : Matrix3 ) : Plane

matrix - 要应用的四位矩阵(Matrix4)。
optionalNormalMatrix - (可选参数) 预先计算好的上述Matrix4参数的法线矩阵 Matrix3。

在平面上应用矩阵。矩阵必须是仿射齐次变换。
如果提供一个optionalNormalMatrix,可以这样创建: var optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );

# .clone () : Plane

返回一个与当前平面有相同法线 normal,常量 constant 距离的平面。

# .coplanarPoint ( target : Vector3 ) : Vector3

target — 结果会拷贝到该向量中。

返回一个共面点,通过原点的法向量在平面上投影算得。

# .copy ( plane : Plane ) : Plane

拷贝给定平面,将其中的法线 normal,距离常量 constant属性拷贝给该对象。

# .distanceToPoint ( point : Vector3 ) : Float

返回点point到平面的有符号距离。

# .distanceToSphere ( sphere : Sphere ) : Float

返回球面 sphere 的边缘到平面的最短距离。

# .equals ( plane : Plane ) : Boolean

检查两个平面是否相等。(法线 normal 以及常量 constant 都相同)。

# .intersectLine ( line : Line3, target : Vector3 ) : Vector3

line - 检测是否相交的三维几何线段 Line3。
target — 结果将会写入该向量中。

返回给定线段和平面的交点。如果不相交则返回undefined。如果线与平面共面,则返回该线段的起始点。

# .intersectsBox ( box : Box3 ) : Boolean

box - 检查是否相交的包围盒 Box3。

确定该平面是否与给定3d包围盒Box3相交。

# .intersectsLine ( line : Line3 ) : Boolean

line - 检查是否相交的三维线段 Line3。

测试线段是否与平面相交。

# .intersectsSphere ( sphere : Sphere ) : Boolean

sphere - 检查是否相交的球体 Sphere。

确定该平面是否与给定球体 Sphere 相交。

# .negate () : Plane

将法向量与常量求反(乘以-1)。

# .normalize () : Plane

归一化法向量 normal ,并相应的调整常量 constant数值。

# .projectPoint ( point : Vector3, target : Vector3 ) : Vector3

point - 需要投射到该平面的点。
target — 在该平面上离投射点最近的点。

将一个点point投射到该平面上。

# .set ( normal : Vector3, constant : Float ) : Plane

normal - 单位长度的向量表示平面的法向量。
constant - 原点到平面有符号距离。默认值为 0

设置平面 normal 的法线和常量 constant 属性值。

# .setComponents ( x : Float, y : Float, z : Float, w : Float ) : Plane

x - 单位长度法向量的x值。
y - 单位长度法向量的y值。
z - 单位长度法向量的z值。
w - 原点沿法向量到平面常量 constant 距离。

设置定义平面的各个变量。

# .setFromCoplanarPoints ( a : Vector3, b : Vector3, c : Vector3 ) : Plane

a - 用于确定平面的第一个点。
b - 用于确定平面的第二个点。
c - 用于确定平面的第三个点。

根据给定的三个点确定平面。如果三个点共线将会抛出错误。通过右手螺旋规则确定(向量叉乘)法向量 normal。

# .setFromNormalAndCoplanarPoint ( normal : Vector3, point : Vector3 ) : Plane this : Vector3

normal - 平面单位法向量
point - 平面上的点

通过平面上的一点以及法线确定原点到平面的最短距离(常量)。

# .translate ( offset : Vector3 ) : Plane

offset - 平移量

将平面平移给定向量大小,注意:这只会影响平面的常量不会影响平面的法向量。

Source

src/math/Plane.js