GeometryAttribute

external class GeometryAttribute(source)

Values and type information for geometry attributes. A Geometry generally contains one or more attributes. All attributes together form the geometry's vertices.

const geometry = new Geometry({
attributes : {
position : new GeometryAttribute({
componentDatatype : ComponentDatatype.FLOAT,
componentsPerAttribute : 3,
values : new Float32Array([
0.0, 0.0, 0.0,
7500000.0, 0.0, 0.0,
0.0, 7500000.0, 0.0
])
})
},
primitiveType : PrimitiveType.LINE_LOOP
});

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The datatype of each component in the attribute, e.g., individual elements in GeometryAttribute.values.

Link copied to clipboard

A number between 1 and 4 that defines the number of components in an attributes. For example, a position attribute with x, y, and z components would have 3 as shown in the code example.

Link copied to clipboard

When true and componentDatatype is an integer format, indicate that the components should be mapped to the range 0, 1 (unsigned) or -1, 1 (signed) when they are accessed as floating-point for rendering.

Link copied to clipboard
var values: Any

The values for the attributes stored in a typed array. In the code example, every three elements in values defines one attributes since componentsPerAttribute is 3.