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.
alias Geometry
- The options object takes the following properties
- {GeometryAttributes} options.attributes Attributes, which make up the geometry's vertices.
- {PrimitiveType} [options.primitiveType=PrimitiveType.TRIANGLES] The type of primitives in the geometry.
- {Uint16Array|Uint32Array} [options.indices] Optional index data that determines the primitives in the geometry.
- {BoundingSphere} [options.boundingSphere] An optional bounding sphere that fully enclosed the geometry.
Annotations
@RawJSType()@native()@JSName("Cesium.Geometry")
Example:
// Create geometry with a position attribute and indexed lines.
var positions = new Float64Array([
0.0, 0.0, 0.0,
7500000.0, 0.0, 0.0,
0.0, 7500000.0, 0.0
]);
var geometry = new Cesium.Geometry({
attributes : {
position : new Cesium.GeometryAttribute({
componentDatatype : Cesium.ComponentDatatype.DOUBLE,
componentsPerAttribute : 3,
values : positions
})
},
indices : new Uint16Array([0, 1, 1, 2, 2, 0]),
primitiveType : Cesium.PrimitiveType.LINES,
boundingSphere : Cesium.BoundingSphere.fromVertices(positions)
});
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.
alias Geometry
- The options object takes the following properties - {GeometryAttributes} options.attributes Attributes, which make up the geometry's vertices. - {PrimitiveType} [options.primitiveType=PrimitiveType.TRIANGLES] The type of primitives in the geometry. - {Uint16Array|Uint32Array} [options.indices] Optional index data that determines the primitives in the geometry. - {BoundingSphere} [options.boundingSphere] An optional bounding sphere that fully enclosed the geometry.
// Create geometry with a position attribute and indexed lines. var positions = new Float64Array([ 0.0, 0.0, 0.0, 7500000.0, 0.0, 0.0, 0.0, 7500000.0, 0.0 ]); var geometry = new Cesium.Geometry({ attributes : { position : new Cesium.GeometryAttribute({ componentDatatype : Cesium.ComponentDatatype.DOUBLE, componentsPerAttribute : 3, values : positions }) }, indices : new Uint16Array([0, 1, 1, 2, 2, 0]), primitiveType : Cesium.PrimitiveType.LINES, boundingSphere : Cesium.BoundingSphere.fromVertices(positions) });
EllipsoidGeometry demo and Appearances Demo
BoxGeometry
SimplePolylineGeometry
WallGeometry
CircleGeometry
EllipseGeometry
RectangleGeometry
PolygonGeometry