new VertexFormat(options)
顶点格式定义了构成顶点的属性。 顶点格式可以提供给Geometry 以要求计算某些属性,例如只计算位置、位置和法线等。
| Name | Type | Description |
|---|---|---|
options |
Object |
可选
如代码示例所示,该对象具有与 VertexFormat 属性相对应的布尔属性。 |
- See:
-
- Geometry#attributes
- Packable
Example
// Create a vertex format with position and 2D texture coordinate attributes.
var format = new SuperMap3D.VertexFormat({
position : true,
st : true
});
Members
-
(static, constant) ALLVertexFormat
-
一种不可变的顶点格式,具有属性:位置、法线、st、切线和位切线。
-
(static, constant) DEFAULTVertexFormat
-
这是一种不可变的顶点格式,具有位置、法线和 st 属性。它与大多数外观和材质兼容;但法线和 st 属性并非总是必需的。 如果事先知道这一点,则应使用另一种顶点格式(VertexFormat)。
-
static packedLengthNumber
-
用于将对象打包到数组中的元素个数。
-
(static, constant) POSITION_AND_COLORVertexFormat
-
具有位置和颜色属性的不可变顶点格式。
-
(static, constant) POSITION_AND_NORMALVertexFormat
-
具有位置和法线属性的不可变顶点格式。这与每个实例的颜色外观(如
PerInstanceColorAppearance)兼容。 -
(static, constant) POSITION_AND_STVertexFormat
-
具有position和st属性的不可变顶点格式。这与
EllipsoidSurfaceAppearance兼容。 -
(static, constant) POSITION_NORMAL_AND_STVertexFormat
-
具有position、normal和st属性的不可变顶点格式。当
MaterialAppearance#materialSupport是TEXTURED/code>时,这与MaterialAppearance兼容。 -
(static, constant) POSITION_ONLYVertexFormat
-
只有位置属性的不可变顶点格式。
-
bitangentBoolean
-
当为true时,顶点具有bitangent属性(标准化),用于切线空间效果,如凹凸映射。
32位浮点。每个属性3个组成部分。
- Default Value: false
colorBoolean
当为true时,顶点具有RGB颜色属性。
8位无符号字节。每个属性3个组成部分。
- Default Value: false
heightBoolean
当为true时,顶点具有高度属性。
8位浮点。每个属性1个组成部分。
- Default Value: false
normalBoolean
当为true时,顶点有一个normal属性(normalized),这通常用于照明。
32位浮点。每个属性有3个组成部分。
- Default Value: false
positionBoolean
为true时,顶点具有三维位置属性。
64 位浮点(精度)。每个属性有3个组成部分。
- Default Value: false
stBoolean
当为true时,顶点具有2D纹理坐标属性。
32位浮点。每个属性2个组成部分。
- Default Value: false
tangentBoolean
当为true时,顶点有一个正切属性(标准化),用于切线空间效果,如凹凸映射。
32位浮点,每个属性3个组成部分。
- Default Value: false
Methods
-
static clone(vertexFormat, result){VertexFormat}
-
复制一个VertexFormat实例。
Name Type Description vertexFormatVertexFormat 要复制的顶点格式。
resultVertexFormat 可选 存储结果的对象。
Returns:
Type Description VertexFormat 修改后的结果参数或新的VertexFormat实例(如果没有提供)。 -
static pack(value, array, startingIndex){Array.<Number>}
-
将提供的实例存储到提供的数组中。
Name Type Default Description valueVertexFormat 要打包的值。
arrayArray.<Number> 要装入的数组。
startingIndexNumber 0 可选 开始打包元素的数组的索引。
Returns:
Type Description Array.<Number> 被装入的数组。 -
static unpack(array, startingIndex, result){VertexFormat}
-
从打包数组中检索实例。
Name Type Default Description arrayArray.<Number> 打包数组。
startingIndexNumber 0 可选 要解压缩的元素的起始索引。
resultVertexFormat 可选 存储结果的对象。
Returns:
Type Description VertexFormat 修改后的结果参数或新的VertexFormat实例(如果没有提供)。