CoplanarPolygonGeometry

new Cesium.CoplanarPolygonGeometry(options)

A description of a polygon composed of arbitrary coplanar positions.
参数名称 类型 描述信息
options object Object with the following properties:
参数名称 类型 默认值 描述信息
polygonHierarchy PolygonHierarchy A polygon hierarchy that can include holes.
stRotation number 0.0 可选 The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
vertexFormat VertexFormat VertexFormat.DEFAULT 可选 The vertex attributes to be computed.
ellipsoid Ellipsoid Ellipsoid.WGS84 可选 The ellipsoid to be used as a reference.
textureCoordinates PolygonHierarchy 可选 Texture coordinates as a PolygonHierarchy of Cartesian2 points.
使用示例:
const polygonGeometry = new Cesium.CoplanarPolygonGeometry({
 polygonHierarchy: new Cesium.PolygonHierarchy(
    Cesium.Cartesian3.fromDegreesArrayHeights([
     -90.0, 30.0, 0.0,
     -90.0, 30.0, 300000.0,
     -80.0, 30.0, 300000.0,
     -80.0, 30.0, 0.0
  ]))
});

成员(属性)

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

方法

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

Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
参数名称 类型 描述信息
polygonGeometry CoplanarPolygonGeometry A description of the polygon.
返回值:
The computed vertices and indices.

static Cesium.CoplanarPolygonGeometry.fromPositions(options)CoplanarPolygonGeometry

A description of a coplanar polygon from an array of positions.
参数名称 类型 描述信息
options object Object with the following properties:
参数名称 类型 默认值 描述信息
positions Array.<Cartesian3> An array of positions that defined the corner points of the polygon.
vertexFormat VertexFormat VertexFormat.DEFAULT 可选 The vertex attributes to be computed.
stRotation number 0.0 可选 The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
ellipsoid Ellipsoid Ellipsoid.WGS84 可选 The ellipsoid to be used as a reference.
textureCoordinates PolygonHierarchy 可选 Texture coordinates as a PolygonHierarchy of Cartesian2 points.
返回值:
使用示例:
// create a polygon from points
const polygon = Cesium.CoplanarPolygonGeometry.fromPositions({
  positions : Cesium.Cartesian3.fromDegreesArray([
    -72.0, 40.0,
    -70.0, 35.0,
    -75.0, 30.0,
    -70.0, 30.0,
    -68.0, 40.0
  ])
});
const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
参考:
  • PolygonGeometry#createGeometry

static Cesium.CoplanarPolygonGeometry.pack(value, array, startingIndex)Array.<number>

Stores the provided instance into the provided array.
参数名称 类型 默认值 描述信息
value CoplanarPolygonGeometry The value to pack.
array Array.<number> The array to pack into.
startingIndex number 0 可选 The index into the array at which to start packing the elements.
返回值:
The array that was packed into

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

Retrieves an instance from a packed array.
参数名称 类型 默认值 描述信息
array Array.<number> The packed array.
startingIndex number 0 可选 The starting index of the element to be unpacked.
result CoplanarPolygonGeometry 可选 The object into which to store the result.
返回值:
The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.