new Cesium.PerspectiveFrustum(options)

观景浮雕由6架飞机定义. Each plane is represented by a Cartesian4 object, where the x, y, and z components 定义平面正常的单位矢量, w 组件是 飞机从原产地/相机位置起飞.
Name Type Description
options object optional 具有下列属性的天体:
Name Type Default Description
fov number optional 视野的角度( FOV ),用弧度表示.
aspectRatio number optional Frustum的宽度与其高度的宽度之比.
near number 1.0 optional 近平面的距离.
far number 500000000.0 optional The distance of the far plane.
xOffset number 0.0 optional x 方向的乘数.
yOffset number 0.0 optional 向Y方向冲抵.
Example:
const frustum = new Cesium.PerspectiveFrustum({
    fov : Cesium.Math.PI_OVER_THREE,
    aspectRatio : canvas.clientWidth / canvas.clientHeight
    near : 1.0,
    far : 1000.0
});
See:

Members

static Cesium.PerspectiveFrustum.packedLength : number

用于将对象组合成数组的元素数量.

aspectRatio : number|undefined

Frustum的宽度与其高度的宽度之比.
Default Value: undefined

far : number

远方飞机的距离.
Default Value: 500000000.0

fov : number|undefined

视野的角度( FOV ),用弧度表示. 此角度将被使用 如果宽度大于高度, 则作为水平 NT+ 0 , 否则 这将是垂直的 NT 0 .
Default Value: undefined

readonly fovy : number|undefined

获得垂直视野的角度,以弧度表示.
Default Value: undefined

readonly infiniteProjectionMatrix : Matrix4

透视投影矩阵 以无限远的平面计算.
See:

near : number

近机之远.
Default Value: 1.0

readonly projectionMatrix : Matrix4

从视图中计算出视角预测矩阵. 如有必要,将重新计算预测矩阵.
See:

xOffset : number

将frustum向x方向偏移.
Default Value: 0.0

yOffset : number

将阴茎向y方向抵消.
Default Value: 0.0

Methods

static Cesium.PerspectiveFrustum.pack(value, array, startingIndex)Array.<number>

将所提供的实例存储到所提供的数组中.
Name Type Default Description
value PerspectiveFrustum 包装的价值.
array Array.<number> 装入的阵列.
startingIndex number 0 optional The index into the array at which to start packing the elements.
Returns:
装入的阵列

static Cesium.PerspectiveFrustum.unpack(array, startingIndex, result)PerspectiveFrustum

从组合的数组中获取实例 .
Name Type Default Description
array Array.<number> 装填的阵列.
startingIndex number 0 optional The starting index of the element to be unpacked.
result PerspectiveFrustum optional 存储结果的对象.
Returns:
未提供修改的结果参数或新的 PerspectFrustum 实例 .

clone(result)PerspectiveFrustum

返回 PerspectFrustum 实例的复制件.
Name Type Description
result PerspectiveFrustum optional 存储结果的对象 .
Returns:
未提供修改的结果参数或新的 PerspectFrustum 实例 .

computeCullingVolume(position, direction, up)CullingVolume

为这个 flustum 创建调制音量 .
Name Type Description
position Cartesian3 眼处.
direction Cartesian3 风景方向.
up Cartesian3 上升方向.
Returns:
在给定的位置和方向上,有一个凸起的卷.
Example:
// Check if a bounding volume intersects the frustum.
const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
const intersect = cullingVolume.computeVisibility(boundingVolume);

equals(other)boolean

比较所提供的 PerspectFrustum 组件并返回 -NT+0+Treal NT+1+,如果两者是相等的, NT+2+false NT+3+否则.
Name Type Description
other PerspectiveFrustum optional 右手侧透视Frustum.
Returns:
-NT+0+Treal NT+1+,如果两者是相等的, NT+2+false NT+3+否则.

equalsEpsilon(other, relativeEpsilon, absoluteEpsilon)boolean

比较所提供的 PerspectFrustum 组件并返回 如果通过绝对或相对耐性测试, -NT+0+false NT+1+否则.
Name Type Default Description
other PerspectiveFrustum 右手侧透视Frustum.
relativeEpsilon number 相对epsilon的耐受性用于平等测试.
absoluteEpsilon number 相对Epsilon optional 绝对的埃皮西隆耐受性用于平等测试.
Returns:
NT########################################################### ##################################################################################################################################################################################################.

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

返回像素的宽度和高度,以米计.
Name Type Description
drawingBufferWidth number 绘图缓冲器的宽度 .
drawingBufferHeight number 绘画缓冲器的高度.
distance number 距离近机以米计.
pixelRatio number 从像素空间到协调空间的缩放因子.
result Cartesian2 存储结果的对象 .
Returns:
The modified result parameter or a new instance of Cartesian2 with the pixel's width and height in the x and y properties, respectively.
Throws:
Examples:
// Example 1
// Get the width and height of a pixel.
const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
// Example 2
// Get the width and height of a pixel if the near plane was set to 'distance'.
// For example, get the size of a pixel of an image on a billboard.
const position = camera.position;
const direction = camera.direction;
const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3());      // vector from camera to a primitive
const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
const distance = Cesium.Cartesian3.magnitude(toCenterProj);
const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.