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场景编辑器

数学函数(Math)

具有多个数学实用函数的对象。

函数(Functions)

# .clamp ( value : Float, min : Float, max : Float ) : Float

value — 需要clamp处理的值。
min — 最小值。
max — 最大值。

限制数值value处于最小值min和最大值max之间。

# .degToRad ( degrees : Float ) : Float

将度转化为弧度。

# .euclideanModulo ( n : Integer, m : Integer ) : Integer

n, m - 整型

计算 m % n 的欧几里得模: ( ( n % m ) + m ) % m

# .generateUUID ( ) : UUID

创建一个全局唯一标识符 UUID

# .isPowerOfTwo ( n : Number ) : Boolean

如果 n 是2的幂,返回true。

# .lerp ( x : Float, y : Float, t : Float ) : Float

x - 起始点。
y - 终点。
t - 封闭区间[0,1]内的插值因子。

返回给定区间的线性插值linearly interpolated结果 - t = 0 将会返回 x 如果 t = 1 将会返回 y.

# .mapLinear ( x : Float, a1 : Float, a2 : Float, b1 : Float, b2 : Float ) : Float

x — 用于映射的值。
a1 — A区间最小值。
a2 — A区间最大值。
b1 — B区间最小值。
b2 — A区间最大值。

x从范围[a1, a2] 到范围[b1, b2]的线性映射。

# .ceilPowerOfTwo ( n : Number ) : Integer

返回大于等于 n 的2的最小次幂。

# .floorPowerOfTwo ( n : Number ) : Integer

返回小于等于 n 的2的最大幂。

# .radToDeg ( radians : Float ) : Float

将弧度转换为角度。

# .randFloat ( low : Float, high : Float ) : Float

在区间low 到 high随机一个浮点数。

# .randFloatSpread ( range : Float ) : Float

在区间*- range / 2* 到 *range / 2*随机一个浮点数。

# .randInt ( low : Integer, high : Integer ) : Integer

在区间low 到 high随机一个整数。

# .smoothstep ( x : Float, min : Float, max : Float ) : Float

x - 根据其在最小值和最大值之间的位置来计算的值。
min - 任何x比最小值还小会返回0.
max - 任何x比最大值还大会返回0.

返回0-1之间的值,该值表示x在最小值和最大值之间移动的百分比,但是当x接近最小值和最大值时,变化程度会平滑或减慢。

查看更多详情请移步到 Smoothstep

# .smootherstep ( x : Float, min : Float, max : Float ) : Float

x - 根据其在最小值和最大值之间的位置来计算的值。
min - 任何x比最小值还小会返回0.
max - 任何x比最大值还大会返回0.

返回一个0-1之间的值。它和smoothstep相同,但变动更平缓。variation on smoothstep 在x=0和x=1处有0阶和二阶导数。

Source

src/math/Math.js