new VertexFormat(options)
The vertex format defines the attributes that make up the vertices. Vertex formats can be provided to Geometry to require the calculation of certain attributes, such as only calculating position, position, and normals.
| Name | Type | Description |
|---|---|---|
options |
Object |
optional
As shown in the code example, the object has a Boolean property corresponding to the VertexFormat property. |
- 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 attributes: position, normal st、 Tangents and positional tangents.
-
(static, constant) DEFAULTVertexFormat
-
This is an immutable vertex format with position, normal, and st attributes. It is compatible with most appearances and materials; But normal and st attributes are not always necessary. If this is known in advance, another vertex format (VertexFormat) should be used.
-
static packedLengthNumber
-
The number of elements used to package an 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 the color appearance of each instance, such as PerInstanceColorAppearance.
-
(static, constant) POSITION_AND_STVertexFormat
-
An immutable vertex format with position and st attributes. This is compatible with Ellipsoid Surface Appearance.
-
(static, constant) POSITION_NORMAL_AND_STVertexFormat
-
An immutable vertex format with position, normal, and st attributes. When MaterialAppearance # materialSupport is TEXTURED/code>, it is compatible with MaterialAppearance.
-
(static, constant) POSITION_ONLYVertexFormat
-
The immutable vertex format with only positional attributes.
-
bitangentBoolean
-
When true, the vertex has a bitangent attribute (standardized) used for tangent space effects, such as bump mapping.
32-bit floating point. Each attribute consists of three components.
- Default Value: false
colorBoolean
When true, vertices have RGB color attributes.
8-bit unsigned byte. Each attribute consists of three components.
- Default Value:
false
heightBoolean
When true, the vertex has a height attribute.
8-bit floating point. Each attribute has one component.
- Default Value:
false
normalBoolean
When true, the vertex has a normalized attribute, which is typically used for lighting.
32-bit floating point. Each attribute has three components.
- Default Value:
false
positionBoolean
When true, vertices have three-dimensional positional properties.
64 bit floating point (precision). Each attribute has three components.
- Default Value:
false
stBoolean
When true, the vertex has a 2D texture coordinate attribute.
32-bit floating point. Each attribute has 2 components.
- Default Value:
false
tangentBoolean
When true, vertices have a tangent attribute (normalization) used for tangent space effects, such as bump mapping.
32-bit floating-point, with 3 components per attribute.
- Default Value:
false
Methods
-
static
clone(vertexFormat, result){VertexFormat}
-
Copy a VertexFormat instance.
Name
Type
Description
vertexFormat
VertexFormat
The vertex format to be copied.
result
VertexFormat
optional
The object that stores the results.
Returns:
Type
Description
VertexFormat
The modified result parameters or a new VertexFormat instance (if not provided).
-
static
pack(value, array, startingIndex){Array.<Number>}
-
Store the provided instance in the provided array.
Name
Type
Default
Description
value
VertexFormat
The value to be packaged.
array
Array.<Number>
The array to be loaded.
startingIndex
Number
0
optional
Start packaging the index of the array of elements.
Returns:
Type
Description
Array.<Number>
The array that has been loaded.
-
static
unpack(array, startingIndex, result){VertexFormat}
-
Retrieve instances from the packaged array.
Name
Type
Default
Description
array
Array.<Number>
Package the array.
startingIndex
Number
0
optional
The starting index of the element to be decompressed.
result
VertexFormat
optional
The object that stores the results.
Returns:
Type
Description
VertexFormat
The modified result parameters or a new VertexFormat instance (if not provided).