Values and type information for geometry attributes. A
Geometry
一般包含一个或多个属性. 所有属性一起形成
几何的顶点.
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
optional
下列属性的对象 :
|
Throws:
-
DeveloperError : options.componentsPerAttribute must be between 1 and 4.
Example:
const geometry = new Cesium.Geometry({
attributes : {
position : new Cesium.GeometryAttribute({
componentDatatype : Cesium.ComponentDatatype.FLOAT,
componentsPerAttribute : 3,
values : new Float32Array([
0.0, 0.0, 0.0,
7500000.0, 0.0, 0.0,
0.0, 7500000.0, 0.0
])
})
},
primitiveType : Cesium.PrimitiveType.LINE_LOOP
});
See:
Members
componentDatatype : ComponentDatatype
The datatype of each component in the attribute, e.g., individual elements in
GeometryAttribute#values.
1到4之间的数字,用于定义一个属性中的组件数.
例如,一个带有x、y和z组件的位置属性将具有3作为
在代码示例中显示.
Example:
attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
attribute.componentsPerAttribute = 3;
attribute.values = new Float32Array([
0.0, 0.0, 0.0,
7500000.0, 0.0, 0.0,
0.0, 7500000.0, 0.0
]);
当 NT 0 true NT 1 和 NT 2 组件Datatype NT 3 是一个整数格式时,
indicate that the components should be mapped to the range [0, 1] (unsigned)
或[-1, 1] (署名),当它们作为浮点进行渲染时.
这在使用 ComponentDatatype.UNSIGNED_BYTE 存储颜色时常用.
-
Default Value:
false
Example:
attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
attribute.componentsPerAttribute = 4;
attribute.normalize = true;
attribute.values = new Uint8Array([
Cesium.Color.floatToByte(color.red),
Cesium.Color.floatToByte(color.green),
Cesium.Color.floatToByte(color.blue),
Cesium.Color.floatToByte(color.alpha)
]);
values : Array.<number>|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array
输入数组中存储属性的值 。 在代码示例中,
在 NT 0 值 NT 1 中,每三个元素定义一个属性,因为
-NT~0~组件PerAttize NT~1~为3.
Example:
attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
attribute.componentsPerAttribute = 3;
attribute.values = new Float32Array([
0.0, 0.0, 0.0,
7500000.0, 0.0, 0.0,
0.0, 7500000.0, 0.0
]);