Geometry
A geometry representation with attributes forming vertices and optional index data defining primitives. Geometries and an Appearance, which describes the shading, can be assigned to a Primitive for visualization. A Primitive
can be created from many heterogeneous - in many cases - geometries for performance.
Geometries can be transformed and optimized using functions in GeometryPipeline.
// Create geometry with a position attribute and indexed lines.
const positions = new Float64Array([
0.0, 0.0, 0.0,
7500000.0, 0.0, 0.0,
0.0, 7500000.0, 0.0
]);
const geometry = new Geometry({
attributes : {
position : new GeometryAttribute({
componentDatatype : ComponentDatatype.DOUBLE,
componentsPerAttribute : 3,
values : positions
})
},
indices : new Uint16Array([0, 1, 1, 2, 2, 0]),
primitiveType : PrimitiveType.LINES,
boundingSphere : BoundingSphere.fromVertices(positions)
});
See also
Types
Properties
Attributes, which make up the geometry's vertices. Each property in this object corresponds to a GeometryAttribute containing the attribute's data.
An optional bounding sphere that fully encloses the geometry. This is commonly used for culling.
Optional index data that - along with Geometry.primitiveType - determines the primitives in the geometry.
The type of primitives in the geometry. This is most often PrimitiveType.TRIANGLES, but can varying based on the specific geometry.