顶点格式定义了构成一个顶点的属性。可以将 VertexFormat 提供给
Geometry 以请求计算某些属性,例如仅位置、
位置加法线等。
| 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 属性的不可变顶点格式。
它与大多数外观(appearance)和材质兼容;然而
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#materialSupport
为 TEXTURED/code> 时,它与 MaterialAppearance 兼容。
static constant Cesium.VertexFormat.POSITION_ONLY : VertexFormat
一个仅包含 position 属性的不可变顶点格式。
当为
true 时,顶点具有 bitangent 属性(已归一化),用于法线贴图等切线空间效果。
32 位浮点数。每个属性 3 个分量。
-
Default Value:
false
当为
true 时,顶点具有 RGB 颜色属性。
8 位无符号字节。每个属性 3 个分量。
-
Default Value:
false
当为
true 时,顶点具有 normal 属性(已归一化),通常用于光照。
32 位浮点数。每个属性 3 个分量。
-
Default Value:
false
当为
true 时,顶点具有三维 position 属性。
64 位浮点数(用于保证精度)。每个属性 3 个分量。
-
Default Value:
false
当为
true 时,顶点具有二维纹理坐标属性。
32 位浮点数。每个属性 2 个分量
-
Default Value:
false
当为
true 时,顶点具有 tangent 属性(已归一化),用于法线贴图等切线空间效果。
32 位浮点数。每个属性 3 个分量。
-
Default Value:
false
Methods
static Cesium.VertexFormat.clone(vertexFormat, result) → VertexFormat
复制一个 VertexFormat 实例。
| Name | Type | Description |
|---|---|---|
vertexFormat |
VertexFormat | 要复制的顶点格式。 |
result |
VertexFormat | optional 存储结果的物体。 |
Returns:
修改后的 result 参数,如果未提供则为新的 VertexFormat 实例。(如果 vertexFormat 为 undefined,则返回 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:
修改后的 result 参数,如果未提供则为新的 VertexFormat 实例。
