BoxGeometry

new Cesium.BoxGeometry(options)

描述一个以原点为中心的立方体。
Name Type Description
options object 具有以下属性的对象:
Name Type Default Description
minimum Cartesian3 盒子的最小 x、y 和 z 坐标。
maximum Cartesian3 盒子的最大 x、y 和 z 坐标。
vertexFormat VertexFormat VertexFormat.DEFAULT optional 要计算的顶点属性。
Example:
const box = new Cesium.BoxGeometry({
  vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
  minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
});
const geometry = Cesium.BoxGeometry.createGeometry(box);
Demo:
See:

Members

static Cesium.BoxGeometry.packedLength : number

用于将对象打包到数组中的元素数量。

Methods

static Cesium.BoxGeometry.createGeometry(boxGeometry)Geometry|undefined

计算盒子的几何表示,包括其顶点、索引和包围球。
Name Type Description
boxGeometry BoxGeometry 盒子的描述。
Returns:
计算得到的顶点和索引。

static Cesium.BoxGeometry.fromAxisAlignedBoundingBox(boundingBox)BoxGeometry

根据轴对齐包围盒的尺寸创建一个立方体。
Name Type Description
boundingBox AxisAlignedBoundingBox 对轴对齐包围盒的描述。
Returns:
Example:
const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
     -72.0, 40.0,
     -70.0, 35.0,
     -75.0, 30.0,
     -70.0, 30.0,
     -68.0, 40.0
]));
const box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);
See:

static Cesium.BoxGeometry.fromDimensions(options)BoxGeometry

根据其尺寸创建一个以原点为中心的立方体。
Name Type Description
options object 具有以下属性的对象:
Name Type Default Description
dimensions Cartesian3 盒子的宽度、深度和高度,分别存储在 Cartesian3 的 x、y 和 z 坐标中。
vertexFormat VertexFormat VertexFormat.DEFAULT optional 要计算的顶点属性。
Returns:
Throws:
Example:
const box = Cesium.BoxGeometry.fromDimensions({
  vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
});
const geometry = Cesium.BoxGeometry.createGeometry(box);
See:

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

将提供的实例存储到提供的数组中.
Name Type Default Description
value BoxGeometry 要打包的值.
array Array.<number> 要打包到的数组.
startingIndex number 0 optional 开始打包元素的数组索引.
Returns:
被打包成的数组

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

从打包数组中检索实例。
Name Type Default Description
array Array.<number> 压缩数组。
startingIndex number 0 optional 需要解包的元素的起始索引。
result BoxGeometry optional 存储结果的对象。
Returns:
修改后的结果参数,如果未提供则返回一个新的 BoxGeometry 实例。
需要帮助?获得答案的最快方法是来自社区和团队 Cesium Forum.