VertexFormat

new Cesium.VertexFormat(options)

顶点格式定义了构成顶点的属性。可以向Geometry提供VertexFormat来请求计算某些属性,例如仅位置、位置和法线等。
Name Type Description
options object optional 具有与VertexFormat属性对应的布尔属性的对象,如代码示例所示。
Example:
// 创建具有位置和2D纹理坐标属性的顶点格式。
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属性的不可变顶点格式。 当MaterialAppearance#materialSupportTEXTURED时,这与MaterialAppearance兼容。
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:
修改后的result参数,如果未提供则返回新的VertexFormat实例。(如果vertexFormat未定义则返回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:
修改后的result参数,如果未提供则返回新的VertexFormat实例。
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.