new Cesium.CoplanarPolygonGeometry(options)

描述一个由任意的同位素位置组成的多边形.
Name Type Description
options object 下列属性的对象 :
Name Type Default Description
polygonHierarchy PolygonHierarchy 多边形结构可以包括孔.
stRotation number 0.0 optional 纹理坐标的旋转,以弧度表示. 正旋转是逆时针.
vertexFormat VertexFormat VertexFormat.DEFAULT optional The vertex attributes to be computed.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid to be used as a reference.
textureCoordinates PolygonHierarchy optional Texture coordinates as a PolygonHierarchy of Cartesian2 points.
Example:
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
  ]))
});

Members

packedLength : number

用于将对象组合成数组的元素数量.

Methods

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

计算任意的coplanar多边形的几何表示,包括其顶点,指数,以及边框.
Name Type Description
polygonGeometry CoplanarPolygonGeometry 多边形描述.
Returns:
计算出的顶点和指数.

static Cesium.CoplanarPolygonGeometry.fromPositions(options)CoplanarPolygonGeometry

描述一组位置上的同形多边形.
Name Type Description
options object 下列属性的对象 :
Name Type Default Description
positions Array.<Cartesian3> 定义多边形角点的一系列位置.
vertexFormat VertexFormat VertexFormat.DEFAULT optional The vertex attributes to be computed.
stRotation number 0.0 optional 纹理坐标的旋转,以弧度表示. 正旋转是逆时针.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid to be used as a reference.
textureCoordinates PolygonHierarchy optional Texture coordinates as a PolygonHierarchy of Cartesian2 points.
Returns:
Example:
// 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);
See:
  • PolygonGeometry#createGeometry

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

将所提供的实例存储到所提供的数组中.
Name Type Default Description
value CoplanarPolygonGeometry 包装的价值.
array Array.<number> 装入的阵列.
startingIndex number 0 optional The index into the array at which to start packing the elements.
Returns:
装入的阵列

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

从组合的数组中获取实例 .
Name Type Default Description
array Array.<number> 装填的阵列.
startingIndex number 0 optional The starting index of the element to be unpacked.
result CoplanarPolygonGeometry optional 存储结果的对象.
Returns:
如果不提供经修改的结果参数或新的CoplanarPolygonGeometry实例.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.