顶点格式定义了顶点的构成属性。
可以向
Geometry
提供一个VertexFormat来要求计算某些属性,例如:位置、位置和法线等。
Name | Type | Description |
---|---|---|
options |
Object | optional 具有与VertexFormat属性对应的布尔属性的对象,如代码示例所示。 |
Example:
// 创建一个顶点格式,带有位置和2D纹理坐标属性。
var format = new Cesium.VertexFormat({
position : true,
st : true
});
See:
Members
staticconstantCesium.VertexFormat.ALL : VertexFormat
一个不可变的顶点格式,具有所有属性:位置、法线、st、切线和bitangent。
See:
staticconstantCesium.VertexFormat.DEFAULT : VertexFormat
具有位置、法线和st属性的不可变顶点格式。
这是兼容的大多数外观和材质;然而,法线和st属性并不总是必需的。
如果预先知道这一点,应该使用另一个
VertexFormat
。
用于将对象打包成数组的元素数。
staticconstantCesium.VertexFormat.POSITION_AND_COLOR : VertexFormat
具有位置和颜色属性的不可变顶点格式。
staticconstantCesium.VertexFormat.POSITION_AND_NORMAL : VertexFormat
具有位置和法线属性的不可变顶点格式。
这与每个实例的颜色外观(如
PerInstanceColorAppearance
)兼容。
staticconstantCesium.VertexFormat.POSITION_AND_ST : VertexFormat
一个不可变的顶点格式具有位置和st属性。
这与
EllipsoidSurfaceAppearance
兼容。
staticconstantCesium.VertexFormat.POSITION_NORMAL_AND_ST : VertexFormat
具有位置、法线和st属性的不可变顶点格式。
当
MaterialAppearance#materialSupport
是TEXTURED/code>时,这与MaterialAppearance
兼容。
staticconstantCesium.VertexFormat.POSITION_ONLY : VertexFormat
一个不可变的顶点格式,只有一个位置属性。
当
true
时,顶点具有bitangent属性(归一化),用于凹凸映射等切线空间效果。
32位浮点。每个属性3个分量。
-
Default Value:
false
当
true
时,顶点具有RGB颜色属性。
8位无符号字节。每个属性3个分量。
-
Default Value:
false
当
true
时,顶点有一个normal属性(归一化),通常用于光照。
32位浮点。每个属性3个分量。
-
Default Value:
false
当
true
时,顶点具有3D位置属性。
64位浮点(用于精度)。每个属性3个分量。
-
Default Value:
false
当
true
时,顶点具有2D纹理坐标属性。
32位浮点。每个属性2个分量。
-
Default Value:
false
当
true
时,顶点有一个tangent属性(归一化),用于凹凸映射等切线空间效果。
32位浮点。每个属性3个分量。
-
Default Value:
false
Methods
staticCesium.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:
被包装到的数组。
staticCesium.VertexFormat.unpack(array, startingIndex, result) → VertexFormat
从已包装的数组中检索实例。
Name | Type | Default | Description |
---|---|---|---|
array |
Array.<Number> | 已包装的数组。 | |
startingIndex |
Number |
0
|
optional 要解包的元素的起始索引。 |
result |
VertexFormat | optional 存储结果的对象。 |
Returns:
已修改的结果参数或新的VertexFormat实例(如果没有提供)。