ClippingPolygonCollection
Specifies a set of clipping polygons. Clipping polygons selectively disable rendering in a region inside or outside the specified list of ClippingPolygon objects for a single glTF model, 3D Tileset, or the globe.
Clipping Polygons are only supported in WebGL 2 contexts.
const positions = Cartesian3.fromRadiansArray([
-1.3194369277314022,
0.6988062530900625,
-1.31941,
0.69879,
-1.3193955980204217,
0.6988091578771254,
-1.3193931220959367,
0.698743632490865,
-1.3194358224045408,
0.6987471965556998,
]);
const polygon = new ClippingPolygon({
positions: positions
});
const polygons = new ClippingPolygonCollection({
polygons: [ polygon ]
});
See also
Types
Properties
Returns the number of polygons in this collection. This is commonly used with ClippingPolygonCollection.get to iterate over all the polygons in the collection.
An event triggered when a new clipping polygon is added to the collection. Event handlers are passed the new polygon and the index at which it was added.
An event triggered when a new clipping polygon is removed from the collection. Event handlers are passed the new polygon and the index from which it was removed.
Functions
Adds the specified ClippingPolygon to the collection to be used to selectively disable rendering on the inside of each polygon. Use ClippingPolygonCollection.unionClippingRegions to modify how modify the clipping behavior of multiple polygons.
Checks whether this collection contains a ClippingPolygon equal to the given ClippingPolygon.
Returns the clipping polygon in the collection at the specified index. Indices are zero-based and increase as polygons are added. Removing a polygon polygon all polygons after it to the left, changing their indices. This function is commonly used with ClippingPolygonCollection.length to iterate over all the polygons in the collection.
Returns true if this object was destroyed; otherwise, false.
Removes the first occurrence of the given ClippingPolygon from the collection.