| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
具有以下属性的对象:
|
Example:
// 为盒子创建几何体,以及两个引用它的实例。
// 一个实例将盒子定位在底部并着色为水色。
// 另一个实例将盒子定位在顶部并着色为白色。
const geometry = Cesium.BoxGeometry.fromDimensions({
vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
});
const instanceBottom = new Cesium.GeometryInstance({
geometry : geometry,
modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
},
id : 'bottom'
});
const instanceTop = new Cesium.GeometryInstance({
geometry : geometry,
modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()),
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
},
id : 'top'
});
See:
Members
每个实例的属性,如
ColorGeometryInstanceAttribute 或 ShowGeometryInstanceAttribute。
Geometry 属性随顶点变化;这些属性对于整个实例是常数。
-
Default Value:
{}
正在被实例化的几何体。
拾取实例或用于获取/设置每个实例的属性时返回的用户定义对象。
-
Default Value:
undefined
See:
modelMatrix : Matrix4
将几何体从模型坐标转换到世界坐标的4x4变换矩阵。
当这是单位矩阵时,几何体在世界坐标(即地球的WGS84坐标)中绘制。
可以通过提供不同的变换矩阵(如
Transforms.eastNorthUpToFixedFrame 返回的矩阵)来使用局部参考系。
-
Default Value:
Matrix4.IDENTITY
