English中文

OrthographicOffCenterFrustum

new Cesium.OrthographicOffCenterFrustum(options)

视锥体由 6 个平面定义。每个平面由一个表示 The viewing frustum is defined by 6 planes. Each plane is represented by a Cartesian4 对象,其中 x、y 和 z 分量定义垂直于平面的单位向量,w 分量是平面距原点/相机位置的距离。 object, where the x, y, and z components define the unit vector normal to the plane, and the w component is the distance of the plane from the origin/camera position.
名称 Name 类型 Type 说明 Description
options object 可选 optional 具有以下属性的对象: An object with the following properties:
名称 Name 类型 Type 默认值 Default 说明 Description
left number 可选 optional 左剪裁平面距离。 The left clipping plane distance.
right number 可选 optional 右剪裁平面距离。 The right clipping plane distance.
top number 可选 optional 顶部剪裁平面距离。 The top clipping plane distance.
bottom number 可选 optional 底部剪裁平面距离。 The bottom clipping plane distance.
near number 1.0 可选 optional 近剪裁平面距离。 The near clipping plane distance.
far number 500000000.0 可选 optional 远剪裁平面距离。 The far clipping plane distance.
示例: Example:
const maxRadii = ellipsoid.maximumRadius;

const frustum = new Cesium.OrthographicOffCenterFrustum();
frustum.right = maxRadii * Cesium.Math.PI;
frustum.left = -c.frustum.right;
frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);
frustum.bottom = -c.frustum.top;
frustum.near = 0.01 * maxRadii;
frustum.far = 50.0 * maxRadii;

成员 Members

底部剪裁平面。 The bottom clipping plane.
默认值: Default Value: undefined
远平面的距离。 The distance of the far plane.
默认值: Default Value: 500000000.0;
左剪裁平面。 The left clipping plane.
默认值: Default Value: undefined
近平面的距离。 The distance of the near plane.
默认值: Default Value: 1.0
获取根据视锥体计算的正交投影矩阵。 Gets the orthographic projection matrix computed from the view frustum.
右剪裁平面。 The right clipping plane.
默认值: Default Value: undefined
顶部剪裁平面。 The top clipping plane.
默认值: Default Value: undefined

方法 Methods

返回 OrthographicOffCenterFrustum 实例的副本。 Returns a duplicate of a OrthographicOffCenterFrustum instance.
名称 Name 类型 Type 说明 Description
result OrthographicOffCenterFrustum 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 OrthographicOffCenterFrustum 实例(如果未提供)。 The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided.

computeCullingVolume(position, direction, up)CullingVolume

为此视锥体创建剔除体积。 Creates a culling volume for this frustum.
名称 Name 类型 Type 说明 Description
position Cartesian3 眼睛的位置。 The eye position.
direction Cartesian3 视线方向。 The view direction.
up Cartesian3 向上的方向。 The up direction.
返回: Returns:
给定位置和方向的剔除体积。 A culling volume at the given position and orientation.
示例: Example:
// Check if a bounding volume intersects the frustum.
const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
const intersect = cullingVolume.computeVisibility(boundingVolume);
比较提供的 OrthographicOffCenterFrustum 组件并返回 Compares the provided OrthographicOffCenterFrustum componentwise and returns true 如果它们相等, if they are equal, false otherwise.
名称 Name 类型 Type 说明 Description
other OrthographicOffCenterFrustum 可选 optional 右侧 OrthographicOffCenterFrustum。 The right hand side OrthographicOffCenterFrustum.
返回: Returns:
true 如果它们相等, if they are equal, false otherwise.

equalsEpsilon(other, relativeEpsilon, absoluteEpsilon)boolean

比较提供的 OrthographicOffCenterFrustum 组件并返回 Compares the provided OrthographicOffCenterFrustum componentwise and returns true 如果他们通过了绝对或相对耐受性测试, if they pass an absolute or relative tolerance test, false otherwise.
名称 Name 类型 Type 默认值 Default 说明 Description
other OrthographicOffCenterFrustum 右侧 OrthographicOffCenterFrustum。 The right hand side OrthographicOffCenterFrustum.
relativeEpsilon number 用于相等性测试的相对 epsilon 容差。 The relative epsilon tolerance to use for equality testing.
absoluteEpsilon number relativeEpsilon 可选 optional 用于相等性测试的绝对 epsilon 容差。 The absolute epsilon tolerance to use for equality testing.
返回: Returns:
true 如果这个和其他都在提供的 epsilon 范围内, if this and other are within the provided epsilon, false otherwise.

getPixelDimensions(drawingBufferWidth, drawingBufferHeight, distance, pixelRatio, result)Cartesian2

返回像素的宽度和高度(以米为单位)。 Returns the pixel's width and height in meters.
名称 Name 类型 Type 说明 Description
drawingBufferWidth number 绘图缓冲区的宽度。 The width of the drawing buffer.
drawingBufferHeight number 绘图缓冲区的高度。 The height of the drawing buffer.
distance number 到近平面的距离(以米为单位)。 The distance to the near plane in meters.
pixelRatio number 从像素空间到坐标空间的缩放因子。 The scaling factor from pixel space to coordinate space.
result Cartesian2 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新实例 The modified result parameter or a new instance of Cartesian2 像素的宽度和高度分别位于 x 和 y 属性中。 with the pixel's width and height in the x and y properties, respectively.
抛出: Throws:
  • DeveloperError :drawingBufferWidth 必须大于零。 : drawingBufferWidth must be greater than zero.
  • DeveloperError :drawingBufferHeight 必须大于零。 : drawingBufferHeight must be greater than zero.
  • DeveloperError :pixelRatio 必须大于零。 : pixelRatio must be greater than zero.
示例: Example:
// Example 1
// Get the width and height of a pixel.
const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.