new VertexFormat(options)
A vertex format defines what attributes make up a vertex. A VertexFormat can be provided
to a Geometry to request that certain properties be computed, e.g., just position,
position and normal, etc.
| Name | Type | Description |
|---|---|---|
options |
Object |
可选
An object with boolean properties corresponding to VertexFormat properties as shown in the code example. |
- 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
-
An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.
-
(static, constant) DEFAULTVertexFormat
-
An immutable vertex format with position, normal, and st attributes. This is compatible with most appearances and materials; however normal and st attributes are not always required. When this is known in advance, another
VertexFormatshould be used. -
static packedLengthNumber
-
The number of elements used to pack the object into an array.
-
(static, constant) POSITION_AND_COLORVertexFormat
-
An immutable vertex format with position and color attributes.
-
(static, constant) POSITION_AND_NORMALVertexFormat
-
An immutable vertex format with position and normal attributes. This is compatible with per-instance color appearances like
PerInstanceColorAppearance. -
(static, constant) POSITION_AND_STVertexFormat
-
An immutable vertex format with position and st attributes. This is compatible with
EllipsoidSurfaceAppearance. -
(static, constant) POSITION_NORMAL_AND_STVertexFormat
-
An immutable vertex format with position, normal, and st attributes. This is compatible with
MaterialAppearancewhenMaterialAppearance#materialSupportisTEXTURED/code>. -
(static, constant) POSITION_ONLYVertexFormat
-
An immutable vertex format with only a position attribute.
-
bitangentBoolean
-
When
true, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.32-bit floating-point. 3 components per attribute.
- Default Value: false
colorBoolean
When true, the vertex has an RGB color attribute.
8-bit unsigned byte. 3 components per attribute.
- Default Value: false
heightBoolean
When true, the vertex has an height attribute.
8-bit floating-point. 1 per attribute.
- Default Value: false
normalBoolean
When true, the vertex has a normal attribute (normalized), which is commonly used for lighting.
32-bit floating-point. 3 components per attribute.
- Default Value: false
positionBoolean
When true, the vertex has a 3D position attribute.
64-bit floating-point (for precision). 3 components per attribute.
- Default Value: false
stBoolean
When true, the vertex has a 2D texture coordinate attribute.
32-bit floating-point. 2 components per attribute
- Default Value: false
tangentBoolean
When true, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
32-bit floating-point. 3 components per attribute.
- Default Value: false
Methods
-
static clone(vertexFormat, result){VertexFormat}
-
Duplicates a VertexFormat instance.
Name Type Description vertexFormatVertexFormat The vertex format to duplicate.
resultVertexFormat 可选 The object onto which to store the result.
Returns:
Type Description VertexFormat The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) -
static pack(value, array, startingIndex){Array.<Number>}
-
Stores the provided instance into the provided array.
Name Type Default Description valueVertexFormat The value to pack.
arrayArray.<Number> The array to pack into.
startingIndexNumber 0 可选 The index into the array at which to start packing the elements.
Returns:
Type Description Array.<Number> The array that was packed into -
static unpack(array, startingIndex, result){VertexFormat}
-
Retrieves an instance from a packed array.
Name Type Default Description arrayArray.<Number> The packed array.
startingIndexNumber 0 可选 The starting index of the element to be unpacked.
resultVertexFormat 可选 The object into which to store the result.
Returns:
Type Description VertexFormat The modified result parameter or a new VertexFormat instance if one was not provided.