VertexFormat

new Cesium.VertexFormat(options)

A vertex format defines what attributes make up a vertex. A VertexFormat can be provided to a Geometry to request that certain properties be computed, e.g., just position, position and normal, etc.
参数名称 类型 描述信息
options object 可选 An object with boolean properties corresponding to VertexFormat properties as shown in the code example.
使用示例:
// Create a vertex format with position and 2D texture coordinate attributes.
const format = new Cesium.VertexFormat({
  position : true,
  st : true
});
参考:

成员(属性)

static constant Cesium.VertexFormat.ALL : VertexFormat

An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.
参考:

static constant Cesium.VertexFormat.DEFAULT : VertexFormat

An immutable vertex format with position, normal, and st attributes. This is compatible with most appearances and materials; however normal and st attributes are not always required. When this is known in advance, another VertexFormat should be used.
参考:

static Cesium.VertexFormat.packedLength : number

The number of elements used to pack the object into an array.

static constant Cesium.VertexFormat.POSITION_AND_COLOR : VertexFormat

An immutable vertex format with position and color attributes.
参考:

static constant Cesium.VertexFormat.POSITION_AND_NORMAL : VertexFormat

An immutable vertex format with position and normal attributes. This is compatible with per-instance color appearances like PerInstanceColorAppearance.
参考:

static constant Cesium.VertexFormat.POSITION_AND_ST : VertexFormat

An immutable vertex format with position and st attributes. This is compatible with EllipsoidSurfaceAppearance.
参考:

static constant Cesium.VertexFormat.POSITION_NORMAL_AND_ST : VertexFormat

An immutable vertex format with position, normal, and st attributes. This is compatible with MaterialAppearance when MaterialAppearance#materialSupport is TEXTURED/code>.
参考:

static constant Cesium.VertexFormat.POSITION_ONLY : VertexFormat

An immutable vertex format with only a position attribute.
参考:
When true, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.

32-bit floating-point. 3 components per attribute.

默认值: false
When true, the vertex has an RGB color attribute.

8-bit unsigned byte. 3 components per attribute.

默认值: false
When true, the vertex has a normal attribute (normalized), which is commonly used for lighting.

32-bit floating-point. 3 components per attribute.

默认值: false
When true, the vertex has a 3D position attribute.

64-bit floating-point (for precision). 3 components per attribute.

默认值: false
When true, the vertex has a 2D texture coordinate attribute.

32-bit floating-point. 2 components per attribute

默认值: false
When true, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.

32-bit floating-point. 3 components per attribute.

默认值: false

方法

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

Duplicates a VertexFormat instance.
参数名称 类型 描述信息
vertexFormat VertexFormat The vertex format to duplicate.
result VertexFormat 可选 The object onto which to store the result.
返回值:
The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)

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

Stores the provided instance into the provided array.
参数名称 类型 默认值 描述信息
value VertexFormat The value to pack.
array Array.<number> The array to pack into.
startingIndex number 0 可选 The index into the array at which to start packing the elements.
返回值:
The array that was packed into

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

Retrieves an instance from a packed array.
参数名称 类型 默认值 描述信息
array Array.<number> The packed array.
startingIndex number 0 可选 The starting index of the element to be unpacked.
result VertexFormat 可选 The object into which to store the result.
返回值:
The modified result parameter or a new VertexFormat instance if one was not provided.