视锥由6个平面定义。每个平面由一个
Cartesian4对象表示,其中x、y和z分量定义了与平面垂直的单位矢量,w分量是平面到原点/相机位置的距离。
Example:
var maxRadii = ellipsoid.maximumRadius;
var frustum = new SuperMap3D.OrthographicOffCenterFrustum();
frustum.near = 0.01 * maxRadii;
frustum.far = 50.0 * maxRadii;
Members
-
底部裁剪平面。
-
Default Value:
undefined -
远平面的距离。
-
Default Value:
500000000.0; -
远平面的距离。
-
Default Value:
500000000.0; -
左侧裁剪平面。
-
Default Value:
undefined -
近平面的距离。
-
Default Value:
1.0 -
近平面的距离。
-
Default Value:
1.0 -
readonlyprojectionMatrix : Matrix4
-
获取根据视锥计算出的正投影矩阵。
-
右侧裁剪平面。
-
Default Value:
undefined -
顶部裁剪平面。
-
Default Value:
undefined
Methods
-
clone(result) → OrthographicOffCenterFrustum
-
返回 OrthographicOffCenterFrustum 实例的副本。
Name Type Description resultOrthographicOffCenterFrustum optional 存储结果的对象。 Returns:
修改后的结果参数,或者一个新的 OrthographicOffCenterFrustum 实例(如果没有提供)。 -
computeCullingVolume(position, direction, up) → CullingVolume
-
为这个视锥体创建一个裁剪体。
Name Type Description positionCartesian3 视点位置。 directionCartesian3 视线方向。 upCartesian3 向上的方向。 Returns:
在给定位置和方向上的裁剪体。Example:
// Check if a bounding volume intersects the frustum. var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); var intersect = cullingVolume.computeVisibility(boundingVolume); -
比较所提供的 OrthographicOffCenterFrustum 分量,如果相等则返回 true,否则返回 false。
Name Type Description otherOrthographicOffCenterFrustum optional 右侧 OrthographicOffCenterFrustum。 Returns:
如果相等则为 true,否则为 false。 -
getPixelDimensions(drawingBufferWidth, drawingBufferHeight, distance, result) → Cartesian2
-
返回像素的宽度和高度(以米为单位)。
Name Type Description drawingBufferWidthNumber 绘制buffer的宽度。 drawingBufferHeightNumber 绘制buffer的高度。 distanceNumber 到近平面的距离,以米为单位。 resultCartesian2 存储结果的对象。 Returns:
修改后的结果参数或Cartesian2的新实例,其 x 和 y 属性中分别包含像素的宽度和高度。Throws:
-
DeveloperError : drawingBufferWidth 必须大于 0。
-
DeveloperError : drawingBufferHeight 必须大于 0。
Example:
// Example 1 // Get the width and height of a pixel. var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, new SuperMap3D.Cartesian2()); -
