English中文

VertexFormat

new Cesium.VertexFormat(options)

顶点格式定义了构成顶点的属性。可以将 VertexFormat 提供给 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.
名称 Name 类型 Type 说明 Description
options object 可选 optional 具有与 VertexFormat 属性相对应的布尔属性的对象,如代码示例中所示。 An object with boolean properties corresponding to VertexFormat properties as shown in the code example.
示例: 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、切线和双切线。 An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.
另见: See:

static constant Cesium.VertexFormat.DEFAULT : VertexFormat

具有位置、法线和 st 属性的不可变顶点格式。这与大多数外观和材料兼容;然而,普通和 st 属性并不总是必需的。当事先知道这一点时,另一个 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.
另见: See:

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.
另见: See:

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.
另见: See:

static constant Cesium.VertexFormat.POSITION_AND_ST : VertexFormat

具有位置和 st 属性的不可变顶点格式。这与兼容 An immutable vertex format with position and st attributes. This is compatible with EllipsoidSurfaceAppearance.
另见: See:

static constant Cesium.VertexFormat.POSITION_NORMAL_AND_ST : VertexFormat

具有位置、法线和 st 属性的不可变顶点格式。这与兼容 An immutable vertex format with position, normal, and st attributes. This is compatible with MaterialAppearance when MaterialAppearance#materialSupport is TEXTURED/code>.
See:

static constant Cesium.VertexFormat.POSITION_ONLY : VertexFormat

An immutable vertex format with only a position attribute.
See:
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.

Default Value: false
When true, the vertex has an RGB color attribute.

8-bit unsigned byte. 3 components per attribute.

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

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

Default Value: false
When true, the vertex has a 3D position attribute.

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

Default Value: false
When true, the vertex has a 2D texture coordinate attribute.

32-bit floating-point. 2 components per attribute

Default Value: 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.

Default Value: false

Methods

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

Duplicates a VertexFormat instance.
Name Type Description
vertexFormat VertexFormat The vertex format to duplicate.
result VertexFormat optional The object onto which to store the result.
Returns:
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.
Name Type Default Description
value VertexFormat The value to pack.
array Array.<number> The array to pack into.
startingIndex number 0 optional The index into the array at which to start packing the elements.
Returns:
The array that was packed into

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

Retrieves an instance from a packed array.
Name Type Default Description
array Array.<number> The packed array.
startingIndex number 0 optional The starting index of the element to be unpacked.
result VertexFormat optional The object into which to store the result.
Returns:
The modified result parameter or a new VertexFormat instance if one was not provided.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.