CoplanarPolygonGeometry

new LSGlobe.CoplanarPolygonGeometry(options)

A description of a polygon composed of arbitrary coplanar positions.
Name Type Description
options Object Object with the following properties:
Name Type Default Description
polygonHierarchy PolygonHierarchy A polygon hierarchy that can include holes.
stRotation Number 0.0 optional The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
vertexFormat VertexFormat VertexFormat.DEFAULT optional The vertex attributes to be computed.
ellipsoid Ellipsoid Ellipsoid.WGS84 optional The ellipsoid to be used as a reference.
Example:
var polygon = new LSGlobe.CoplanarPolygonGeometry({
  positions : LSGlobe.Cartesian3.fromDegreesArrayHeights([
     -90.0, 30.0, 0.0,
     -90.0, 30.0, 1000.0,
     -80.0, 30.0, 1000.0,
     -80.0, 30.0, 0.0
  ])
});
var geometry = LSGlobe.CoplanarPolygonGeometry.createGeometry(polygon);
See:

Members

packedLength : Number

The number of elements used to pack the object into an array.

Methods

static LSGlobe.CoplanarPolygonGeometry.createGeometry(polygonGeometry)Geometry|undefined

Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
Name Type Description
polygonGeometry CoplanarPolygonGeometry A description of the polygon.
Returns:
The computed vertices and indices.

static LSGlobe.CoplanarPolygonGeometry.fromPositions(options)CoplanarPolygonGeometry

A description of a coplanar polygon from an array of positions.
Name Type Description
options Object Object with the following properties:
Name Type Default Description
positions Array.<Cartesian3> An array of positions that defined the corner points of the polygon.
vertexFormat VertexFormat VertexFormat.DEFAULT optional The vertex attributes to be computed.
stRotation Number 0.0 optional The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
ellipsoid Ellipsoid Ellipsoid.WGS84 optional The ellipsoid to be used as a reference.
Returns:
Example:
// create a polygon from points
var polygon = LSGlobe.CoplanarPolygonGeometry.fromPositions({
  positions : LSGlobe.Cartesian3.fromDegreesArray([
    -72.0, 40.0,
    -70.0, 35.0,
    -75.0, 30.0,
    -70.0, 30.0,
    -68.0, 40.0
  ])
});
var geometry = LSGlobe.PolygonGeometry.createGeometry(polygon);
See:
  • PolygonGeometry#createGeometry

static LSGlobe.CoplanarPolygonGeometry.pack(value, array, startingIndex)Array.<Number>

Stores the provided instance into the provided array.
Name Type Default Description
value CoplanarPolygonGeometry The value to pack.
array Array.<Number> The array to pack into.
startingIndex Number 0 optional The index into the array at which to start packing the elements.
Returns:
The array that was packed into

static LSGlobe.CoplanarPolygonGeometry.unpack(array, startingIndex, result)CoplanarPolygonGeometry

Retrieves an instance from a packed array.
Name Type Default Description
array Array.<Number> The packed array.
startingIndex Number 0 optional The starting index of the element to be unpacked.
result CoplanarPolygonGeometry optional The object into which to store the result.
Returns:
The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.