顶点格式定义构成顶点的属性。 可以提供 VertexFormat
更改为
Geometry
以请求计算某些属性,例如,仅计算 position,
位置和法线等。
Name | Type | Description |
---|---|---|
options |
object | optional 一个具有布尔属性的对象,对应于 VertexFormat 属性,如代码示例所示。 |
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
具有已知属性的不可变顶点格式: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
具有 position 和 color 属性的不可变顶点格式。
static constant Cesium.VertexFormat.POSITION_AND_NORMAL : VertexFormat
具有 position 和 normal 属性的不可变顶点格式。
这与每个实例的颜色外观兼容,例如
PerInstanceColorAppearance
。
static constant Cesium.VertexFormat.POSITION_AND_ST : VertexFormat
具有 position 和 st 属性的不可变顶点格式。
这与
EllipsoidSurfaceAppearance
兼容。
static constant Cesium.VertexFormat.POSITION_NORMAL_AND_ST : VertexFormat
具有 position、normal 和 st 属性的不可变顶点格式。
这与
MaterialAppearance
兼容,当 MaterialAppearance#materialSupport
为 TEXTURED/code>。
static constant Cesium.VertexFormat.POSITION_ONLY : VertexFormat
仅具有 position 属性的不可变顶点格式。
如果为
true
,则顶点具有双切线属性 (规格化),该属性用于凹凸贴图等切线空间效果。
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
,则顶点具有切线属性(规格化),该属性用于凹凸贴图等切线空间效果。
32 位浮点。 每个属性 3 个组件。
-
Default Value:
false
Methods
static Cesium.VertexFormat.clone(vertexFormat, result) → VertexFormat
复制VertexFormat实例。
Name | Type | Description |
---|---|---|
vertexFormat |
VertexFormat | The vertex format to duplicate. |
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 实例(如果未提供)。