顶点格式定义了构成顶点的属性。可以提供VertexFormat
向
Geometry
请求计算某些属性,例如只计算位置,
位置和正常等。Name | Type | Description |
---|---|---|
options |
Object | optional 具有与VertexFormat属性相对应的布尔属性的对象,如代码示例中所示。 |
Example:
// Create a vertex format with position and 2D texture coordinate attributes.
var format = new Cesium.VertexFormat({
position : true,
st : true
});
See:
Members
static constant Cesium.VertexFormat.ALL : VertexFormat
一种不可变的顶点格式,具有众所周知的属性:position、normal、st、tangent和bitangent。
See:
static constant Cesium.VertexFormat.DEFAULT : VertexFormat
具有position、normal和st属性的不可变顶点格式。
这与大多数外观和材质兼容;但是
normal和st属性并不总是必需的。当这是
预先知道,应使用另一个
VertexFormat
。用于将对象打包到数组中的元素数。
static constant Cesium.VertexFormat.POSITION_AND_COLOR : VertexFormat
具有位置和颜色属性的不可变顶点格式。
static constant Cesium.VertexFormat.POSITION_AND_NORMAL : VertexFormat
具有位置和法线属性的不可变顶点格式。
这与每个实例的颜色外观(如
PerInstanceColorAppearance
)兼容。static constant Cesium.VertexFormat.POSITION_AND_ST : VertexFormat
具有位置和st属性的不可变顶点格式。
这与
EllipsoidSurfaceAppearance
兼容。static constant Cesium.VertexFormat.POSITION_NORMAL_AND_ST : VertexFormat
具有position、normal和st属性的不可变顶点格式。
当
MaterialAppearance#materialSupport
与MaterialAppearance
兼容时
是TEXTURED/code>.
static constant Cesium.VertexFormat.POSITION_ONLY : VertexFormat
只有位置属性的不可变顶点格式。
当true
时,顶点具有双切线属性(规格化),该属性用于切线空间效果,如凹凸贴图。
32-bit floating-point. 3 components per attribute.
Default Value:
false
当true
时,顶点具有RGB颜色属性。
8-bit unsigned byte. 3 components per attribute.
Default Value:
false
当true
时,顶点具有法线属性(规格化),该属性通常用于照明。
32-bit floating-point. 3 components per attribute.
Default Value:
false
当true
时,顶点具有三维位置属性。
64-bit floating-point (for precision). 3 components per attribute.
Default Value:
false
当true
时,顶点具有2D纹理坐标属性。
32-bit floating-point. 2 components per attribute
Default Value:
false
当true
时,顶点具有切线属性(规格化),该属性用于切线空间效果,如凹凸贴图。
32-bit floating-point. 3 components per attribute.
Default Value:
false
Methods
static Cesium.VertexFormat.clone(vertexFormat, result) → VertexFormat
复制VertexFormat实例。
Name
Type
Description
vertexFormat
VertexFormat
要复制的顶点格式。
result
VertexFormat
optional
要将结果存储到的对象。
Returns:
修改后的结果参数或新的VertexFormat实例(如果未提供实例)。(如果vertexFormat未定义,则返回undefined)
将提供的实例存储到提供的数组中。
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实例(如果未提供实例)。