VertexFormat

new Cesium.VertexFormat(options)

顶点格式定义了构成顶点的属性。可以将VertexFormat提供给 Geometry以请求计算某些属性,例如,仅位置、 位置和法线等。
Name Type Description
options object optional 一个具有布尔属性的对象,对应于代码示例中所示的VertexFormat属性。
Example:
// Create a vertex format with position and 2D texture coordinate attributes.
const format = new Cesium.VertexFormat({
  position : true,
  st : true
});
See:

Members

static constant Cesium.VertexFormat.ALL : VertexFormat

一个不可变的顶点格式,包含众所周知的属性:位置、法线、st、切线和副切线。
See:

static constant Cesium.VertexFormat.DEFAULT : VertexFormat

一个不可变的顶点格式,包含位置、法线和st属性。 这与大多数外观和材质兼容;然而,法线和st属性并不总是必需的。 当已知这一点时,应该使用另一种 VertexFormat
See:

static Cesium.VertexFormat.packedLength : number

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

static constant Cesium.VertexFormat.POSITION_AND_COLOR : VertexFormat

一个不可变的顶点格式,包含位置和颜色属性。
See:

static constant Cesium.VertexFormat.POSITION_AND_NORMAL : VertexFormat

一个具有位置和法线属性的不可变顶点格式。 这与像 PerInstanceColorAppearance 的每实例颜色外观兼容。
See:

static constant Cesium.VertexFormat.POSITION_AND_ST : VertexFormat

一个不可变的顶点格式,包含位置和st属性。 这与 EllipsoidSurfaceAppearance 兼容。
See:

static constant Cesium.VertexFormat.POSITION_NORMAL_AND_ST : VertexFormat

一个不可变的顶点格式,包含位置、法线和st属性。 当 MaterialAppearanceMaterialAppearance#materialSupportTEXTURED 时,与其兼容。
See:

static constant Cesium.VertexFormat.POSITION_ONLY : VertexFormat

一个只有位置属性的不可变顶点格式。
See:
true 时,顶点具有切线属性(归一化),用于切线空间效果,如凹凸贴图。

32位浮点数。每个属性3个分量。

Default Value: false
true 时,顶点具有RGB颜色属性。

8位无符号字节。每个属性3个分量。

Default Value: false
true 时,顶点具有法线属性(归一化),通常用于照明。

32位浮点数。每个属性3个分量。

Default Value: false
true 时,顶点具有3D位置属性。

64位浮点数(用于精度)。每个属性3个分量。

Default Value: false
true 时,顶点具有2D纹理坐标属性。

32位浮点数。每个属性2个分量。

Default Value: false
true 时,顶点具有切线属性(归一化),用于切线空间效果,如凹凸贴图。

32位浮点数。每个属性3个分量。

Default Value: false

Methods

static Cesium.VertexFormat.clone(vertexFormat, result)VertexFormat

复制一个VertexFormat实例。
Name Type Description
vertexFormat VertexFormat 要复制的顶点格式。
result VertexFormat optional 存储结果的对象。
Returns:
修改后的结果参数,如果未提供则返回一个新的VertexFormat实例。(如果vertexFormat是undefined,则返回undefined)

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

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

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

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