Class: OrthographicCamera
正交相机(在这种投影模式下,无论物体距离相机距离远或者近,在最终渲染的图片中物体的大小都保持不变)
代码示例:
const camera = new OrthographicCamera(width / - 2, width / 2, height / 2, height / - 2, 1, 1000);
scene.add(camera);
Hierarchy
-
↳
OrthographicCamera
Table of contents
Constructors
Properties
- cameraType
- projectionMatrix
- viewMatrix
- projectionViewMatrix
- worldPosition
- frustum
- visible
- localMatrix
- worldMatrix
- matrixAutoUpdate
- position
- scale
- rotation
- quaternion
- up
- children
- parent
- worldMatrixNeedsUpdate
Accessors
Methods
- perspective
- orthographic
- lookAt
- updateMatrixWorld
- frustumIntersectsMesh
- project
- unproject
- updateProjectionMatrix
- add
- remove
- contains
- setParent
- traverse
- updateMatrix
- decompose
- clone
- copy
Constructors
constructor
• new OrthographicCamera(left
, right
, top
, bottom
, near
, far
, zoom?
): OrthographicCamera
Parameters
Name | Type | Default value |
---|---|---|
left | any | undefined |
right | any | undefined |
top | any | undefined |
bottom | any | undefined |
near | any | undefined |
far | any | undefined |
zoom | number | 1 |
Returns
Overrides
Defined in
src/cameras/OrthographicCamera.ts:14
Properties
cameraType
• cameraType: CameraType
相机类型(默认有两种相机:perspective和orthographic)
Inherited from
Defined in
projectionMatrix
• projectionMatrix: ProjectionMatrix
投影矩阵
Inherited from
Defined in
viewMatrix
• viewMatrix: Matrix4
视图矩阵
Inherited from
Defined in
projectionViewMatrix
• projectionViewMatrix: ProjectionMatrix
pv矩阵,它是 projectionMatrix
和viewMatrix
的乘积
Inherited from
Defined in
worldPosition
• worldPosition: Vector3
世界位置坐标
Inherited from
Defined in
frustum
• frustum: Matrix4
Inherited from
Defined in
visible
• visible: boolean
是否可见
Inherited from
Defined in
localMatrix
• localMatrix: ProjectionMatrix
局部变换矩阵
Inherited from
Defined in
worldMatrix
• worldMatrix: ProjectionMatrix
物体的世界变换矩阵 (如果没有父级,那么他和局部变化矩阵相同)
Inherited from
Defined in
matrixAutoUpdate
• matrixAutoUpdate: boolean
当这个属性设置了之后,它将计算每一帧的位移、旋转(四元变换)和缩放矩阵,并重新计算 worldMatrix
属性
Inherited from
Defined in
position
• position: Vector3
物体局部位置
Inherited from
Defined in
scale
• scale: Vector3
物体的局部缩放
Inherited from
Defined in
rotation
• rotation: Euler
物体的局部旋转
Inherited from
Defined in
quaternion
• quaternion: Quaternion
物体的局部旋转
Inherited from
Defined in
up
• up: Vector3
物体的朝向
Inherited from
Defined in
children
• children: Object3D
[]
对象子级
Inherited from
Defined in
parent
• parent: WithNull
<Object3D
>
对象父级
Inherited from
Defined in
worldMatrixNeedsUpdate
• worldMatrixNeedsUpdate: boolean
当这个属性设置了之后,它将计算在那一帧中的 worldMatrix
,并将这个值重置为false。默认值为false
Inherited from
Defined in
Accessors
near
• get
near(): number
获取像机的近端面
Returns
number
Inherited from
Camera.near
Defined in
• set
near(n
): void
设置像机的近端面,并更新摄像机投影矩阵